TH1D* hist = new TH1D("histogram", "Histogram Title", 100, 0, 10); hist->SetXTitle("Variable X");
TH1D* hist = (TH1D*) file->Get("histogram"); hist->SetXTitle("New X-axis Title");This code loads an existing TH1D object named "histogram" from a ROOT file and changes its X-axis title to "New X-axis Title". Package/Library: ROOT (CERN)