Re: Adding TGraph to a Directory

From: Rene BRUN <brun_at_mail.cern.ch>
Date: Thu, 10 Mar 2005 14:15:29 +0100 (MET)


Christian,

This problem was fixed a few weeks ago.
The intermediate histogram is generated with a name like "mygraph_h" instead of "mygraph"

Rene Brun

On Thu, 10 Mar 2005,
Christian
Vogel wrote:

> Hi Root-Talk,
>
> I don't know if this is a bug or I don't fully understand the semantics
> of root very well, but let me explain:
>
> I put some values in a TErrorGraph and want to store that in the
> current Directory which works, but when I draw it into an empty canvas
> with its own axes, it complains about a replaced histogram and then it is gone
> from my directory. Try this:
>
> root [0] TGraphErrors *ge=new TGraphErrors(3);
> root [1] ge->SetName("mygraph");
> root [2] gDirectory->Add(ge);
>
> /* fill in some points */
>
> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> Warning in <TH1::Build>: Replacing existing histogram: mygraph (Potential memory leak).
> root [10] .ls
> TROOT* Rint The ROOT of EVERYTHING
> root [11]
>
> so to me it seems that root is creating a temporary histogram with the
> same name as my graph, deletes it again, and there goes my pretty graph :-(.
>
> What's the lists oppinion? This is Root 4.00/08 on Gentoo linux.
>
> root [13] gROOT->GetVersion()
> (const char* 0x8478f5c)"4.00/08"
>
>
> Greetings from Erlangen,
> Chris
>
>
Received on Thu Mar 10 2005 - 14:15:34 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET