Hi Philip,
I see you did a layer on top of THistPainter (your Paint() method calls THistPainter::Paint at the end). Some idea you show here might be of general interest, and included in THistPainter. I am now revisiting completely the doc of THistPainter.cxx (the reference part managed with THtml). That implies a lot of changes in that file. I'll have a closer look at your proposal when I'll finish this work.
Cheers, Olivier
-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
On Behalf Of Philip Rodrigues
Sent: Tuesday, June 10, 2008 4:31 PM
To: roottalk_at_root.cern.ch
Subject: [ROOT] Custom histogram painter
Hi Roottalk,
Here's a custom histogram painter that alters some behaviours of
TH1::Draw, which might be useful to others. I've attached the code for
it, along with a README file and some examples of usage. Details of what
it can do are at the bottom of the message.
I find the changes convenient for my use cases, but they're by no means universally useful. Additionally, it runs quite a bit slower than the default, and probably doesn't do things the easiest way - just the first way I found that works.
Anyway, I'd be interested to hear if this is useful for anyone else, or of course any bugs or suggestions for improvements.
Regards,
Philip
By default, it puts the stats boxes below one another, and colours them the same colour as the histogram line. There are also some more options available to pass to TH1::Draw(). See testmypainter.C for several examples.
New options available for TH1::Draw():
"reaxis": the maximum of the y axis is rescaled to show the whole
range of all histograms.
"reaxisboth": the maximum *and* minimum of the y axis are rescaled to
show the whole range of all histograms. Hat tip to Chris Backhouse for
working out how to do this
"autocolor": the line colour is chosen from a list of "preferred"
colours, in order - useful if you're plotting interactively from a TTree.
"stat": Definitely draw the stats box for this histogram, overriding
gStyle->GetOptStat(). This is useful if you have a Divide()'d TCanvas, and you want stats on one pad, but not on the other.
"nostat": Definitely *don't* draw the stats box for this histogram,
overriding gStyle->GetOptStat()
Bugs
For some reason the stat/nostat options don't work when you interactively type the commands, but work fine from an interpreted macro. I have no idea why. Received on Tue Jun 10 2008 - 17:02:06 CEST
This archive was generated by hypermail 2.2.0 : Wed Jun 11 2008 - 17:50:01 CEST