Re: [ROOT] labels for TGaxis

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Mar 04 2002 - 04:42:14 MET


Hi Peter,

This is unfortunately not currently possible with the option using a
function to map the axis scale.

Rene Brun

On Sat, 2 Mar 2002, Peter Jacobs wrote:

> Dear Roottalk,
> 
> I would like to generate a TGaxis and specify which numerical labels
> appear on the axis. Specifically, please consider the following macro:
> 
> {
> TCanvas c1("c1","axis",400,600);
> TF1 *yfunc = new TF1("yfunc", "log10(x)", 0.08, 3.5);
> 
> int ndiv = 510;
> TGaxis *Yaxis = new TGaxis( .5, .2, .5, .6, "yfunc", ndiv);
> Yaxis->Draw("G");
> }
> 
> I only want the numerical labels indicating 0.1, 1.0 and 3.0 to appear.
> My understanding is that this can be controlled by "ndiv", but I have
> not succeeded in finding the correct value. 510 is the default and you
> can see that it generates labels next to 0.5, 1.0,...,3.0, which overlap
> if the font is too big.
> 
> I have however succeeding finding values for ndiv that generate a
> segmentation fault (??).
> 
> Thanks in advance,
> 
> Peter Jacobs
> 



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