How do I extend the margin at the bottom of a figure in Matplotlib?

前端 未结 4 1850
再見小時候
再見小時候 2020-12-29 19:00

The following screenshot shows my x-axis.

\"enter

I added some labels and rot

4条回答
  •  温柔的废话
    2020-12-29 19:45

    Subplot-adjust did not work for me, since the whole figure would just resize with the labels still out of bounds.

    A workaround I found was to keep the y-axis always a certain margin over the highest or minimum y-values:

    x1,x2,y1,y2 = plt.axis()
    plt.axis((x1,x2,y1 - 100 ,y2 + 100))
    

提交回复
热议问题