On 05/27/2011 10:18 PM, .:BrAiN BuRnEr:. wrote: > Hi, > > In my plot I would like to use two x-axis, in order to label the thicks > in two different units. > However, when I use the twiny command, the labels of the secondary > x-axis overlap with the title of the figure. > > Is there a way to increase the space between the title and the plot? > I already tried the top option in subplot_adjust, but this is also > moving the title! > > Here is a small example (attached the png output): > plt.figure() > ax1=plt.subplot(111) > plt.xlabel('axis 1') > ax2=plt.twiny(ax1) > plt.xlabel('axis 2') > plt.title('title')
Save a reference to the text object returned by title, and then adjust the y-coordinate of its position: t = plt.title('title') t.set_y(1.09) plt.subplots_adjust(top=0.86) This y-coordinate is in normalized Axes units, so 1.0 is the top of the Axes frame--except that there is a small additional hard-wired pad, so setting y to 1.0 still leaves a little space. Eric > plt.show() > > > Thanks > __________ > BrainBurner > > > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users