Colored 2D histograms in pdf output

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 …

Hi Oliver, Of course take your time. I really appreciate that you are working on this.
The colored histograms look much better already in pdf in whatever viewer!
Thanks a lot.

Hi, as a future suggestion / possible implementation,
we may control the stroke width through TH2::SetLineWidth and then in TPDF call SetLineWidth(fLineWidth) if alpha==1, as in DrawPolyline.

thanks.

No. This stroke is just a way to bypass the previewers bug. It is done at the PS and PDF level only. I am looking at it.

When the boxes are transparent I do not have any obvious solution.

We cannot draw the stoke (even very thin, I tried) because it appears as a darker grid.

Also, even without stroke, it is hard to avoid tiny overlapping between some boxes because of rounding errors. That makes also darker lines. Turning off the smoothing in the previewer does not help either. Also depending on the zoom level, line may appear or disappear. In case the smoothing is on (default) we fall back in the previous problem of thin white lines because there is no stroke.

Again if you visualise the PDF with transparent COLZ plot using Adobe Acrobat, all is fine !!.. no lines !!..

In the case of transparent COL plots the previewer bug will be much harder to avoid. At least I have no solution for the time being. If you find one let me know.