仅绘制温度最大/最小值

2024-10-04 05:23:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用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)

Tags: noinforplot绘制rangech温度