【发布时间】:2021-11-13 23:19:49
【问题描述】:
我想绘制一个散点图,其中包含彩色数字而不是点作为符号。 我做了如下
n=np.arange(1,14,1)
fig, axs = plt.subplots(1, 2)
axs[0].scatter(x, y, linestyle='None', color="white")
for i, txt in enumerate(n):
axs[0].annotate(txt, (x[i], y[i]), color=x_y_colours[i], ha="center", va="center")
它成功了,但现在我不知道如何创建图例!我想用彩色数字作为符号,然后是标签。
谢谢大家!
【问题讨论】:
标签: matplotlib legend scatter-plot