3D histos together

From: Dmitry Naumov <naumov_at_nusun.jinr.ru>
Date: Tue, 29 May 2007 23:05:45 +1000


Dear rooters,

sorry if this question was already raised (in fact I remember somewhere it was asked but do not find the answer). Is there a way to display more than one 3D histos in one pad (not superimposed)? I created a trivial example of what would like to have but not in 4 pads. To explain my need. I have 4 plates of silicon pad and I want to see a particle passing throw all of them showing energy realize in each pad. The z axis should be repeated several times: 0-Emax, 0-Emax, etc

Please find below a bad example of what I want. Thanks, Dmitry

void test_3d() {

    TH2F *h1 = new TH2F("h1","",10,-2,2,10,-2,2);
    TH2F *h2 = new TH2F("h2","",10,-2,2,10,-2,2);
    TH2F *h3 = new TH2F("h4","",10,-2,2,10,-2,2);
    TH2F *h4 = new TH2F("h3","",10,-2,2,10,-2,2);

// fill the histos

    h1->SetBinContent(3,4,10);
    h2->SetBinContent(4,5,10);
    h3->SetBinContent(5,6,10);
    h4->SetBinContent(6,7,10);

    TCanvas *c = new TCanvas("c","",400,1600);     c->Divide(1,4);
    c->cd(1);
    h1->Draw("lego");h1->SetStats(0);
    c->cd(2);
    h2->Draw("lego");h2->SetStats(0);
    c->cd(3);
    h3->Draw("lego");h3->SetStats(0);
    c->cd(4);
    h4->Draw("lego");h4->SetStats(0);

    c->cd();

// or like this

    TCanvas *c2 = new TCanvas("c2","",400,1600);
// fill the histos

    h1->Draw("lego");
    h2->Draw("lego same");
    h3->Draw("lego same");
    h4->Draw("lego same");

} Received on Tue May 29 2007 - 11:05:12 CEST

This archive was generated by hypermail 2.2.0 : Tue May 29 2007 - 11:50:01 CEST