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

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

The following screenshot shows my x-axis.

\"enter

I added some labels and rot

4条回答
  •  悲哀的现实
    2020-12-29 19:38

    Two retroactive ways:

    fig, ax = plt.subplots()
    # ...
    fig.tight_layout()
    

    Or

    fig.subplots_adjust(bottom=0.2) # or whatever
    

    Here's a subplots_adjust example: http://matplotlib.org/examples/pylab_examples/subplots_adjust.html

    (but I prefer tight_layout)

提交回复
热议问题