How to set Xmin, Ymin, Xmax, Xmin in graph.C

How can we set Xmax, Xmin, Ymax and Ymin values in graph.C file?
I am using root_v6.14.06
graph.C (853 Bytes)


I believe you can use SetLimits in TAxis for the two axis:

So you can do gr->GetXaxis()->SetLimits(xmin, xmax) and similarly for y axis.

You are right. Its works

There is another question, how to set title of individual curve on right top corner of plot in multigraph.C?
multigraph.C (1.2 KB)

@couet can you take this one? Thanks!

If you mean a TLegend, just follow the first example there; note that you don’t have to add a header to the legend.

Yes TLegend would be the way to do it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.