Skip to content

Instantly share code, notes, and snippets.

@adxrgh
Created April 16, 2019 14:19
Show Gist options
  • Save adxrgh/7e25f89b0b0e85b5ae740724fbd74658 to your computer and use it in GitHub Desktop.
Save adxrgh/7e25f89b0b0e85b5ae740724fbd74658 to your computer and use it in GitHub Desktop.
[季节数据]#素材
from WindPy import *
w.start()
_,s = w.edb("S0213383,S0213384,M5417758", "2010-04-16", "2019-04-16","Fill=Previous",usedf=True)
import matplotlib.pyplot as plt
from datetime import datetime as dt
import os
now =dt.now().strftime('%Y%m%d_%H_%M_%S')
fig = plt.figure()
ax =fig.add_subplot(111)
s.columns = ['深圳最高气温','深圳最低气温','小汽车保有量']
s[['深圳最高气温','深圳最低气温']].plot(ax=ax)
s['小汽车保有量'].plot(secondary_y=True)
ax.set_ylabel('气温')
ax.right_ax.set_ylabel('机动车保有量')
plt.legend()
fig.savefig(now+'.png')
os.system('start '+now+'.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment