【发布时间】:2011-10-30 19:12:34
【问题描述】:
这里有一个简单的问题:我正在尝试使用matplotlib.pyplot 使我的图例的大小更小(即文本更小)。我使用的代码是这样的:
plot.figure()
plot.scatter(k, sum_cf, color='black', label='Sum of Cause Fractions')
plot.scatter(k, data[:, 0], color='b', label='Dis 1: cf = .6, var = .2')
plot.scatter(k, data[:, 1], color='r', label='Dis 2: cf = .2, var = .1')
plot.scatter(k, data[:, 2], color='g', label='Dis 3: cf = .1, var = .01')
plot.legend(loc=2)
【问题讨论】:
-
有关 2021 年的更新答案,请参阅 stackoverflow.com/a/62669552/2612410
标签: python size matplotlib legend