如何通过matplotlib、python在绘图中仅显示偶数个列表?

如何通过matplotlib、python在绘图中仅显示偶数个列表?,python,list,matplotlib,remove,Python,List,Matplotlib,Remove,这是我的密码 plt.plot(cs1, 'r-') plt.plot(cs2, 'bo') plt.title('Conditioned inhibition') plt.xlabel('Trials') plt.ylabel("Association") plt.ylim(-0.15,1.0) plt.legend(['Vcs1', 'Vcs2']) plt.show() cs1、cs2是列表。 我必须在cs2中绘制没有偶数元素的图 像cs2[2],cs2[4],cs2

这是我的密码

plt.plot(cs1, 'r-')
plt.plot(cs2, 'bo')
plt.title('Conditioned inhibition')
plt.xlabel('Trials')
plt.ylabel("Association")
plt.ylim(-0.15,1.0)
plt.legend(['Vcs1', 'Vcs2'])
plt.show()
cs1、cs2是列表。 我必须在cs2中绘制没有偶数元素的图 像cs2[2],cs2[4],cs2[6]。。。。远远地
我该怎么办?

这是否回答了您的问题?您是否尝试过
plt.plot(cs2[::2],'bo')
?我尝试过,但问题是我必须用间隔(或空白)显示这些值。Oddlist应显示为空白欢迎使用堆栈溢出!请花点时间阅读。您需要提供一个包含玩具数据集的