How to make figures for publications
Matplotlib
Subplots
fig, axes = plt.subplots(nrows=2, ncols=2) for ax in axes.flat: im = ax.imshow(np.random.random((10,10)), vmin=0, vmax=1)
Add colorbar
fig.subplots_adjust(right=0.8) cbar_ax = fig.add_axes([0.85, 0.15, 0.05, 0.7]) fig.colorbar(im, cax=cbar_ax)
Labels and Ticks
titles = ['Line Plot', 'Scatter Plot', 'Bar Chart', 'Box Plot'] xlabel = 'Group' ylabel = 'Value ($units^2$)' xticks = np.arange(len(means)) xticklabels = range(1,6)
ax.xaxis.set_tick_params(top='off', direction='out', width=1) ax.yaxis.set_tick_params(right='off', direction='out', width=1) ax.set_title(title) ax.set_xlabel(xlabel) ax.set_ylabel(ylabel) ax.set_xticks(xticks) ax.set_yticks(yticks) ax.set_xticklabels(xticklabels) ax.set_yticklabels(yticklabels)