Pyroot different graphic behavior in batch mode

Hi,

I have a module producing (and saving) some plots. The plots from batch mode (-b) look different from those from interactive mode when saved as .gif, .jpg and .tiff. Main differences are the size of the (tgraph) markers and the style of the lines. When saving as .ps however, the result is the same for both interactive and batch.

I don’t know if this is a pyroot issue (did not try with pure root). Is there a fix… or at least an explaination?

Regards,

Jean-Francois

Jean-Francois,

I’d be surprised if the difference is due to python (and hence you may get better feedback on the general support forum). However, the minimum for providing help would be a script to show the problem?

Cheers,
Wim

Hi Wim,

Here is a code example:

import ROOT

mygraf = ROOT.TGraph(5)
mygraf.SetPoint(0,1,1)
mygraf.SetPoint(1,2,1)
mygraf.SetPoint(2,3,1)
mygraf.SetPoint(3,4,1)
mygraf.SetPoint(4,5,1)

mygraf.SetMarkerStyle(20)
mygraf.SetMarkerColor(ROOT.kBlue)
mygraf.SetLineStyle(2)
mygraf.SetLineWidth(3)

c = ROOT.TCanvas('mycanvas', 'mycanvas')

mygraf.Draw('Alp')
c.Print('mycanvas.gif', 'gif')

If I run it in normal mode, I get a nice looking results (cf. attachement mycanvas.gif). If I run it in batch (-b) mode, it looks ugly (cf. attachment mycanvas_b.gif).

Are settings different in batch mode and interactive mode? I agree that this is probably not a pyroot problem since the results are the same when I save in ps format. Sorry for squatting the pyroot forum.

Regards,

Jean-Francois




Jean-Francois,

the example that you provided is trivially turned into a .C one to run with root.exe:[code]#include “TGraph.h”
#include “TCanvas.h”

void testgraph() {
TGraph mygraf = TGraph(5);
mygraf.SetPoint(0,1,1);
mygraf.SetPoint(1,2,1);
mygraf.SetPoint(2,3,1);
mygraf.SetPoint(3,4,1);
mygraf.SetPoint(4,5,1);

mygraf.SetMarkerStyle(20);
mygraf.SetMarkerColor(kBlue);
mygraf.SetLineStyle(2);
mygraf.SetLineWidth(3);

TCanvas c = TCanvas(“mycanvas”, “mycanvas”);

mygraf.Draw(“Alp”);
c.Print(“mycanvas.gif”, “gif”);
}[/code]
and yes, it has the exact same behavior. Either file a bug report on savannah or ask the experts on the general support forum, as this is outside my expertise …

Cheers,
Wim