Discussion:
[ROOT] removing labels from TAxis (?)
(too old to reply)
Olivier Couet
2005-05-10 08:59:22 UTC
Permalink
THello,

This has been answer a few times in roottalk. Have a look to:

http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk02/2790
http://root.cern.ch/root/roottalk/roottalk03/1041.html
http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk97/0136

I hope it helps,

Cheers, Olivier
Dear All,
I would like to remove/not draw some of the labels of an axis...
I know what ::SetNdivisions(..) is capable of but I still need to
remove lets say last label... I have neighbouring histograms - see
attached example - and I would like to avoid label overlaping...
Thanks in advance...
m.
--
Org: CERN - European Laboratory for Particle Physics.
Mail: 1211 Geneve 23 - Switzerland Mailbox: J25910
E-Mail: ***@cern.ch Phone: +41 22 7676522
WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7670300
Mateusz Ploskon
2005-05-10 12:04:46 UTC
Permalink
Hi!

Thank You for Your reply Olivier, however that is not what I had in mind...
The figure I have send is produced by a generic function where the no.
of columns and rows iare naturally parameters... Therefore when drawing
a (given) number of the histograms with (not known) XY axis ranges it is
somewhat ridiculus to optimize/force the Ndivisions "by hand" for each
picture I want to produce... I would like to know if there's possibility
to avoid drawing the first or the last of the TAxis labels (which is
most of the times the case...) - e.g. I would like that ROOT makes the
label optimization around given N-divisions, but does not draw the last
label (which most often goes out of TPad boundaries when
TPad::SetRightMargin(0) for X axis or TPad::SetTopMargin(0) for Y axis...

Thanks much!
mateusz
Olivier Couet
2005-05-10 13:04:43 UTC
Permalink
Hi Mateusz,

May be you can try to enlarge the X axis range in a such way that the
first and/or last values do not correspond to an exact value. Doing that
the optimizer will leave a "space" at the beginning and the end of the
axis.

Cheers, Olivier
Post by Mateusz Ploskon
Hi!
Thank You for Your reply Olivier, however that is not what I had in mind...
The figure I have send is produced by a generic function where the no. of
columns and rows iare naturally parameters... Therefore when drawing a (given)
number of the histograms with (not known) XY axis ranges it is somewhat
ridiculus to optimize/force the Ndivisions "by hand" for each picture I want
to produce... I would like to know if there's possibility to avoid drawing the
first or the last of the TAxis labels (which is most of the times the case...)
- e.g. I would like that ROOT makes the label optimization around given
N-divisions, but does not draw the last label (which most often goes out of
TPad boundaries when TPad::SetRightMargin(0) for X axis or
TPad::SetTopMargin(0) for Y axis...
Thanks much!
mateusz
--
Org: CERN - European Laboratory for Particle Physics.
Mail: 1211 Geneve 23 - Switzerland Mailbox: J25910
E-Mail: ***@cern.ch Phone: +41 22 7676522
WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7670300
Continue reading on narkive:
Loading...