Re: Ticks on all axes? etc.

Rene Brun (Rene.Brun@cern.ch)
Sat, 29 Aug 1998 10:48:24 +0200


Stephen Bailey wrote:
>
> Hi. Here are a collection of small and (hopefully) simple
> things that I haven't been able to figure out how to do
> in ROOT. Help would be appreciated. Thanks in advance.
>
> Stephen
>
> * How do I get ticks on all 4 axes for a plot?

Use TPad::SetTicks, etc.
For the current pad, do gPad->SetTicks();
You can also enable.disable this option from the pad/canvas pop-up.
This option could be added to TStyle.

> * How can I make that the default? (It doesn't appear to be an
> option in TStyle.)
> * How do I set the default font for the label/title in the upper
> left corner of a plot?

No way currently to set a default font (always 62).
You can change the attributes of the "title" object in the pad
with a sequence like:
TPaveText *title = (TPaveText*)gPad->GetPrimitive("title");
title->SetTextFont(72);
This is clearly undesirable. I will add an option in TStyle.

> * How do I set the default font for the stats box?

same as for title
TPaveText *stats = (TPaveText*)gPad->GetPrimitive("stats");
stats->SetTextColor(kRed);

> * Is there a list of which font codes correspond to which fonts?
Look at class TAttText (top of implementation file and constructor).
I will add a picture of the fonts in next release.

> * How about for colors?

See list in class TColor. You can also view the color table
by selecting the "View" menu in the canvas.

> * How do I export a PS file as portrait rather than landscape?

See URL http://root.cern.ch/root/HowtoPS.html
By default, when you print a canvas, Root selects the orientation
corresponding to the aspect ratio of the canvas.
You can something like:
TPostScript *ps = new TPostScript("file.ps",111);
h->Draw();
ps->Close();

> * Is it possible to automatically cd from one pad to the next
> when making a series of plots, rather than having to explicitly
> c1_1->cd(), etc. in between? e.g. how it works with PAW's
> 'zone 2 2' followed by plotting 4 histograms.
>

No, the intention was to avoid all the nasty side effects that
this facility had in PAW. This could be added in Root, but with
even more side effects. Do:
Root > c1->cd(1); h1->Draw();
Root > c1->cd(2); h2->Draw();

Rene Brun