// Test demonstrating problem with TStyle: TCanvas *canvas = new TCanvas("canvas", "Test of TStyle", 800,600); TH1F *h1 = new TH1F("h1", "Test Histogram", 100, -10, 10); TStyle *mystyle = new TStyle(); void test1() { h1->FillRandom("gaus", 200); h1->GetXaxis()->SetTitle("X title"); h1->GetYaxis()->SetTitle("Y title"); // style manipulation: mystyle->Copy(*gStyle); // creating a copy of default style mystyle->SetFillColor(10); mystyle->SetTitleFillColor(5); mystyle->SetStatColor(10); mystyle->SetLabelSize(0.07, "XY"); mystyle->SetLabelOffset(0.01,"XY"); mystyle->SetTitleSize(0.08, "XY"); mystyle->SetPadLeftMargin(0.2); mystyle->SetPadBottomMargin(0.2); mystyle->SetHistFillColor(2); mystyle->SetHistLineWidth(3); mystyle->cd(); gROOT->ForceStyle(); gROOT->UseCurrentStyle(); h1->Draw(); canvas->Update(); }