我知道我想做什么,但我不知道如何提出這個問題。在我的代碼中,我使用lightkurve包,它有一個類(lightkurve.lightcurve.TessLightCurve),該類有一個繪制變量內容的方法(plot)?!皃lot”方法使用 matplotlib。通過這種方式,我可以繪制兩個獨立的圖形,如下所示:curve.plot()plt.title("Merged unnormalized light curve \n no of sectors merged: {0}".format(len(tpfs)))corrected_curve.plot()plt.title("Merged NORMALIZED light curve \n no of sectors merged: {0}".format(len(tpfs)))這給了我以下數字:我想做的是用這兩個數字作為子圖繪制一個圖。我知道如何使用典型的圖和子圖(如matplotlib 頁面中描述的圖和子圖)來完成此操作,但我不知道如何使用這種類型的數字來完成此操作:(
1 回答

阿晨1998
TA貢獻2037條經驗 獲得超6個贊
看起來該函數lightkurve.lightcurve.TessLightCurve.plot()
?需要一個參數ax=
來指示使用哪個子圖。
fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1)
curve.plot(ax=ax1)
ax1.set_title("Merged unnormalized light curve \n no of sectors merged: {0}".format(len(tpfs)))
corrected_curve.plot(ax=ax2)
ax2.set_title("Merged NORMALIZED light curve \n no of sectors merged: {0}".format(len(tpfs)))
添加回答
舉報
0/150
提交
取消