Re: [ROOT] question on TH1::SetOption

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Jul 18 2002 - 08:40:47 MEST


Option "same" is a special option. It will have no effect in the way you
use it.
You can do:

hist1->Draw();
hist2->Draw("same");

However, this does not make much sense, since you will get the same
histogram twice. The above being equivalent to
hist1->Draw();
gPadd->Modified();
gPad->Update();

In case you want to draw two different copies of the same histogram
(during filling for example), you should do
hist1->DrawCopy(); 
//then modify hist1
hist1->Draw("same")

Rene Brun


On Wed, 17 Jul 2002, Rajat Bhatnagar wrote:

> Hi,
> 
> I've been trying to run the following code
> 
> hist1->Draw();
> hist2->SetOption("same");
> hist2->Draw();
> 
> The result seems to be hist2 drawn alone with any axis.  I'd expected it
> to look like hist2->Draw("same");.  Am I doing something wrong?
> 
> I am running ROOT v3.03/06.
> 
> Thanks,
> Raj Bhatnagar
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:00 MET