獲取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')