TPostScript / SetLogz

I am fairly new at ROOT and I have run into a problem I cannot solve by reading the manual.

I am using TPostScript to create graphs. I would like one graph, which is a 2D graph to have its Z-axis logarithmic and Palette set to one like I would do with gStyle->SetPalette(1) if i was only do one graph at a time.

Here is a sample of what I am trying to do, I have inputted comments where I would like assistance.

Thank You

[code]#include
#include
#include
#include
#include
void PostScript(){

TChain *chain = new TChain(“NTuple_gammaP_PipPim”);

chain->Add(“Ntuple_gammaP_PipPim_TOF_no_other.root”);

Int_t nEvent = chain->GetEntries();

std::cout <<"Number of events " <<nEvent <<std::endl;

TCanvas *c1 = new TCanvas(“c1”,“Files”, 800, 650);
c1->Divide(2,1);
TPostScript *ps = new TPostScript(“file.ps”,112);
ps->Range(26,26);

// picture 1
ps->NewPage();
c1->cd(1);
c1->cd(1)->SetLogz();
c1->cd(1)->SetPalette(1); //<<<this doesnt work

//=========I would like this pad to have Palette(1) and Z axis on log scale==========
chain->Draw(“dP_TOF:P_Ptot >> h11(1000,0.0,2.5,1000,-10.0,10.0)”,"",“colz”);

c1->cd(2);

//======I would like this pad to have normal palette and linear scale on Z axis========
chain->Draw(“MP_cal:P_Ptot >> h13(1000,0.0,2.5,1000,0.0,3.0)”,"",“colz”);
c1->Update();
ps->Close();
// invoke Postscript viewer
gSystem->Exec(“gs file.ps”);
}

[/code]

I suggest to change your code as shown below

Rene

[code]#include
#include
#include
#include
#include
void PostScript(){

TChain *chain = new TChain(“NTuple_gammaP_PipPim”);

chain->Add(“Ntuple_gammaP_PipPim_TOF_no_other.root”);

Int_t nEvent = chain->GetEntries();

std::cout <<"Number of events " <<nEvent <<std::endl;

TCanvas *c1 = new TCanvas(“c1”,“Files”, 800, 800);
c1->Divide(2,1);

// picture 1
c1->cd(1);
gPad->SetLogz();
TExec *e1 = new TExec(“e1”,“gStyle->SetPalette(1);”);
gPad->DrawFrame(0,-10,2.5,10);
e1->Draw();
chain->Draw(“dP_TOF:P_Ptot >> h11(1000,0.0,2.5,1000,-10.0,10.0)”,"",“colz same”);

c1->cd(2);

TExec *e2 = new TExec(“e2”,“gStyle->SetPalette(0)”);
gPad->DrawFrame(0,-10,2.5,10);
e2->Draw();
chain->Draw(“MP_cal:P_Ptot >> h13(1000,0.0,2.5,1000,0.0,3.0)”,"",“colz same”);
c1->Print(“file.ps”);
// invoke Postscript viewer
gSystem->Exec(“gs file.ps”);
}
[/code]

Thank You Renee