Re: options drawing multigraphs

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Tue, 12 Apr 2005 15:51:41 +0200 (MEST)


Hi Mateusz,

before calling object.GetDrawOption, you must have called object.Draw. See doc at
http://root.cern.ch/root/htmldoc/TObject.html#TObject:GetDrawOption http://root.cern.ch/root/htmldoc/TObject.html#TObject:SetDrawOption

For your point about finding the options in a list, see an example at http://root.cern.ch/root/htmldoc/src/TObject.cxx.html#TObject:GetDrawOption

Rene Brun

On
Tue, 12 Apr 2005, Mateusz Ploskon wrote:

> Please consider following:
>
> root [7] TH1F *alax = new TH1F("alax","alax", 12,10,111);
> root [8] alax->SetOption("la")
> root [9] alax->GetOption()
> (const Option_t* 0x90d16ec)"la"
> root [10] alax->SetDrawOption("la")
> root [11] alax->GetDrawOption()
> (const Option_t* 0xd0b416)""
>
> Actually, my question is how can I get the option of a TGraph which is
> owned by a TMultiGraph...
> What's wrong with the following code(?) for example:
>
> TMultiGraph *tmgr = new ....
> tmgr->Add(..., "L");
> ...
> TList *hlist = (TList*)tmgr->GetListOfGraphs();
> TIter *hiter = new TIter(hlist);
>
> TGraph *hist = 0;
> hiter->Reset();
> while ((hist = (TGraph*)hiter->Next()) != NULL)
> {
> cout << "Draw option?" << hist->GetTitle() << " " << hist->GetDrawOption() << endl;
> // nothing... :(
> }
>
> On a side I have the impression that this option'ing stuff is a bit messy...
>
> my best!
> m.
>
> PS I've read the sources of TObject etc...
>
>
Received on Tue Apr 12 2005 - 15:51:46 MEST

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