Re: use of macros, log scale

Rene Brun (Rene.Brun@cern.ch)
Mon, 12 May 1997 13:12:06 +0200


Otto Schaile wrote:
>
> Dear roots,
>
> probably a beginners question:
>
> I have a (simplified) macro:
> ------------------------------------------------------------
> #include <iostream.h>
> int t1 (const char* b_node="etphp02")
> {
> gROOT->Reset();
> cv1 = new TCanvas("cv1","Backup history",100,100,600,600);
> // and so on
> }
> ---------------------------------------------------
> typing .x t1.C works
>
> I would like to call it from a control panel:
> -----------------------------------------------------
> {
> gROOT->Reset("a");
> bar = new TControlBar("vertical");
> bar->AddButton("t1", ".x t1.C()", "Blabla");
> bar->Show();
> gROOT->SaveContext();
> }
> --------------------------------------------------------------
> this o n l y works if I call directly from the command line before
> using it from the control bar. What do I have to put in addition?
>

There is an apparent restriction for macros called by a TControlBar.
Macros must be unnamed. Comment the line "int t1.. above.
The author of TControlBar (Nenad Buncic) is back next week.
He will look why named macros do not work.
Thanks for reporting this problem.

> ======================
>
> Unrelated to this: Is there a way to have log scales when drawing
> histograms?

To set log scales in a pad (canvas)

Root > padname->SetLogy(1); // Set vertical log scale
Root > padname->SetLogx(0); // reset x axis to linear scale

Rene Brun