获取dataframe的行列数
行:
df.shape[0] 或者:len(df)
列:
df.shape[1]
PM2.5的表示方法
'PM$_2$$_.$$_5$(μg m$^-$$^3$)'
获取array的index,然后进行替换
ws[np.argwhere((wd<90) | (wd >270))]=np.nan ##挑出非南风,赋值为np.nan
画双y轴坐标,并设置tick的属性
axs0 = axs[0].twinx()
line1=axs0.plot(xs,Temp,color=c,ls=ls,lw=0.8)
axs0.set_ylabel('T($^\circ$C)', color=c) # we already handled the x-label with ax1
axs0.set_ylim(10,40)
axs0.tick_params(axis='y', labelcolor=c,color=c)
把图的上轴线和右轴线隐掉
for spine in ["top", "bottom"]:
axs0.spines[spine].set_visible(False)
## axs0.spines[spine].set_color('None')