Re: setting TGraph plot options

From: Gero Flucke <flucke_at_mail.cern.ch>
Date: Fri, 10 Aug 2007 13:46:54 +0200 (CEST)

> You can change the default draw option when browsing graphs by adding
> the following line
> in your system.rootrc file (or .rootrc)
>
> TGraph.BrowseOption: alp
>

Hi Rene,
it would be really nice if TGraph would have similar behaviour as TH1 for things concerning drawing etc.
For hists I can use TH1::SetOption which then can (interactively) be overwritten by SetDrawOption, but I (and I guess Peter) miss this feature for TGraph.
Couldn't it be added? Perhaps using internally fHistogram->SetOption() (in case there are no 'overlaps' between graph and hist drawing options)?

        Gero

Peter Cogan wrote:
> Hi,
>
> the attached script makes a simple TGraph from a TF1 and saves it to a
> root file. If I open the resulting file in a TBrowser and
> double-click on the graph, I get a plot but no axes etc. I know that I
> could set my plot options from the command line with
> f1->Draw("AP*"), but is it possible to set draw options from my script
> so that someone else who recieves the file can just double
> click on the graph and see the options I want (eg axes, markers etc).
> I've trawled the online documentation and header files and
> can't find it.
>
> thanks for your help
> Peter
>
> rootver 5.16/00 Max OSX 10.4.10
>
> {
> gr = new TGraph(new TF1("f1", "sin(x)", 0, 1));
> TFile f("out.root", "recreate");
> gr->Write();
> f.Close();
> }

-- 
-----------------------------------------------------------------------
Gero Flucke                   office: DESY, Bldg. 67b, room 24
Inst. f. Experimentalphysik           fon: +49 (0)40 8998 4743
Universitaet Hamburg                  fax: +49 (0)40 8998 2959
Luruper Chaussee 149         at CERN: Bldg. 32 office 3-B20 
22761 Hamburg                         fon: +41 (0)22 76-77557
Germany

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Received on Fri Aug 10 2007 - 13:47:05 CEST

This archive was generated by hypermail 2.2.0 : Fri Aug 10 2007 - 17:50:02 CEST