2
我想弄清楚爲什麼這段代碼不起作用。我試圖將「標記」設置爲一個變量,以便它可以根據某個列讀取的內容使用不同的標記。其他的一切在小區工作正常,但是當我添加此部分:使用標記函數時無法識別的標記樣式
mark = ["s" if t == "M" else "o" for t in z]
plt.scatter(x2[yesGEM],y1[yesGEM],c="green",label='Observed (GemN)', marker=mark)
我得到:
ValueError: Unrecognized marker style ['o', 's', 'o', 'o', 'o', 's', 'o', 'o',......'o']
任何想法,這是爲什麼?
http://stackoverflow.com/questions/26490817/matplotlib-scatter-plot-with-different-markers-and-colors – furas