void mycan() { //=========Macro generated from canvas: myCanvas/myCanvas //========= (Mon Jun 25 17:13:21 2007) by ROOT version5.15/08 TCanvas *myCanvas = new TCanvas("myCanvas", "myCanvas",5,44,550,550); gStyle->SetOptFit(1); gStyle->SetOptStat(0); myCanvas->Range(-0.8247861,-0.8247861,0.8247861,0.8247861); // TView *view = new TView(1); // view->SetRange(-0.00107,-0.00085,0,0.00107,0.00085,9.45); myCanvas->SetFillColor(10); myCanvas->SetBorderMode(0); myCanvas->SetBorderSize(0); myCanvas->SetTickx(); myCanvas->SetTicky(); myCanvas->SetLeftMargin(0.15); myCanvas->SetRightMargin(0.15); myCanvas->SetTopMargin(0.15); myCanvas->SetBottomMargin(0.15); myCanvas->SetFrameFillColor(0); myCanvas->SetFrameBorderMode(0); TH1 *h_myHisto = new TH2D("h_myHisto","",61,-0.00107,0.00107,61,-0.00085,0.00085); int binx(1), biny(1); for(int i = -30; i <=30; i++){ biny=1; for(int j = -30; j <=30; j++){ double x = double(i)/10.; double y = double(j)/10.; h_myHisto->SetBinContent(binx,biny,(x*x + y*y )); biny++; } binx++; } //Set up the colours I wish to use: const Int_t ncol = 9; Int_t colors[ncol]; TColor *col; Double_t dg=1.0/(1.0*(Double_t)ncol); Double_t grey=0; for (Int_t i=0; iGetColor(colors[i])) { gROOT->GetColor(colors[i])->SetRGB(grey, grey, grey); } else { TColor *c = new TColor(colors[i], grey, grey, grey); } grey = grey+dg; } h_myHisto->SetContour(ncol); gStyle->SetPalette(ncol,colors); gStyle->SetOptStat(0); h_myHisto->SetMaximum(9); // h_myHisto->SetContour(9); // h_myHisto->SetContourLevel(0,0); // h_myHisto->SetContourLevel(1,1); // h_myHisto->SetContourLevel(2,2); // h_myHisto->SetContourLevel(3,3); // h_myHisto->SetContourLevel(4,4); // h_myHisto->SetContourLevel(5,5); // h_myHisto->SetContourLevel(6,6); // h_myHisto->SetContourLevel(7,7); // h_myHisto->SetContourLevel(8,8); TPaletteAxis *palette = new TPaletteAxis(0.709316,-0.5773503,0.7851964,0.5773503,h_myHisto); palette->SetLabelColor(1); palette->SetLabelFont(62); palette->SetLabelOffset(0.005); palette->SetLabelSize(0.035); palette->SetTitleOffset(1); palette->SetTitleSize(0.035); palette->SetFillColor(109); palette->SetFillStyle(1001); h_myHisto->GetListOfFunctions()->Add(palette,"br"); h_myHisto->GetXaxis()->SetTitle("X axis \\sigma_{X}"); h_myHisto->GetXaxis()->SetNdivisions(-6); h_myHisto->GetXaxis()->SetLabelOffset(0.015); h_myHisto->GetXaxis()->SetLabelSize(0.035); h_myHisto->GetXaxis()->SetTitleSize(0.035); h_myHisto->GetXaxis()->SetTitleOffset(1.2); h_myHisto->GetYaxis()->SetTitle("Y axis \\sigma_{Y}"); h_myHisto->GetYaxis()->SetNdivisions(-6); h_myHisto->GetYaxis()->SetLabelOffset(0.015); h_myHisto->GetYaxis()->SetLabelSize(0.035); h_myHisto->GetYaxis()->SetTitleSize(0.035); h_myHisto->GetYaxis()->SetTitleOffset(2.4); h_myHisto->GetZaxis()->SetLabelSize(0.035); h_myHisto->GetZaxis()->SetTitleSize(0.035); h_myHisto->Draw("cont4z"); myCanvas->Modified(); myCanvas->cd(); myCanvas->SetSelected(myCanvas); }