ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
I am trying to use the TPad::BuildLegend() auto positioning feature on a TMultiGraph. Unfortunately the Legend is always built in the bottom left corner as in the example https://root.cern.ch/doc/master/classTMultiGraph.html. Is this a known bug or is there some work around using the gPad? I am on ROOT version 6.12/06.
Thanks for the response. Out of curiosity will there be auto-placement implemented in the future? The BuildLegend()'s auto position works nicely with the TH1s.
Can you provide a script showing the issue ? It might be multigraph are ignored.
Sorry for the late reply I went on holiday and didn’t have chance beforehand to respond. Here is some example code taken from https://root.cern.ch/doc/master/classTMultiGraph.html and edited slightly. I notice if I draw the last TGraph, as in the example the BuildLegend notices this and move accordingly. If I just add it to the MultiGraph and draw then the BuildLegend is not moved. As you said the MultiGraph is ignored.
ExampleBuildLegend.C (1.2 KB)
Now implemented in ROOT master (also for THStack).
Great! Thank you very much.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.