Order of calling methods with TMultiGraph

I am drawing a TMultiGraph called total_graph in a ROOT script using this piece of code:

total_graph->Draw(“AL”);

total_graph->SetTitle(“Charge State Probability”);

total_graph->GetXaxis()->SetRangeUser(0, 200);
total_graph->GetYaxis()->SetRangeUser(0, 100);

total_graph->Draw(“AL”);

If I take out the first line, total_graph->Draw(“AL”), the interpreter complains about the GetXaxis() method. If I put the line, total_graph->SetTitle() method just before the last line, total_graph->Draw(“AL”), the title does not appear. Why does the order of these methods or whether the graph is drawn change whether they work or not?

I think that …

  1. the first “Draw” creates axes (so they do not exist prior to this call)
  2. there seems to exist a bug in ROOT related to “SetTitle” … a brutal fix …
    … if you “Draw” your TMultiGraph first, then use:
    total_graph->GetHistogram()->SetTitle(“Charge State Probability”);
    … before the first “Draw”, use:
    total_graph->SetTitle(“Charge State Probability”);

A strange solution, but it works! Thanks. Where should I report this bug?

The axis are created at drawing time.