On Aug 23, 2013, at 7:43AM, Benjamin Root wrote: > > > On Fri, Aug 23, 2013 at 9:57 AM, Peter Bloomfield > <peter.bloomfi...@camhpet.ca> wrote: > Good morning, > > I am running openSuSE 12.2, and this morning I upgraded matplotlib to v1.3, > and now I am having a problem with suptitle. > I use the following lines to put a title and legend onto a plot figure > > import matplotlib.pyplot as plt > plt.figure(1) > plt.suptitle( "Study# : " + os.path.basename( inImage_IO.IO_FileName ) + \ > "\n" + "{ Acquired : " + \ > AcqDateTime.strftime( "%b %d, %Y - $T_o$ @ %H:%M:%S" ) + " }", \ > y=0.98, weight="roman", size="large" ) > plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", > x=0.86, y=0.03, weight="roman", size="x-small" ) > > Under v1.3, I only get the 'Creation Date : ...' text at the bottom of the > figure the 'Study# ...' string is not present at the top. If I change > it to > > import matplotlib.pyplot as plt > plt.figure(1) > plt.suptitle( "Study# : ", y=0.98, weight="roman", size="large" ) > plt.suptitle( "{Creation Date : " + AnalysisTOD + "}", > x=0.86, y=0.03, weight="roman", size="x-small" ) > > the 'Creation Date : ...' text at the bottom of the figure the 'Study# : ' > string is at the top. > > So the problem is in the string construct in the first example. Does anybody > know of a way to get around this? > > Thanks in advance > > Peter > > > Oh, wow... we didn't think anybody was using that "misfeature". This was a > bug we fixed for 1.3, in that users complained that calling plt.title() would > update an existing title, but plt.suptitle() would not (multiple calls would > just result in text overlaid on top of each other). We fixed this for 1.3 so > that there is a single text object that is kept and is revised in subsequent > calls to suptitle(). To get what you want, you will have to consolidate > those strings into one. > > Cheers! > Ben Ben,
I am glad for the fix. Peter, You could use gcf().text(x,y,'String 1',**keyw) gcf().text(x2,y2,'String 2',**keyw) -Sterling ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users