The axis and label overlap A man born just to do matplotlib
ax.set_ylabel("cost", rotation=270, labelpad=15)
The above rotation is irrelevant (usually I use it because I want the right-facing label "cost" to be reversed).
By specifying the labelpad, you can specify the distance from the figure.
With this, we were able to widen the width as shown below.
Recommended Posts