I have this persistent problem in ROOT 5.12 (but also in 5.18) that I cannot draw all markers in batch mode. I save a png file with TCanvas::Print, after updating my pads.
Please have a look at the attached files. One was produced with “root -b -q myscript.C”, the other with “root myscript.C”. The rightmost graph on the second row is invisible if I use marker style 8 (or 20). If I change the marker style to 5 in my script, it does work, miraculously. Other markers (eg 24) even give segfaults in batch mode.
It is rather strange that the different marker styles give such a variey in outcomes.
Is this a known problem? How can I solve this within ROOT 5.12 (I prefer not to change version)? Do you have any ideas?
I do not see this problem with the last root version. The attached image has been produced with it. Which marker type are you using ? . The macro I used to produce this image is:
drawmarker(double x, double y, int mt, double d)
{
char val[3];
sprintf(val,"%d",mt);
double dy=d/3;
TMarker *m = new TMarker(x+0.1, y, mt);
TText *t = new TText(x-0.1, y, val);
TLine *l1 = new TLine(0,y,1,y);
TLine *l2 = new TLine(0,y+dy,1,y+dy);
TLine *l3 = new TLine(0,y-dy,1,y-dy);
l2->SetLineStyle(2);
l3->SetLineStyle(2);
m->SetMarkerSize(3.8);
m->SetMarkerColor(kRed);
t->SetTextAlign(32);
t->SetTextSize(0.3);
t->Draw();
l1->Draw();
l2->Draw();
l3->Draw();
m->Draw();
}
markers()
{
TCanvas *c1 = new TCanvas("c1", "c1",14,28,100,800);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderSize(2);
int i;
double x = 0.5;
double y = 0.1;
double dy = 0.05;
for (i = 1; i<=7; i++) {
drawmarker(x, y, i, dy);
y = y+dy;
}
for (i = 20; i<=30; i++) {
drawmarker(x, y, i, dy);
y = y+dy;
}
c1->Print("c1.gif");
c1->Print("c1.ps");
c1->Print("c1.pdf");
}
It you do not want to change the ROOT version. Try this macro in batch and choose a marker which is visible in batch.
This was the output of your script in batch mode. The interesting markers (7,8) are invisible, which is sad because they look better on a hist->Draw(“bla”,“bla”,“p e”) than with the ones that are visible.
In the end I took 28 and scaled it down. Too bad, but I really need the batch mode.