Re: [ROOT] another two stupid questions.

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Feb 19 2002 - 19:03:22 MET


Hi Jacek,

Jacek M. Holeczek wrote:
> 
> Hi,
> Thanks for your help,
> 
> > In your example, you add the graph to the current directory.
> > (...)
> >   - to not add the graph to gDirectory, but to any other collection.
> 
> I.E. you suggest to replace :
>         gDirectory->Append(MyGraph)
> with :
>         gROOT->GetListOfSpecials()->Add(MyGraph)
> And everything should be o.k.
> Right ?
> 

Yes. Note that you can create your own list, eg
  TList *mylist = new TList();
  mylist->Add(MyGraph);

> > (... Question Two ...)
> O.K. As I understand there is no "easy" solution. The only solution is to
> create a "special" graph with all points in a "special" order. Fine.
> 

One could imagine a special Draw function, eg
   TGraph::DrawArea(TGraph *agraph);
drawing the area between this grapg and agraph


> Another stupid question ...
> I have :
>         TGraph *g1, *g2;
>         TMultiGraph *mg;
>         (...)
>         g1->SetDrawOption("F"); // draw with fill
>         g2->SetDrawOption("L"); // draw the line only (on top of g1)
>         mg->Add(g1); mg->Add(g2);
>         (...)
> When I do "mg->Draw()" the "F" option of g1 is forgotten.
> Any way to "preserve" it ?

This is not possible in the pro version, but implemented in the development
version in CVS. The new version in CVS, also by default, will not draw the
horizonthal line
at y=0.
See documentation of the new features at:
   http://root.cern.ch/root/htmldoc/TMultiGraph.html

The changes in CVS are the following:

Add an optional argument to TMultiGraph::Draw.
This optional argument can be used to specify the draw option for this graph.
If a draw option is not specified, the option specified in TMultiGraph::Draw
will be used instead.

Also, always use the option "0" when painting the frame histogram.
The option "0" suppresses the drawing of the horizonthal line at y=0.

Rene Brun

> 
> Thanks,
> Jacek.



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