Problem with 2D plot

Hi @Wile_E_Coyote, sorry because I didn’t reply earlier to your last reply in this topic Problem with 2D plot values (now it’s close).
Anyway I added

gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn

right after right after “DrawCopy”, I wrote in this way

TH2F *henecdsubstringcutrelTHF = new TH2F("henecdsubstringcutrelTHF", "", 10000, 0., 0.,10000., 0.,0.);
			TString what = TString::Format("Calo_EnDep[%d] : Calo_EnDep[%d]>> henecdsubstringcutrelTHF", d, c);
			t->Draw(what, cut && cut3sub && cut4sub && !cut5sub && !cut5sub2);
			gPad->Modified();
			gPad->Update(); // make sure it's really (re)drawn
			henecdsubstringcutrelTHF->SetTitle(cdhenecdsubstringcutrelTHFname);
			henecdsubstringcutrelTHF->GetXaxis()->SetTitle(cdeneXnameabenecvsd); 
			henecdsubstringcutrelTHF->GetYaxis()->SetTitle(cdeneYnameabenecvsd);
			henecdsubstringcutrelTHF->GetYaxis()->SetTitleSize(c2_YTitleSize);
			henecdsubstringcutrelTHF->GetYaxis()->SetTitleFont(c2_YTitleFont);
			henecdsubstringcutrelTHF->GetYaxis()->SetTitleOffset(c2_YTitleOffset);
			henecdsubstringcutrelTHF->GetYaxis()->SetLabelFont(c2_YLabelFont); 
			henecdsubstringcutrelTHF->GetYaxis()->SetLabelSize(c2_YLabelSize);
			henecdsubstringcutrelTHF->GetXaxis()->SetTitleSize(c2_XTitleSize);
			henecdsubstringcutrelTHF->GetXaxis()->SetTitleFont(c2_XTitleFont);
			henecdsubstringcutrelTHF->GetXaxis()->SetTitleOffset(c2_XTitleOffset);
			henecdsubstringcutrelTHF->GetXaxis()->SetLabelFont(c2_XLabelFont); 
			henecdsubstringcutrelTHF->GetXaxis()->SetLabelSize(c2_XLabelSize);
			henecdsubstringcutrelTHF->Draw("COLZ"); 
			henecdsubstringcutrelTHF->SetName(heneabname);
   			gPad->Modified();
			gPad->Update(); // make sure it's really (re)drawn
			TH1 *hh = henecdsubstringcutrelTHF->DrawCopy("colz"); // creates all axes
			gPad->Modified();
			gPad->Update(); // make sure it's really (re)drawn
			TPaletteAxis * palette = (TPaletteAxis *) hh->GetListOfFunctions()->FindObject("palette");
			palette->SetX2NDC(0.93);
			gPad->Modified();
			gPad->Update(); // make sure it's really (re)drawn
			c25->Modified();
			c25->Update();
   			TLegend* leghenecdsubstringcutrelTHF = new TLegend(0.65, 0.7, .75, .75);
   			leghenecdsubstringcutrelTHF->SetHeader("Legend");
			leghenecdsubstringcutrelTHF->SetNColumns(1);
			leghenecdsubstringcutrelTHF->AddEntry(leghenecdsubstringcutrelTHF, "Data", "l");
			leghenecdsubstringcutrelTHF->Draw(); 
			gPad->Update();
			TPaveStats *statsghenecdsubstringcutrelTHF = (TPaveStats*)henecdsubstring

but palette didn’t move…


ROOT Version: 5.34/38
Platform: Windows
Compiler: Not Provided


A post was merged into an existing topic: Problem with 2D plot values