Creating a Stacked 2D Histogram and Displaying Transparency in 3D

Hi All,

I’ve made quite a few attempts to make the following occur with ROOT. I have two 2D (TH2*) histograms that are stacked via a THStack. I can then plot this stack similar to what is seen in the lower right corner of this image:

.

Is there anyway to make one of the 2D histograms in the stack more transparent so that I can see the contents underneath? In this case, that would be making the red boxes have some lesser opacity.

Thanks!
John

This one almost work… but some work would be needed to make sure the side of the lego is also transparent

void hstacktrans()
{

   THStack *a = new THStack("a","Stacked 2D histograms");
   TF2 *f1 = new TF2("f1","xygaus + xygaus(5) + xylandau(10)",-4,4,-4,4);
   Double_t params[] = {130,-1.4,1.8,1.5,1, 150,2,0.5,-2,0.5,3600,-2,0.7,-3,0.3};
   f1->SetParameters(params);
   TH2F *h2sta = new TH2F("h2sta","h2sta",20,-4,4,20,-4,4);
   h2sta->SetFillColor(38);
   h2sta->FillRandom("f1",4000);
   TF2 *f2 = new TF2("f2","xygaus + xygaus(5)",-4,4,-4,4);
   Double_t params2[] = {100,-1.4,1.9,1.1,2, 80,2,0.7,-2,0.5};
   f2->SetParameters(params2);
   TH2F *h2stb = new TH2F("h2stb","h2stb",20,-4,4,20,-4,4);
   h2stb->SetFillColorAlpha(46,0.1);
   h2stb->FillRandom("f2",3000);
   a->Add(h2sta);
   a->Add(h2stb);
   a->Draw( "lego3");
}