Re: grids and pavestext

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 04 1999 - 16:40:04 MEST


Hi Johann,

Johann Gutauer wrote:
> 
> Hi Rooters,
> 
> I have some (trivial?) problems:
> 
> 1.) I use a pad with 5 histograms and a grid. I want to lay the grid over
> these histograms. It's always between the first and second histogram. The same
> happens with the stats box in this pad. Is there something like '  c1->
> RedrawAxis();' for the grid and the stats box?

I have added an optional parameter to TPad::RedrawAxis(Option_t *option)
If option "grid" is specified, RedrawAxis will also redraw the grid on
top
of all histograms. By default the grid is drawn before drawing
histograms.

> 
> 2.) Is there a function to set the grid on defined positions or to change the
> distance between the grid lines? I found Get/SetGridLength in the
> TGaxis-Class. There is a nice example, too. If I can use SetGridLengh, I need
> a pointer to the axis on my pad/histogram. How can I get this pointer?

The grid is drawn where primary divisions are drawn. You can change the
number
of primary divisions via TAxis::SetNdivisions. (from the pop-up menu)

> 
> 3.) How can I set the color of the dots in an TH2F? I tried to change the
> color with     hops->SetLineColor(2);
>          hops->SetFillColor(2);
>          hops->SetLineWidth(3);
> like in TH1F but it won't work. What is wrong?

You can change the marker color, style, size via the TAttMarker
functions
also available via SetMarkerAttributes in the histogram context menu.

> 
> 4.) I tried to use TPavestext like in the 'canvas.C' example. I get no error
> and NO pave. I think the problem is with my NDC-coordinates or something with
> the update of the pad.
> The pad has the following dimensions:
> pad5 = new TPad("pad5", "pad 5",0.92,0.02,0.99,0.95);
> 
> The PavesText is:
>   TPavesText paves(0.035, 0.7, 0.9, 0.98);
>   paves.AddText("PavesText on pad 5");
>   paves.Draw();
> 

I cannot reproduce this last problem. Please send me a short example.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:40 MET