[quote]The overlap is not implemented in case of lego.[/quote]It is still not the case apparently (see the attached pics and code).
How about implementing it (TH2Stack)?
Something more useful might be to superimpose half transparent histograms (with zero bins not taken into account as it is done for hstack1 and hstack2 in the attached macro, see /viewtopic.php?t=4598).
Isn’t it already implemented somehow for GLplots or EVE?
TIA,
Z
PS : Depending on the output format (gif or png), the image’s not the same! ztest.cpp (3.76 KB)
You are right, it is still not done. Did I say I will implement it ? it does not seems so. Not easy, not enough manpower and always something else to do. If you volunteer to do it you are welcome.
A new class will not be of any help.
I’ll have an other look… but it can not promise anything soon.
Thanks for planning to give it a try Olivier
If I find some time some day, I’ll let you know!
As for the image thing, using TCanvas *canvas = new TCanvas ("canvas") ; instead of
TCanvas *canvas = new TCanvas ("canvas","canvas",0,0,gClient->GetDisplayWidth(),gClient->GetDisplayHeight()) ; helps a bit.
Still… (see the bottom right corner plot)
either on CentOS_5.5/ROOT_5.16.00b or on WinXP_Cygwin/ROOT_5.{27.02,26.00b,5.24.00}_bin.
[quote]PS: How about the GL/EVE way?
What do Timur and Matevz reckon?[/quote]
Transparency is needed for the kind of representation your are asking.
THStack cannot be be represent using GL right now. I’ll will point this post to Timur.
[quote]Do gPad->Update() before saving the canvas.[/quote] Thx!
The issue remains as soon as the canvas width exceeds the screen width (which is the case whilst calling gClient->GetDisplayHeight())
[quote]THStack cannot be be represent using GL right now. I’ll will point this post to Timur.[/quote]What about (plain) TH2?
(like in root.cern.ch/drupal/sites/defaul … ego-3d.png with transparency and a nostack-like feature)
[quote=“Zesp”]Yep but they are plotted in a EVE window (with an intriguing GLViewer tab…)
Maybe something close enough already exists…
Cheers,
Z[/quote]
I think, I can implement stack for TH2 hists in GL. I remember I was going to do this, but something stupid and very annoying stopped me - may be was the fact that histogramms in a THStack can have different and even non-overlapping ranges, may be something else and I cancelled thglstack.
Olivier, in your macro, I don’t see the point of using gStyle->SetCanvasPreferGL(true).
Attached’s the only non-stack way I see to superimpose TH2s for the time being.
(Note that adding one white empty histogram to the THStack is enough to visually remove non-zero bins, see /viewtopic.php?t=4598)
Timur, could you please implement the “same binning case” as a start (with no-stack & transparency features)
[quote=“Zesp”]Timur, did you have time to give it a try so far?
Cheers,
Z[/quote]
Hi.
You are lucky, I tried it today. I had a look into THStack::Paint and remembered what was the real problem - it’s not an axis range. THStack draws histogramms using TH1(2)::Paint(“samexxxx”) option. So, each histogramm painter does not know the context. This is ok for 1D hist, this is already bad for 2D hist. See my pictures, with and without transparency.
I’ve solved similar problem for TH3, but this solution was criticized severely by Rene as “ad-hoc” and non-general. In principle, we can change THStack::Paint for the case the number of dimensions is bigger than 1 and pass the list of histogramms into painter directly (with gl/non-gl implementations for stack).