TGAxis tick size

Hi there,

I’ve created a TGAxis. Everything’s fine except I cannot change the tick size in any way!

TCanvas *canvas = new TCanvas ("canvas","canvas",0,0,1000,618) ; canvas->Range(-10.,0.,10.,100.) ; TGaxis *ax = new TGaxis(-5.,50.,2.,50, -9.,9., 510,"-+"); ax->SetLineColor(kRed) ; ax->SetLabelColor(kBlue) ; ax->SetLabelFont(112) ; ax->SetLabelOffset(0.1) ; ax->SetLabelSize(0.05) ; // ok ax->SetTickSize(0.) ; // ?!? ax->Draw() ;
I’m using Root 5.22.00.

Cheers,
Z

do:

TGaxis *ax = new TGaxis(-5.,50.,2.,50, -9.,9., 510,"-+S");

Thanks.
Indeed, this was clearly written in the doc.
Maybe should it appear as " chopt=‘S’ " to be consistent with the rest of the doc (I only looked for all the “chopt=” key string during my research).
Sorry for having missed that point.
Z

The whole TGAxis doc has to be revisited any way. This option “S” is not intuitive and comes from cernlib. It has to be much more clearly explained.

Would also be nice to make the API consistent with TAxis. TGAxis has SetTickSize() while TAxis has SetTickLength() …

Yes it would be nice. But there is some backward compatibility issues there .

[quote]But there is some backward compatibility issues there[/quote]Unless complementary functions are added to the corresponding headers

/// TGaxis.h void SetTickLength(Float_t ticklength) {SetTickSize(ticklength);} /// TAttAxis.h void SetTickSize(Float_t ticksize) {SetTickLength(ticksize);}(Diff files against master attached)
Cheers,
Z

PS: TAttAxis.h is not the same in head branch 5.34 and master (see TAttAxis.h__diff_hb534_vs_master)
TGaxis_h__gitdiff_master.txt (728 Bytes)
TAttAxis_h__gitdiff_master.txt (744 Bytes)
TAttAxis_h__diff_hb534_vs_master.txt (197 Bytes)

Yeah, I don’t see a problem with backward compatibility if you just add a new method.

Done.

Thx Olivier.
Could you please also patch the v5-34-00-patch branch?
Diff files attached.
Cheers,
Z
TGaxis_h__gitdiff_pb534.txt (728 Bytes)
TAttAxis_h__gitdiff_pb534.txt (1.36 KB)

Hi Mathieu,

I Did already … I did both…

Cheers,
Olivier

Indeed.
Sorry about that (bad update I suppose).
Thx again.
Z

I’d like to ask a question here.

Well, I can:
gStyle->SetFrameLineWidth(Width_t width = 1);
gPad->SetFrameLineWidth(Width_t width = 1);
but I’ve forgotten how I can change the width of the ticks’ lines (for a TAxis and TGaxis).

It looks like the is no specific attributes for that.
Looking how the Bold style does it it seems that le tick is:

gStyle->SetLineWidth(3);