Image saving style problems

I’m sure I can’t be the first person to have this problem but can’t find it anywhere online so:

When I produce a histogram/graph and view it in a TBrowser it looks as it should.

If I then save it as a .jgp/.png it looks as it does in the TBrowser. However, for my thesis I need it to be saved as some sort of vector graphics format (don’t mind what at this stage), but whenever I save as .eps/.pdf it comes out looking very different.

As this must be a very common problem I though I would ask rather than trying to work out exactly which style options I need to set to get my PDFs looking as they do in the TBrowser/jpeg files.

So, does anyone know what the options to set are / a work around for this (surely common) problem?

Thanks in advance!

It should not. Do you have an example ?

Here are two examples, one with a TH1F and the other with a TMultiGraph. The main (possibly only) difference is the line thicknesses, but this is of the data points, error bars, the axes, the fit line and the grid.

These were saved by viewing the ROOT file in a TBrowser and using the SaveAs option on the canvas, however the same result is reached when saving in code.

The code used to generate the ROOT file was written with PyRoot but again the results are the same when using C++.

If you would like either the Python or the ROOT file attached then please ask.

(ROOT Version 5.32/01 running on Win7x64 though have seen this behaviour on WinXP systems running older versions of ROOT)



multigraph.pdf (15.9 KB)


Histo1.pdf (14.3 KB)

 The main (possibly only) difference is the line thicknesses, 

try to use:

gStyle->SetLineScalePS(s);

for instance s = 0.5 (default is 3)

Many thanks, that is indeed the option I was looking for, look like the problem is now fixed. I’m surprised more people don’t have this problem!

Is there any reason why the default for png/jpeg is different to the default for eps/pdf?

The number of pixels per inch is quite different from screen and paper. The paper use to be 300 dpi for the
worst definition. The kind of definition is now reached by the retina displays. But still 600 dpi for a printer is
common. There people some people like to have this much thiner lines some like thicker. That’s why we of a way to adjust it. although it seems you are looking at the ps on screen …