Transparent axes for TH3 glbox option

I’ve been using the new ability to draw multiple TH3’s on top of each other with the glbox,same option, and it works really well. One problem: the fact that the xoz, xoy, yoz planes are not transparent makes it difficult to see behind each graph. I’ve looked all over the documentation, and I can’t see how to make those planes transparent so I can see below them. Does anyone know how to do this? Thanks!

Hi,

Can you please post an example macro showing how you stack the histograms. You can fill dummy histograms with FillRandom() … as done in tutorials/gl/glbox.C.

So far the GL histogram painters assumed a single histogram is plotted in a given view - we are working on integration of this development and other GL graphics (geometry, event-display) right now.

Still, Timur might be able to add an additional option allowing you to control how back-planes are drawn.

Best,
Matevz

Sure. Here is a macro:

[code]void gl_same()
{
// Overlap two 3d histograms

gStyle->SetCanvasPreferGL(kTRUE);
TCanvas *c = new TCanvas(“glc”,“TH3 Drawing”, 100, 10, 600, 500);
TH3F *hist1 = new TH3F(“hist1”, “hist1”, 10, -1, 1, 10, -1, 1, 10, -1, 1);
hist1->FillRandom(“gaus”,10);
hist1->SetFillColor(2);
hist1->Draw(“glbox”);

TH3F *hist2 = new TH3F(“hist2”, “hist2”, 10, -1, 1, 10, -1, 1, 10, -1, 1);
hist2->FillRandom(“gaus”,10);
hist2->SetFillColor(4);
hist2->Draw(“glbox,same”);
}[/code]

You can see in the attached pictures that the two histograms are drawn over each other (which is as desired). However the lack of transparency makes it impossible to properly view the obscured histogram.



Hi,

I can reproduce the problem … and I’m afraid we can’t do much on a short time scale. Our plan is to sort out the issues with GL in pad before the new year release.

I’ll ask Timur to have a look as he developed this functionality.

Best,
Matevz

Hi.

I don’t like the “same” option for OpenGL (details I do not want to discuss now). It “works” now only as a side effect (it was not done intentionally).

I think, the better solution will be to have “stack” class to pack 3d hists (like THStack for 1D). I’ll try to do this today, just to see what will happen.

Hi.

I don’t like the “same” option for OpenGL (details I do not want to discuss now). It “works” now only as a side effect (it was not done intentionally).

I think, the better solution will be to have a stack class to pack 3d hists (like THStack for 1D/2D). I’ll try to do this today, just to see what will happen.

Post was deleted by tpochep as wrong and non-informative …

Ok, I have changed my mind again and I think we can have such type of plot. I’ll send patch for svn trunk, if Rene will commit it - it will be in ROOT, if not - I’ll give you new files you need to have such a plot.

Macro is:

[code]void gl_same()
{
// Overlap two 3d histograms
gStyle->SetCanvasPreferGL(kTRUE);
TCanvas *c = new TCanvas(“glc”,“TH3 Drawing”, 100, 10, 600, 500);
TH3F *hist1 = new TH3F(“hist1”, “hist1”, 10, -1, 1, 10, -1, 1, 10, -1, 1);
hist1->FillRandom(“gaus”,100);
hist1->SetFillColor(kBlue);
TH3F *hist2 = new TH3F(“hist2”, “hist2”, 10, -1, 1, 10, -1, 1, 10, -1, 1);
hist2->FillRandom(“gaus”,100);
hist2->SetFillColor(kRed);
TH3F *hist3 = new TH3F(“hist3”, “hist3”, 10, -1, 1, 10, -1, 1, 10, -1, 1);
hist3->FillRandom(“landau”,100);
hist3->SetFillColor(kGreen);

TGLTH3Composition *comp = new TGLTH3Composition;
comp->AddTH3(hist1);
comp->AddTH3(hist2);
comp->AddTH3(hist3, TGLTH3Composition::kSphere);
comp->Draw();
}
[/code]





Timur,

Your code is now in the SVN trunk.

Rene

[quote]
Timur,

Your code is now in the SVN trunk.

Rene[/quote]

Thank you, Rene!