[ROOT] TGaxis using a sine

From: Alberto Garcia Raboso (Alberto.Garcia.Raboso@cern.ch)
Date: Mon Apr 07 2003 - 21:05:04 MEST


Hi ROOTers,

I have been trying to draw an axis independently of any histogram with 
something like

{
TH2F *h2 = new TH2F("h","Axes",100,0,10,100,-2,2);
h2->Draw();
TF1 *f1 = new TF1("f1", "sin(x*3.141592/360)", 0, 180);
TGaxis *A1 = new TGaxis(1, 1, 9, 1, "f1", 304, "N=");
A1->Draw();
}

If I don't specify the N option, it gets painted, but the divisions are 
set for 50, 100 and 150. As I want divisions at 45, 90, 135 and 180 
degrees, I force it to make exactly 4 primary divisions using this N 
option. However, ROOT goes crazy (both interpreted and compiled) and 
gathers all the tick marks into a tiny region. Moreover, when clicking on 
it, all these tick marks disappear, except the one at 0.

I have tried this code both with versions 3.05.02 and 3.03.09 on linux and 
I get the same.

Am I making a mistake or is it a bug? Thanks in advance,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Alberto Garcia Raboso
Universidad Autónoma de Madrid (Spain)
E-Mail: Alberto.Garcia.Raboso@cern.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET