增加matplotlib图例中符号的大小? [英] Increase size of symbols in the matplotlib legend?

查看:119
本文介绍了增加matplotlib图例中符号的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这样的标记画图:

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

这会在图形中产生正确的大小,但符号在图例中几乎难以理解.如何增加图例中的符号 的大小?

this produces the right size in the graph, but the symbols are hardly intelligible in the legend. How can I increase the size of the symbols in the legend?

推荐答案

我在 matplotlib.pyplot.legend .图例的属性为"markerscale".

I found the solution in matplotlib.pyplot.legend. The legend takes an attribue 'markerscale'.

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

这篇关于增加matplotlib图例中符号的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆