2017-10-10 90 views
1

我想用Python绘制温度最大/最小值。到目前为止,我只能绘制一段时间内记录的所有温度。以下是我正在使用的代码。任何建议只捕获最大值和最小值T_ch(室内温度)?温度最大/分钟的绘图

fig905, f905ax = plt.subplots(nrows=4, ncols=4, figsize=(16, 12)) 
for i in range(1, 5): 
    for j, sn in enumerate(['DJF', 'MAM', 'JJA', 'SON']): 
     f905ax[i - 1, j].plot(hr_local_int[(ch_no.values == i) & (season == sn)], 
           df_flux.loc[(ch_no.values == i) & (season == sn), 'T_ch' +str(i)], 
           '.', color=color_list[i - 1]) 
     f905ax[i - 1, j].set_xlim((-0.5, 24.)) 
     f905ax[i - 1, j].xaxis.set_major_locator(MultipleLocator(3)) 
     f905ax[i - 1, j].xaxis.set_minor_locator(MultipleLocator(1)) 
     if i == 1: 
      f905ax[0, j].set_title(sn) 

    f905ax[i - 1, 0].set_ylabel('ch' + str(i) + ' Temperature (C)') 

for j in range(4): 
    f905ax[3, j - 1].set_xlabel('Hour (PDT, UTC-7)') 

fig905.tight_layout() 
fig905.savefig(plot_dir + '/ch_plots/Tch_diurnal.png', dpi=300) 

回答