【发布时间】:2022-01-23 05:55:12
【问题描述】:
我有一个使用以下代码生成的matplotlib 图:
import matplotlib.pyplot as pyplot
Fig, ax = pyplot.subplots()
for i, (mark, color) in enumerate(zip(
['s', 'o', 'D', 'v'], ['r', 'g', 'b', 'purple'])):
ax.plot(i+1, i+1, color=color,
marker=mark,
markerfacecolor='None',
markeredgecolor=color,
label=i)
ax.set_xlim(0,5)
ax.set_ylim(0,5)
ax.legend()
以此作为生成的图:
我不喜欢图例中通过标记的线条。我怎样才能摆脱它们?
【问题讨论】:
标签: python matplotlib legend