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