代码之家  ›  专栏  ›  技术社区  ›  Bananach

matplotlib窗口在光标移动时不稳定地更改大小

  •  0
  • Bananach  · 技术社区  · 7 年前

    (我在使用Python3.6和matplotlib 2.2.2的Ubuntu18上)

    enter image description here

    fig,axs = plt.subplots(3,1,figsize=(4,6))
    #fill each axis with standard ax.plot commands
    [ax.set_ylim([-2,2]) for ax in axs]
    [ax.text(x=1.1,y=0,s=f"$f_{{{i+1}}}-f_{{{i}}}$") for i,ax in enumerate(axs)]
    fig.subplots_adjust(
        left  = 0.1,  # the left side of the subplots of the figure
        right = 0.7  ,  # the right side of the subplots of the figure
        bottom = 0.1 ,  # the bottom of the subplots of the figure
        top = 0.9 ,  # the top of the subplots of the figure
        wspace = 0.9 ,  # the amount of width reserved for blank space between subplots
        hspace = 0.9 ,  # the amount of height reserved for white space between subplots
    )
    plt.show()
    
    0 回复  |  直到 7 年前