Re: Axis labels

Fons Rademakers (Fons.Rademakers@cern.ch)
Mon, 17 Feb 1997 14:43:07 +0100


Hi Mats,

there are basically two ways to set axis labels. Interactively and
via the command line (or macro for that matter). To set an axis title
interactively, go with the mouse to an axis object (cursor turns into
a little pointing finger when pointing to a number of the axis) and
press
the right mouse button. Select SetTile in the popup menu and fill in the
desired title in the dialog box. To do it from the command line depends
on the type of object (we will streamline this), for example assume hpx
is a histogram:

hpx->SetXTitle("title of x axis")
hpx->SetYTitle("title of y axis")

For a graph, gr, it is (this is ugly and we will change it):

gr->GetHistogram()->SetXTitle("x axis")

We plan to change both cases to:

hpx->GetXAxis()->SetTitle("aaaaaa")
gr->GetYAxis()->SetTitle("vvvvv")

Cheers, Fons.

PS1: the address of the roottalk list is: roottalk@root.cern.ch

PS2: please, configure the mailer on your Linux box correctly to provide
a valid return address

Beispielbenutzer S.u.S.E. Linux 4.4 <mats@quark.fzk.de.cern.ch> wrote:
>
> Hi there,
>
> I am a newbie in root. scanning the tutorials I found (off course) several
> graphs, but all had a title somewhere in the upper left (like y vs. x). How
> do I do an axis labeling, so for example under the x-axis is written "time"
> and on the y-axis is written "amplitude" (rotated by 90 degrees).
>
> thanxs,
> Mats
>
> P.S: I am not sure whether I send my question to the right address (it is the
> first time I subscribed a mailing list). So if I wrote to the wrong one, I
> am happy if someone can tell me the right one.

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7822601