{ ///////////////////////////////////////////////////////////// //Just some dummy preparations (no problems here): TH2D* h = new TH2D("h", "Example Histo", 20,-1,1,20,-1,1); h->FillRandom("gaus", 1E6); h->Draw("COLZ"); gSystem->ProcessEvents(); //It took me a whole day to figure out this is necessary for the palette to come into existence... TPaletteAxis* zaxis = (TPaletteAxis*)h->GetListOfFunctions()->FindObject("palette")->Clone("MyPalette"); delete c1; delete h; ///////////////////////////////////////////////////////////// //Please read from here on: //I want to draw the TPaletteAxis zaxis alone in a new TCanvas: TCanvas* pc = new TCanvas("pc", "PaletteCanvas", 50,500); //Try resizing palette in advance: zaxis->SetX1(0); zaxis->SetY1(0); zaxis->SetX2(0.5); zaxis->SetY2(1); //Output current coordinates: cout << endl << "================================================" << endl; cout << "Coordinates BEFORE drawing:" << endl; cout << "X1 = " << zaxis->GetX1() << " | Y1 = " << zaxis->GetY1() << " | X2 = " << zaxis->GetX2() << " | Y2 = " << zaxis->GetY2() << endl; //Now draw it: zaxis->Draw(); gSystem->ProcessEvents(); cout << "Coordinates AFTER drawing:" << endl; cout << "X1 = " << zaxis->GetX1() << " | Y1 = " << zaxis->GetY1() << " | X2 = " << zaxis->GetX2() << " | Y2 = " << zaxis->GetY2() << endl; //Try forcing to wished-for coordinates: zaxis->SetX1(0); zaxis->SetY1(0); zaxis->SetX2(0.5); zaxis->SetY2(1); pc->ForceUpdate(); gSystem->ProcessEvents(); cout << "Coordinates after resizing:" << endl; cout << "X1 = " << zaxis->GetX1() << " | Y1 = " << zaxis->GetY1() << " | X2 = " << zaxis->GetX2() << " | Y2 = " << zaxis->GetY2() << endl; cout << "... This is definitely NOT where I see the palette :-(" << endl; }