Python matplotlib图例中符号左侧的文本
是否有任何内置函数/方法或简明方式将图例中标记/符号左侧的文本显示出来?这可以通过将Python matplotlib图例中符号左侧的文本,python,matplotlib,legend,Python,Matplotlib,Legend,是否有任何内置函数/方法或简明方式将图例中标记/符号左侧的文本显示出来?这可以通过将matplotlib.pyplot.legend的参数markerfirst设置为False来实现 :bool 如果为True,图例标记将放置在图例标签的左侧。如果为False,图例标记将放置在图例标签的右侧。默认值为True 诸如此类: t = np.arange(0.0, 2.0, 0.01) s = 1 + np.sin(2 * np.pi * t) fig, ax = plt.subplots() ax
matplotlib.pyplot.legend
的参数markerfirst
设置为False
来实现
:bool
如果为True,图例标记将放置在图例标签的左侧。如果为False,图例标记将放置在图例标签的右侧。默认值为True
诸如此类:
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()
我希望这就是你想要的:)这正是我想要的。谢谢