[ROOT] TMultiGraph question

From: Andre Holzner (Andre.Holzner@cern.ch)
Date: Tue Jan 30 2001 - 13:08:53 MET


Hi,

I tried combining several TGraphs into a single plot.
However, I can't make it work. 

Should this boiled down example work (macro) ?

{
  Int_t n = 5;

  Double_t x[n] = { 60,60.1,60.2,60.3,60.4 };
 TGraph *gr = new TGraph(n,x,x);
 TMultiGraph *mg = new TMultiGraph();
 mg->Add(gr);
 mg->Draw("AL");

}


After starting root and executing the macro, I get the following error
message:

<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
Error in <TCanvas::Range>: illegal world coordinates range:
x1=15000000055879354670346081189857239812301458438980120411468904470533805084809352140353424763585036288.000000,
y1=12000000000000000579368471762264830745925351641438118996218960879725310776966939220757021024069877760.000000,
x2=-15000000055879354670346081189857239812301458438980120411468904470533805084809352140353424763585036288.000000,
y2=12000000000000000579368471762264830745925351641438118996218960879725310776966939220757021024069877760.000000
Error in <TCanvas::RangeAxis>: illegal axis coordinates range:
xmin=12000000000000000579368471762264830745925351641438118996218960879725310776966939220757021024069877760.000000,
ymin=12000000000000000579368471762264830745925351641438118996218960879725310776966939220757021024069877760.000000,
xmax=-12000000000000000579368471762264830745925351641438118996218960879725310776966939220757021024069877760.000000,
ymax=12000000000000000579368471762264830745925351641438118996218960879725310776966939220757021024069877760.000000                                              


A canvas is created but the graph does not appear.
Drawing the Graph gr directly works without any problems.

I also experimented with the TMultiGraph example in the User's Guide on
Page 58.
I get a similar error message when I comment (remove) the line

   mg->Add(gr2);

i.e. the example doesn't work when the TGraphErrors is not added.


Any ideas ?


thanks,


André





-- 
------------------+----------------------------------
Andre Holzner     | +41 22 76 76750 
Bureau 32 2-C13   | Building 32     
CERN              | Office 2-C13    
CH-1211 Geneve 23 | http://wwweth.cern.ch/~holzner/



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:35 MET