From: John H. <jdh...@ac...> - 2003-11-07 15:38:00
|
>>>>> "Jonas" == Jonas August <jo...@cs...> writes: Hi Jonas, Thanks for the email. In the future would you mind posting questions to the mailing list http://lists.sourceforge.net/mailman/listinfo/matplotlib-users so others can benefit from / contribute to the discussion? Jonas> Hi There, I was just trying out your matplotlib .31 on Jonas> gentoo-1.4 (gnu/linux) with pygtk 1.99.16 and python 2.2.3. Jonas> First, thanks for putting this impressive package together; Jonas> plotting is a barrier to entry for python, and the adoption Jonas> of the matlab syntax is clean. Jonas> Onto my issue: I noticed that the x label in a plot I Jonas> created from your tutorial gets clipped below both in the Jonas> window and in the png file created by the save button. Hmm. From you screenshot you sent, I assume you are using this example from matplotlib.matlab import * font = {'fontname' : 'Courier', 'color' : 'r', 'fontweight' : 'bold', 'fontsize' : 11} plot([1,2,3]) title('A title', font, fontsize=12) text(0.5, 2.5, 'a line', font, color='k') xlabel('time (s)', font) ylabel('voltage (mV)', font) show() When I plot this example with matplotlib 0.31, I do not get the clipping you showed in the screenshots you sent. However, from your screenshot, it looks like you have increased the default fontsize to larger than 11. Are you using a larger size? If I make the fontsize much larger, say 20, I can reproduce the xlabel clipping you showed. I don't know if this is a bug or a feature :-). Since you can make the text arbitrarily large, at some point it will extend beyond the boundaries of a figure of a given size. How do you think it should behave? Resize the axes/figure? Warn the user? I'll have to think about it. That said, there is a parameter you can tweak to fix this problem if you want larger fonts. In matplotlib/backends/backend_gtk.py on line 761, you can increase the screenDPI parameter, say to 150, which will enable larger fonts relative to your plots. I am still not decided on how the defaultDPI should be set in a device independent way, since the actual DPI is display dependent. I'm considering setting up a config file so users can customize things like their default fonts, DPIs, figsizes, backend, etc.... John Hunter |