Re: use of macros, log scale

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon May 12 1997 - 13:12:06 MEST


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



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:18 MET