Move:
mg->GetXaxis()->SetTitle("x");
After:
mg->Draw("AC");
The axis does not exist before Draw()
-----Original Message-----
From: owner-rootdev_at_root.cern.ch [mailto:owner-rootdev_at_root.cern.ch] On
Behalf Of Christian Hansen
Sent: Friday, April 16, 2010 4:11 PM
To: roottalk_at_root.cern.ch; roottalk
Subject: [ROOTDEV] TMultiGraph Axis
Dear Rooters,
My program crashes when I try to set the axis title of a TMultiGraph. Would anyone know why? An example code is attached and I use v5.26.
Best regards
/Christian
TCanvas *c = new TCanvas("c","MultiGraph example",0,0,600,400);
Double_t x, y, z, P = 6.;
Int_t np = 200;
TMultiGraph *mg = new TMultiGraph();
TGraph *gr1 = new TGraph(); TGraph *gr2 = new TGraph(); TRandom *r = new TRandom();
This archive was generated by hypermail 2.2.0 : Sun Apr 18 2010 - 17:50:01 CEST