matplotlib - 增加 matplotlib 图例中符号的大小?

标签 matplotlib legend

我画了一个带有标记的图,如下所示:

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.pyplot.legend 中找到了解决方案.图例采用属性“markerscale”。

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

关于matplotlib - 增加 matplotlib 图例中符号的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49800496/

相关文章:

r - 根据图中图例向量的长度更改图例中文本的大小

python - 如何将 NumPy 数组转换为应用 matplotlib 颜色图的 PIL 图像

python - 从 3D Numpy 数组绘制红色 channel

matplotlib:重绘前清除散点数据

python - 使用 text.usetex 时无法将 matplotlib 图保存到 Windows 中的 .eps : True

在R中的图例中删除符号中的线

python - 在具有不同比例的不同轴上绘制两个数据框列

Matlab 条形图和图例不在同一个方向

python - 你如何在 Seaborn 中为 kde plot 创建一个传奇?

python - Matplotlib:如何绘制一个填充有颜色图的小矩形作为图例