我知道我想做什么,但我不知道如何提出这个问题。在我的代码中,我使用lightkurve包,它有一个类(lightkurve.lightcurve.TessLightCurve),该类有一个绘制变量内容的方法(plot)。“plot”方法使用 matplotlib。通过这种方式,我可以绘制两个独立的图形,如下所示:curve.plot()plt.title("Merged unnormalized light curve \n nº of sectors merged: {0}".format(len(tpfs)))corrected_curve.plot()plt.title("Merged NORMALIZED light curve \n nº 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 nº of sectors merged: {0}".format(len(tpfs)))
corrected_curve.plot(ax=ax2)
ax2.set_title("Merged NORMALIZED light curve \n nº of sectors merged: {0}".format(len(tpfs)))
添加回答
举报
0/150
	提交
		取消
	