How to fix the left and right margin in plot_objective function from skopt.plots?

Viewed 30

See this plot_objective:

It was obtained by:

fig=plt.figure(num="HPO_plot_objective",figsize=(10,10))
plot_objective(result=optimize_result,n_points=n_calls)

the num_boost_round (on the left), and the eta (at the bottom, first column), is hidden by the margin. How to fix that?

I tried to play with margins in this way, but there is no effect

fig=plt.figure(num="HPO_plot_objective",figsize=(10,10))
plot_objective(result=optimize_result,n_points=n_calls)
plt.margins(1.0,1.0)
plt.savefig(f"results/plot_objective.png")
1 Answers

plt.tight_layout() may fix the problem.

Related