0
大熊猫据帧的管柱我有熊猫据帧命名red_all,看起来像这样:Matplotlib:用不同的标记和标签
a* b*
s1 32.649998 9.950000
s2 45.359997 18.160000
s3 50.539997 23.759998
s4 54.269997 33.019997
s5 44.219997 29.029999
s6 32.349998 20.830000
s7 17.320000 12.360000
我想B地块*(Y轴)与A *(X每个点具有不同的标记和不同的标记。 到目前为止,我已经试过这样:
s = ['o','v','<','>','p','s','8']
dis_red = ['6.3%r/94.7%w','25%r/75%w','50%r/50%w','red','98.5%r/1.5%b','94.1r/5.9%b','80%r/20%b']
plt.figure(1)
plt.plot(red_all['a*'], red_all['b*'], 'r', marker=s, label=dis_red)
plt.grid()
plt.axis([-60, 60, -60, 85])
plt.xlabel('Chromaticity a*',fontsize=16, fontweight = 'bold')
plt.ylabel('Chromaticity b*', fontsize=16, fontweight = 'bold')
plt.legend(loc='best')
当我尝试运行它,我得到:
ValueError: Unrecognized marker style ['o', 'v', '<', '>', 'p', 's', '8']
我该如何解决这个问题? 谢谢
那看起来不错,但传说怎么样? – diegus
@diegus:你可以使用'annotate'。我更新了我的答案。 – Peque
这对我有用,谢谢 – diegus