Re: How do I plot only certain parts of a 2d histo?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Mar 12 1999 - 08:23:56 MET


David Hardtke wrote:
> 
> Hi,
> 
> Question # 1:
> 
> I have a 2 dimensional histogram (TH2F).  The dimensions are 1000 X 1000.
> I wish to plot bins 0-100 in x and 0-100 in y.  How do I go about doing
> that?
> 

Hi Dave,
You can use the mouse when you use the DrawPanel. However, this is not
very precise and drawing anyhow a 1000x1000 TH2 takes time. The solution
is
to set the range for the x and y axis. This is valid for 1-d,2-d 3-d
plots.
 h->GetXaxis()->SetRange(0,100);
 h->GetYaxis()->SetRange(0,100);
 h->Draw();

> Question # 2:
> 
> In nearly every ROOT session, I end up with:
> 
>  *** Break *** segmentation violation
> 
> This, of course, means I did something wrong.  Is there anyway to recover
> from this without starting over?
> 

I cannot do much with just this information. Could you run Root under
the debugger and send me the traceback when you get the segmentation
violation. To use the debugger (I assume you are on a Unix system), use
gdb
 gdb root.exe
 run
 ... your session
 gdb> info stack

Also some explanation of what you are doing what the crash appears would
be welcome.

Rene Brun



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