Re: [ROOT] A simple question about histogram attributes

From: Jiri Masik (Jiri.Masik@cern.ch)
Date: Sat May 20 2000 - 22:18:11 MEST


Claire Gwenlan <cg@hep.ucl.ac.uk> writes:

> Hi Everybody,
> 
> Sorry about another simple question (my only excuse is that I've only just
> started!). I want to plot a very simple set of histograms (in black and 
> white) all overlayed onto each other, so I basically want to choose lots
> of different line styles eg. dashed, dotted etc. I've looked at all the
> documentation and I thought that maybe  SetHistLineStyle will
> do the trick.
> 
[...]
> 
> h1->SetHistLineStyle(somenumber);
> 
> if my histogram is h1. The error that comes up is the following:
> 
> Error: Can't call TH1F::SetHistLineStyle() in current scope

Hi,

you can't use SetHistLineStyle with h1, as it is a method of TStyle. You
can change the current line style by gStyle->SetHistLineStyle(number)
I personally use h1->SetLineStyle(number) to achieve this. TH..
classes inherit from TAttStyle and this is one of its methods.

A usefull feature of Root is the Tab completion. Type h1->Set and
hit the tab key. You'll find immediately what's available.

	Jiri



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:25 MET