void testRotatedTitle() { //create Canvas to place the histo in// TCanvas * MyC = new TCanvas("MyC","Canvas",-1,1,500,500); //Set up Canvas// gPad->SetRightMargin(0.17); gPad->SetLeftMargin(0.11); gPad->SetTopMargin(0.14); gPad->SetBottomMargin(0.14); //create a 2D Histo to test titles// TH2D * twod = new TH2D("twod","TEST 2D",200,-4,4,200,-4,4); //filling 2D Histo// Double_t px,py; for (Int_t i = 0; i < 500000; i++) { gRandom->Rannor(px,py); twod->Fill(px,py); } //setting up 2D Histo// twod->SetOption("colz"); twod->SetXTitle("x Title"); twod->SetYTitle("y Title"); twod->SetZTitle("z Title"); twod->GetXaxis()->CenterTitle(true); twod->GetYaxis()->CenterTitle(true); twod->GetZaxis()->CenterTitle(true); twod->SetTitleOffset(1.5,"Z"); twod->GetZaxis()->RotateTitle(); //makes pdf file missing a lot of things //draw and print Histo// twod->Draw(); gPad->Print("rotatedZTitleTest.pdf"); gPad->Print("rotatedZTitleTest.gif"); }