fig = plt.figure(figsize=(20, 10))
ax3 = fig.add_subplot(111)
ax3.plot(df['ind'].values, df.deal_price.values, color = 'b', linestyle='--',label = '行情走势')
ax3.scatter(df1.ind.values, df1.deal_price.values,color='r', marker='o', label='红色买点', linewidths=10) # 红色买单
ax3.scatter(df2.ind.values, df2.deal_price.values,color='g', marker='d', label='绿色卖点', linewidths=10)
for x, y in zip(df2.ind.values, df2.deal_price.values):
ax3.annotate('%s'%df2.loc[(df2.deal_price == y)&(df2.ind == x)]['text'][0], xy=(x,y),xytext = (0, 50), textcoords = 'offset points', fontsize=12,
ha='center',va='top')
for x, y in zip(df1.ind.values, df1.deal_price.values):
ax3.annotate('%s'%df1.loc[(df1.deal_price == y)&(df1.ind == x)]['text'][0], xy=(x,y),xytext = (0, -50), textcoords = 'offset points', fontsize=12,
ha='center',va='bottom')
ax3.xaxis.set_major_formatter(ticker.FuncFormatter(format_date))
ax3.set_title('基于L2数据的B_S择时信号图')
plt.legend()
fig.autofmt_xdate()
plt.show()