Hi Vincent, In the case of a TGraph, or TMultiGraph, the X and Y axis do not exist yet if the object is not paint in the pad. You should do: mg->Draw(options); mycanvas->Modified(); MyCanvas->Update(); mg->GetXaxis()->SetRangeUser(-1,1); See the graphics chapter in the Users Guide. Rene Brun On Wed, 19 Jun 2002, Vincent [iso-8859-1] Régnard wrote: > Hi rooters > I am using TMultigraph objects and when I try to modify the range for the > Xaxis I get into trouble: > > Let mg be a pointer to a Tmultigraph > I can Draw the multigraph properly and even play with the Yaxis using the > SetMaximum and SetMinimum methods > > But when doing: > mg->GetXaxis()->SetRangeUser(-1,1); > I get the following answer using cint: > "Error: illegal pointer to class object GetXaxis() 0x0 " > > and when doing a mg->GetXaxis() > "(const class TAxis*)0x0" > > I get exactly the same answer invoking the GetYaxis() method. > What is this strange adress 0x0 ?? Is it expected so? > How can I modify the Xrange for my TMultigraph ? > > > -- > > Don't look now, but there is a multi-legged creature on your shoulder. > , , > / \ > ((__-^^-,-^^-__)) > `-_---' `---_-' > `--|o` 'o|--' > \ ` / > ): :( > :o_o: http://www.calvix.org > "-" http://www.gnu.org >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:57 MET