Canvas PDF export bad quality

I am creating a figure with ROOT which, when viewed within a ROOT canvas everything looks very lovely, but when exporting to PDF, everything looks terrible. Lines are too “fat” almost everywhere including on the data “error bars”, the dash style doesn’t match what I think I should be getting, etc. The .eps export doesn’t look any better. Of course, this has been the case with ROOT vector graphics exports on Mac for many years, but the problem seems to be getting worse, not better, over time. I attach a screenshot of what the figure looks like in a ROOT canvas, and what the PDF export looks like. Given the central importance to ROOT users of exporting publication-quality plots to vector graphics formats, it would seem very important for ROOT to eventually fix this/improve the situation. Are there any graphics settings in the system.rootrc file that I can play around with to improve the situation? One feature of my figure worth noting is that I set CanvasPreferGL to true with “SetFillColorAlpha” to get the semi-transparent shading on the two “bands” in the lower panel. I am also using the “precision 3” fonts everywhere and the LaTeX syntax for the y axis title in the lower panel. The fat lines on the “square root” symbol are particularly annoying.

Fig1.pdf (34.1 KB)


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.20
Platform: Mac OS X 10.14
Compiler: clang (XCode 10.X)


Change SetLineScalePS. The default value is 3. Set a smaller one like 1 or even smaller.

gStyle->SetLineScalePS(...);

Thanks, Olivier, that made a huge improvement! While the first line on the square root symbol in the PDF still looks a bit abnormally wide, the quality is certainly acceptable now.

The first line of square root on the screen is wider too.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.