【问题标题】:Increase size of symbols in the matplotlib legend?增加 matplotlib 图例中符号的大小?
【发布时间】:2018-09-22 20:08:57
【问题描述】:

我用这样的标记画了一个图:

plt.scatter(xs1, ys1, s=12, linewidths=0, marker='o', label='hello')
plt.scatter(xs2, ys2, s=12, linewidths=0, marker='x', label='hello')

这会在图表中产生正确的大小,但图例中的符号很难理解。如何增加图例中符号的大小

【问题讨论】:

    标签: matplotlib legend


    【解决方案1】:

    我在matplotlib.pyplot.legend 中找到了解决方案。图例采用“markerscale”属性。

    plt.legend(loc='best',markerscale=2)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-04
      • 2018-05-26
      • 1970-01-01
      • 2017-03-24
      • 2019-11-25
      • 2015-10-15
      • 2013-12-22
      • 1970-01-01
      相关资源
      最近更新 更多