|
From: Eric F. <ef...@ha...> - 2012-09-16 19:31:03
|
On 2012/09/16 8:54 AM, Benjamin Root wrote: > > > On Sun, Sep 16, 2012 at 2:09 PM, Skipper Seabold <jss...@gm... > <mailto:jss...@gm...>> wrote: > > Is there a way to overwrite suptitle? When using 3rd party libs that > return a figure, if they set suptitle and don't give you the text > object back then you can't overwrite it? This doesn't seem right to > me. > > http://stackoverflow.com/questions/10559144/matplotlib-suptitle-prints-over-old-title > > Skipper > > > Correct, this still seems to be the case. Looking at the code in > figure.py, the suptitle() function just creates a text object and places > it at a default location. Then it simply returns the object without > saving a reference to it being a figure title. The only reference kept > is in the self.texts list that it keeps. I see no reason why it has to > be this way, though, and would certainly welcome a patch to fix this > oversight (would make the code involving bbox_tight to be more simple, I > think. Why should a reference be kept other than that in self.texts? Instead of keeping track of it somewhere else, would it be sufficient for the suptitle method to add a default "suptitle" label to the text object? Is there really anything special about the "suptitle" compared to any other text object that might be placed on the figure? Eric > > Ben Root > |