【发布时间】:2021-01-08 15:47:09
【问题描述】:
在我的桌面上使用 Sppyder 运行此代码可以正确显示标记。在我的笔记本电脑上使用相同的代码并且不再显示它们。
我有相同的 spyder (python 3.7) 版本。如果我反转代码行并将市场放在行之前,我可以看到它们,但是行越过了标记。我想要的是越界标记。
fig = plt.figure()
ax1 = fig.add_subplot(111, ylabel='Price in $')
df_MA.iloc[:,0].plot(ax=ax1, color='k', lw=1.)
df_MA[['short_MA', 'long_MA']].plot(ax=ax1, lw=2.)
ax1.plot(df_MA.loc[df_MA.positions == 1.0].index, df_MA.short_MA[df_MA.positions == 1.0],'^', markersize=10, color='g')
ax1.plot(df_MA.loc[df_MA.positions == -1.0].index, df_MA.short_MA[df_MA.positions == -1.0], 'v', markersize=10, color='r')
plt.show()
【问题讨论】:
标签: python matplotlib marker overwrite