this can be done by setting the parameter markerfirstof the matplotlib.pyplot.legend to False.
markerfist : bool 如果为 True,则图例标记放置在图例标签的左侧。如果为 False,图例标记将放置在图例标签的右侧。默认值为真。
类似的东西:
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s, label='sine')
ax.legend(markerfirst=False)
plt.show()
Run Code Online (Sandbox Code Playgroud)
我希望这就是你要找的:)
| 归档时间: |
|
| 查看次数: |
629 次 |
| 最近记录: |