Zesp
March 8, 2009, 1:27pm
1
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
couet
March 9, 2009, 12:44pm
2
do:
TGaxis *ax = new TGaxis(-5.,50.,2.,50, -9.,9., 510,"-+S");
Zesp
March 9, 2009, 5:25pm
3
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
couet
March 9, 2009, 5:34pm
4
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() …
couet
July 9, 2014, 8:37am
6
Yes it would be nice. But there is some backward compatibility issues there .
Zesp
July 16, 2014, 8:19am
7
[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.
Zesp
July 17, 2014, 1:42pm
10
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)
couet
July 17, 2014, 2:05pm
11
Hi Mathieu,
I Did already … I did both…
Cheers,
Olivier
Zesp
July 17, 2014, 4:26pm
12
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).
couet
July 28, 2014, 12:57pm
14
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);