【发布时间】:2021-09-30 20:58:06
【问题描述】:
我在一个有拉图的情节中工作,我将其定义为:
fig, (ax1, ax2) = aplt.ratio_plot(name= canvasArray[kl], figsize=(800, 800), hspace=0.05)
它工作正常,但现在我需要在图像中添加另一个拉图,所以我尝试了:
fig, (ax1, ax2,ax3) = aplt.subplots(3,1,name="fig1", figsize=(850, 950))
我得到了结果图:
我尝试了一些选项,例如 .set_aspect(),但我不断收到错误 AttributeError: 'Axes' object has no attribute 'set_aspect'。我希望主情节占全情节的 2/4,拉情节各占 1/2,但我对此有困难。
我在面向对象的环境中工作,所以我不知道这是否会改变事情。我正在使用使用 matplotlib 语法的 Atlasplots 包。 https://atlas-plots.readthedocs.io/en/latest/
【问题讨论】:
-
我的环境下没试过,但是可以用下面的代码吗?
fig, (ax1, ax2, ax3) = aplt.subplots(nrows=3,ncols=1,name="fig1",figsize=(850, 950), height_ratios=[2,1,1])我引用的信息是here。
标签: python subplot atlas-plot