I am creating a plot in matplotlib using the following commands:
fig = plt.figure()
ax = plt.axes()
ax.plot ( xdata, ydata )
my_cmap = cm.seismic
ax.tick_params ( axis='x', labelsize=16 )
ax.tick_params ( axis='y', labelsize=16 )
sm = plt.cm.ScalarMappable ( cmap=my_cmap, norm=plt.Normalize(vmin=0, vmax=1) )
cbar = plt.colorbar(sm, orientation='vertical')
cbar.set_ticks ( [0, 1] )
cbar.set_ticklabels( ["Poorest", "Best"] )
cbar.ax.tick_params(labelsize=14)
cbar.ax.set_ylabel ("Quality of solvent", fontsize=18, rotation=270)
ax.set_xscale('log')
ax.set_xlabel ( "Temperature (reduced)", fontsize=18)
ax.set_ylabel ( "$\\xi$", fontsize=18)
ax.yaxis.set_major_locator(matplotlib.ticker.MaxNLocator(11))
ax.set_yticks (np.linspace(0, 1, 11))
fig.tight_layout ()
plt.savefig ( "DOP_"+str(dop)+"_parameter.png", dpi=1000)
I am getting the following image:
This post: How do I extend the margin at the bottom of a figure in Matplotlib? suggested I use plt.tight_layout(), but that evidently did not work. How do I add additional space to the bottom of the plot, while maintaining the yrange from 0.0 to 1.0?