我通过xarray将二维时间序列绘制为FaceGrid
p = gmt.plot.line(x='time', add_legend=False, alpha = 0.1, color = ('k'), ylim = (-1, 1.2), col='MCrun', col_wrap = 5)
我想添加另一个在顶部具有相同轴和尺寸的线图。对于个人成员,这只是:
gmt.isel(MCrun=0).plot.line(x='time', add_legend=False, alpha = 0.1, color = 'k', ylim = (-3, 1.2))
gmt_esmean.isel(MCrun=0).plot.line(x='time', add_legend=False, color = 'red')
但是使用相同的两个平面网格可以得到20个图——10个是单独的线,10个是平均值。最近的一次是
def smean_plot(*args, **kwargs):
gmt_esmean.plot.line(x='time', add_legend=False, color = 'red')
p = gmt.plot.line(x='time', add_legend=False, alpha = 0.1, color = ('k'), ylim = (-1, 1.2), col='MCrun', col_wrap = 5)
p.map(smean_plot)
任何关于如何仅将平均值添加到相应集合的想法都将受到极大的赞赏
好的,我喜欢的一种方法是通过循环中的子图一个接一个地绘制图形。将x轴和y轴设置为共享,并减少图形边距。它并不像我希望的那样优雅,但效果很好
相关问题 更多 >
编程相关推荐