I’m aware of what is recommended to do - I am wondering why, especially when contrasted with the TGraph that works well.
When creating a structured program, I want to set the TMultiGraph axis in the same function that handles its data and creates it. This means that I am forced to draw this MultiGraph on some temp canvas, manipulate its axis, then dump the canvas. Then, much later, draw the MultiGraph on its final intended canvas. Also it creates a lot of confusion when the active canvas at the time of running the MultiGraph function gets drawn on.
TMultiGraph is a collections of TGraphs. A TGraph can be added at any time in a TMultigraph, therefore the axis limits computation is done at painting time as you can see here: root.cern.ch/root/html/src/TMult … tml#n4V_GD
I know this is an old post, but this has been bugging me too. I often want to return a graph from a class containing data. Then plot the graphs from the interpreter or a macro. But I would like to set up the whole plot from the member function. It would be nice to build the axis without drawing. I suppose that’s just the way it is though.
Yes the axis limits are compute had drawing time in The method TMultigraph::Paint.
An histogram is created to define the frame. It can be retrieve using GetHistogram().