【发布时间】:2012-09-06 07:44:29
【问题描述】:
我有这样的代码:
import matplotlib.pyplot as plt
from matplotlib.pyplot import *
from matplotlib.font_manager import FontProperties
fontP = FontProperties()
fontP.set_size('xx-small')
fig=plt.figure()
ax1=fig.add_subplot(111)
plot([1,2,3], label="test1")
ax1.legend(loc=0, ncol=1, bbox_to_anchor=(0, 0, 1, 1),
prop = fontP,fancybox=True,shadow=False,title='LEGEND')
plt.show()
从图中可以看出,Fontsize中的设置不影响Legend Title字体大小。
如何将图例标题的字号设置为更小?
【问题讨论】:
-
有关更新(2021),请参阅stackoverflow.com/a/67879275/2612410
标签: python matplotlib font-size legend