Problem with SetTitle for x-axis

(I hope this is the right place to post this; my apologies if it is not.)

I’m making a TGraphErrors plot, and while I can set the y-axis title, the x-axis title doesn’t show up in the final plot. Here’s the code in question:

  TCanvas* c4 = new TCanvas("c4","Binned QtimesY",1200, 900);
  gStyle->SetTitleColor(10);
  gStyle->SetFillColor(10);
  gROOT->SetStyle("Plain");
  gStyle->SetOptStat(0);

  TH1F *hr= c4->DrawFrame(binMin,mincontentglobal * 1.2,binMax,maxcontentglobal * 1.5);
  hr->SetTitle("");
  c4->Update();
  hr->GetXaxis()->SetTitle(xAxisTitle->Data());
  c4->Update();
  hr->GetYaxis()->SetTitle(yAxisTitle->Data());
  c4->Update();

(binMin, mincontentglobal, binMax, and maxcontentglobal are previously defined doubles; xAxisTitle and yAxisTitle are previously defined TString objects)

I’ve looked at the documentation and examples for TH1F objects, but I haven’t been able to make my code work. Any suggestions?

Thanks.

I just tried. It is working for me. Can you send a running macro reproducing your problem ?
The script you sent cannot be run “as is”.