我需要在兩側(左右)沒有這些空格的情況下進行繪圖由于我是 Stack Overflow 的新用戶,因此無法在此處顯示圖片,鏈接為: 在此處輸入圖片描述這是我的代碼:by_time_month = []for i in range(12): b_t_m = demand[f'2019-{i+1}'].groupby(demand[f'2019-{i+1}'].index.time).mean() by_time_month.append(b_t_m) i=i+1hourly_ticks_3 = 3*60*60*np.arange(8)months = ('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre')fig, ax = plt.subplots(nrows=6, ncols=2, figsize=(13, 22))for by_month, ax, subtitle in zip(by_time_month, fig.get_axes(), months): ax.plot(by_month, label='Demanda') ax.set_xticks(hourly_ticks_3) ax.set_title('Diagrama de Carga de ' + subtitle + ' 2019' + '\n-Promedio mensual-') ax.set_xlabel('Hora del día') ax.set_ylabel('Demanda [MW]') ax.axvline("17:00", color="C1", linestyle="--", lw=1, alpha=0.8) ax.axvline("23:00", color="C1", linestyle="--", lw=1, alpha=0.8) ax.text("20:00", 0.15, 'Horas Punta', transform=ax.get_xaxis_transform(), bbox=dict(fc='none', ec='C1', boxstyle='round'), ha='center') ax.grid(True, lw=0.8, alpha=0.5) ax.legend()plt.tight_layout()
我的時間序列圖如何從“00:00”開始并在“23:00”結束?兩邊沒有空格
慕的地6264312
2022-10-06 16:51:30