Hi all,
I recently discovered what I consider a bug in the parsing of draw options for TGraph
or TMultiGraph
objects. When same
is included in the draw options, the result will depend on whether the object is a TGraph
or a TMultiGraph
.
I know and understand, that this option is not documented and this is not the way to achieve this, but in any case the result should be the same for both types of objects.
Here is a minimal example:
from ROOT import *
import array
c = TCanvas("c","multigraphs on same pad",200,10,500,1000)
c.cd()
pad1 = TPad("TMultiGraph", "TMultiGraph", 0,0.5,1,1)
pad2 = TPad("TGraph", "TGraph", 0,0,1,0.5)
x1 = array.array("f",[1,2,3])
y1 = array.array("f",[4,7,6])
x2 = array.array("f",[3,5,6])
y2 = array.array("f",[0,9,4])
gr1 = TGraphErrors(3,x2,y2,x1, y1)
# draw thisto
h = TH1D("histo","histo", 10,0,10)
h.Fill(5,9)
pad1.Draw()
pad1.cd()
h.DrawCopy()
# Draw multigraph
mg1 = TMultiGraph()
mg1.Add(gr1)
mg1.Draw("same1")
c.cd()
pad2.Draw()
pad2.cd()
h.DrawCopy()
# Draw graph
gr1.Draw("same1")
c.SaveAs("test.pdf")
I tested this with 6.04/08
under macosx64
.