[问题] plot结果与资料有异

楼主: disney82231 (菜逼八YOYOYO)   2019-05-02 15:38:29
大家好,我的资料是(9820,2),其中一个变量是类别变量为0跟1
0的个数为689个,1为9131个,我想画出一个散布图分别为1跟0上色
groups = error_df.groupby('true_class')
groups.size()
6fig, ax = plt.subplots()
for name, group in groups:
ax.plot(group.index, group.reconstruction_error, marker='o', ms=3,
linestyle='',
label= "fraud" if name == 1 else "normal",
color="blue" if name == 1 else "k")
ax.legend()
plt.title("Reconstruction error for different classes")
plt.ylabel("Reconstruction error")
plt.xlabel("Data point index")
plt.show();
但跑不出来不知道为什么蓝色的区域盖过黑色的区域,谢谢
https://imgur.com/a/evlxjXD

Links booklink

Contact Us: admin [ a t ] ucptt.com