SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] A quesstion with matplotlib

From: Paul I. <piv...@gm...> - 2011年01月03日 07:14:34
余亮罡, on 2011年01月03日 13:31, wrote:
> I just do not know how to change the font size,could you tell
> me that? Thank you !
Here's a small example. You can either keep around the ylabel
from when you first create it:
 import matplotlib.pyplot as plt
 lbl = plt.ylabel("foo")
 lbl.set_size(25)
If you already have the labels on an axes:
 ax = plt.gca()
 lbl = ax.yaxis.get_label()
 lbl.set_size('x-small')
Note that ax.get_ylabel() only gets you the string of the
label, which is why you have to use ax.yaxis.get_label() to get
an instance of the matplotlib.text.Text object in order to change
its size.
 
hope that helps,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /