Colored 2D histograms in pdf output

Transparency now works for pdf and i have implemented transparent palettes. I will check monday what Alberto means

That’s nice, I did not realize that before! Thanks for the info.

By using h->SetFillColorAlpha it works for 1D solid filled areas (no need for fill styles). Alberto, then you should define your gray 2D histogram with a high-transparent palette for seeing the orange one behind, I guess.

SetPalette has the Alpha parameter too:

root.cern.ch/root/htmldoc/TColo … SetPalette

Hello Oliver,
This is great that transparency works now in pdf.
I have just 2 fast questions:

  1. Which version of ROOT do I have to download to test it?
    I downloaded and installed from source tha latest ROOT 6 pro version.
    Can I update from there somehow to get the latest changes?
  2. Does not the stroke line that you added around the colored bins to “fix” buggy previewers kill transparency?
    Cheers,
    Alberto

Yes this one is fine.

What do you mean by “kill transparency” ?.. they are 2 different issues. I hope you do not really on the buggy behaviour to make you plots. You should not. This behaviour is now gone. Now you should use the transparency properly as explained in the doc.

Sorry Oliver I couldn’t try yet the new transparency feature as I have a problem with my rootlogon.C script in ROOT 6:
[root.cern.ch/phpBB3/viewtopic.p … 107#p82905](Problem loading customized style while launching ROOT

What I meant with kill transparency is the following:
Now ROOT 6 draws a stroke around the bins in the PDF PS output, isn’t?
Then although colored areas have transparency through the Alpha parameter, it will not affect the stroke lines, which will remain opaque.
This is only a guess since I haven’t tried yet…

I am not doing the line myself… PDF does it … but nevertheless there is an issue with transparency and and stoke line…
Looking at it now.

You had a good point. The "b* PDF operator does fill and stoke, but in case of transparent colors, because there is a double pass on the stroke width, the border appears darker than the inside of the box.
In case of transparency the operator “f*” should be used instead (like before). Luckily, with transparent colors, the preview bug in smoothing does not show. The fix is in now.

Very well! I still get the white lines with root-6.02.05.
LotovRadius.pdf (30.6 KB)
How can I get the new modified files in order to not to re-download and re-compile the whole thing?

It is enough to replace $ROOTSYS/graf2d/postscript/src/TPDF.cxx by the one attached.
TPDF.cxx (77.5 KB)

OK. If one doesn’t set any transparency (alpha = 1) it works nicely :
LotovRadius.pdf (31 KB)
But as soon as one sets the color palette with alpha, the white lines appear again.
This is an example with alpha = 0.7:
LotovRadiusAlpha0.7.pdf (40.4 KB)
Of course if one decreases the alpha so the colors are more transparent, there is a point in which one cannot distinguish the white lines.
Now alpha = 0.2:
LotovRadiusAlpha0.2.pdf (31.2 KB)
Cheers!

Yes, I agree. I see the same too. not that in the case of Alpha = 0.7 it looks better if smoothing is on than of in the previewer. At least you do not have to play anymore with the preview settings.
Now I have now idea yet on how to improve the transparency case.
At least alpha=1 is fine which is 99% of the plots…

Hello! This is how the plot looks now with the latest changes you did in TPDF:
Snapshot1-rake-v10kA.G.SR2.RI.3D_20.new.pdf (292 KB)
Which is not bad already!
However, if you zoom into the section where the gray histogram overlays the orange we see that the line stroke for non-transparent histograms is too thick.
We can directly compare thanks to the white lines in the transparent histogram (the gray).
Is not possible to make this stroke thiner or even to find a solution that doesn’t involve a stroke at all?

I case of transparent color there is no stoke at all right now …
See the if statement in TPDF:DrawBox

yes, that’s clear. I mean the stroke in the non-transparent histogram. It is quite thick in comparison to the bin size. If you compare the bin size in the transparent histo with the non-transparent one you see that, counting the stroke the bins are substantially bigger:

I am lost … the stroke when alpha = 1 is not visible because it is the same color as the filled part of the box… the lines you see cannot come from the stroke when alpha = 1

What you see is the “white line” of the transparent histogram with alpha = 0.8 (gray one).
The bin boundaries of the solid histogram (with the stroke) are significantly bigger than the transparent one (with no stroke). It would be good if that stroke can be at least thiner.

With the latest TPDF:

-> 0.8 has no stroke. If you see ta stroke it is either a bug in the preview program of the fact the if the box overlap slightly the superimposition makes dark lines on the boxes border.

-> 1 has stoke, but with the exact color of the inside of the box, which is filled, so you cannot see them . That was the initial idea of the fix I did !!

In the simple case of only one histo with alpha < 1 I agree there is some lines appearing. As I said I am not sure how to fix that bug in the preview program. Either it is again a bug in the preview or it is boxes overlapping a bit. That should be checked.

It is simply that the fix with stroke for solid histograms is not perfect as it makes the bins overlapping each other and create a “misleading” effect.
Cannot be the stroke thiner so the final result is more accurate?

I need time …