New Solid line at origin, can it be disabled?

Hi All,

I recently upgraded my Mac OSX machine from Root 4.04.02 to 5.14.00. I’ve noticed something odd about the plots that are generated by TGraph: there is a solid line at the origin. Is it my imagination or is this new?

I would like to disable it as it can be annoying when the values plotted approach y=0. I’ve tried going through the editor and looking through the paint methods for flags that might change the axis drawing, but haven’t had any luck yet.

Here’s a quick script and the ouput so you can see what I’m talking about.

{

TCanvas c1;
TGraph g;

// Fill graph with some test points
g.SetPoint(0, -1,-1);
g.SetPoint(1,  0, 0);
g.SetPoint(2,  1, 1);

g.SetTitle("Notice solid line at y=0");
g.Draw("A*");

}

Thanks for your help.

Josh


You can try:

{
   TCanvas c;
   // Empty frame
   c1 = new TPad("c1","c1",0.,0.,1.,1.,0,0,0);
   c1->SetFillStyle(0);
   c1->SetFrameFillStyle(0);
   c1->Draw(); c1->cd();
   c1->DrawFrame( -1.1, -1.1, 1.1, 1.1);
                                                                                
   TGraph g;
                                                                                
   // Fill graph with some test points
   g.SetPoint(0, -1,-1);
   g.SetPoint(1,  0, 0);
   g.SetPoint(2,  1, 1);
                                                                                
   g.SetTitle("Notice solid line at y=0");
   g.Draw("*");
}

Thanks, that does what I want.

I re-checked my old v4.04 plots and my sanity is still intact: this is new behaviour. Perhaps the draw option “A” could function as it used to (“Draw axis around the graph” as TGraph::PaintGraph() says) and a new option, say “O” could be for “Draw Origin”.

I suppose what users expect to happen is a matter of circumstance and personal preference. Personally, I would benefit from returning draw option “A” to its previous behaviour and creating a separate flag for drawing of the origin.

Just my two cents. Thanks again!

Josh

I am surprised that it worked differently before. Seems to me this line has always been there. But I’ll check in the CVS history what could have triggered this change.

You are right I found the bug. It is now fixed in the CVS head.
Thanks to have reported it.

That’s great, thanks for looking into that.

Josh