polluxx
1
Hi all.
I have encountered a strange problem with manually defined TGAxis.
This is what I’ve done:
- Plot histogram
- gStyle->SetLabelOffset(1000,“XY”) so that the default axes are not plotted
- Define my own axes, one for the bottom x, one for the top x axes
- Both axes use SetLabelFont(43) and SetTitleFont(43), followed by setting a fixed pixel size
- Plotting the bottom TGAxis with option “+” is ok.
- Plotting the top TGAxis with option “-” does not print the labels. It does print ticks and title though.
- If I define (and plot) the top TGAxis with option “+” is does print everything.
A sample file (minimal example) is attached.
Cheers.
Maurits
test.cxx (1.74 KB)
couet
2
I am looking at it.
note:
root [0] .L test.cxx
root [1] test()
Warning: wrong member access operator '->' test.cxx:18:
(int)0
couet
3
It is because of the font precision 3 (font 43) … if you set it to 42 then the labels appear again. I have not idea why yet. I am investigating.
couet
4
A possible “workaround”:
TGaxis *axis = new TGaxis(gPad->GetUxmin(),
gPad->GetUymax(),
gPad->GetUxmax(),
gPad->GetUymax()*1.0001,
gPad->GetUxmin()*c,
gPad->GetUxmax()*c,fmt,"-");
… still investigating
couet
5
This problem is now fixed in the SVN trunk. Thanks for reporting it.
Thanks for looking into it and the quick fix.