# Order of calling methods with TMultiGraph

**URL:** <https://root-forum.cern.ch/t/order-of-calling-methods-with-tmultigraph/14724>\
**Category:** ROOT\
**Created:** [August 7, 2012, 7:26pm UTC](https://root-forum.cern.ch/t/order-of-calling-methods-with-tmultigraph/14724 "2012-08-07T19:26:28Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![burnt](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/c4cdca/32.png) [@burnt](https://root-forum.cern.ch/u/burnt)\
**Post date:** [August 7, 2012, 7:26pm UTC](https://root-forum.cern.ch/t/order-of-calling-methods-with-tmultigraph/14724/1 "2012-08-07T19:26:28Z")

</div>

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?

---

_[View the full topic](https://root-forum.cern.ch/t/order-of-calling-methods-with-tmultigraph/14724)._
