Matplotlib subplots_adjust hspace so titles and xlabels don't overlap?

前端 未结 3 2026
南笙
南笙 2020-12-08 00:13

With, say, 3 rows of subplots in matplotlib, xlabels of one row can overlap the title of the next. One has to fiddle with pl.subplots_adjust(hspace)

3条回答
  •  我在风中等你
    2020-12-08 00:38

    You can use plt.subplots_adjust to change the spacing between the subplots Link

    subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)
    
    left  = 0.125  # the left side of the subplots of the figure
    right = 0.9    # 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.2   # the amount of width reserved for blank space between subplots
    hspace = 0.2   # the amount of height reserved for white space between subplots
    

提交回复
热议问题