Hi,
I followed the canvas2.c example https://root.cern/doc/master/canvas2_8C.html where I splitted the canvas in 3 parts along the x-axis. I would like to have a title above every coordinate system describing its content but equipping the multigraph with the title via SetTitle() does not work. How do I get three titles?
It is a known bug that sometimes you cannot simply use “SetTitle” for graphs which were retrieved from a ROOT file. You need to go through its internal “fHistogram”, if you were careless enough to allow it to be created before you saved the graph to a ROOT file. The same will happen if you draw the graph and then try to change its title.
okay you are right now I have the titles now which I would have too if I would have set them before exporting the graphs into the .root file.
But I thought setting the titles after splitting the canvas prevents me from the following problem:
The three titles are there but:
inside the picture
with different size and different horizontal position
How can I change that? I tried playing a little bit with gStyle->setTitleY(); and now I have all of them outside the picture on top of the coordinate system but to change the size and position I have to address them separately. Is that possible?
@couet Maybe you could add “SetHistogram” to “TMultiGraph” (this would then allow to execute delete mg->GetHistogram(); mg->SetHistogram(0); which works for ordinary graphs).