Hi Thomas,
You have mistake in your code. Replace the line
TH1F *h = TGraph->GetHistogram();
by
TH1F *h = graph[1]->GetHistogram();
Rene Brun
On Wed, 28 Feb 2001, Thomas Feser wrote:
>
> Hi all,
>
> I'm still struggling with TGrap objects. The current problem is:
>
> I want to read several TGraph object from a file, draw them in a
> specified X-Axis range to write them into an .eps file.
> I'm doing the following:
>
> graph[1] = (TGraphErrors*) myfile->Get("name_of_graph_no_1");
> mypad->cd();
> graph[1]->Draw("AP");
> mypad->Modified(kTRUE);
> myPad->Update();
>
> and now, to get access to the Xaxis, I say
>
> TH1F *h = TGraph->GetHistogram();
>
> because I want to do something like
>
> h->SetRange(...);
>
> However, the returned pointer h is NULL.
>
> Is there maybe a different method to change a graphs axis? Or am I
> missing a neccessary command to get the histogram inside the graph
> created?
>
> Thanks & Cheers,
> _
> |om
>
>
> ------------------------------------------------------------------------
> - Thomas Feser -
> - -
> - Institut fuer Physik phone: +49-6131-39-25165 -
> - ETAP/AMANDA fax: +49-6131-39-25169 -
> - Staudingerweg 7 / 04-426 -
> - D-55099 Universitaet Mainz -
> - -
> - Thomas.Feser@uni-mainz.de -
> - http://iphcip1.physik.uni-mainz.de/~tfeser -
> ------------------------------------------------------------------------
>
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:38 MET