0

I am making a bunch of colour plot figures in matplotlib and I want them all to have the same colour bar scale. At the moment it varies depending on the max/min value in my array and I can’t work out how to set a maximum and minimum value for the colourbar. I want to set the bounds between maximum of 0.8 and a minimum of 0.08. I want the format of 0.08 instead of 8e-02.

fig = plt.figure(figsize=(8, 8))
plt.title(title, fontsize=24)
plt.yticks(fontsize=12)
plt.xticks(fontsize=12)
modelmap = flopy.plot.ModelMap(model=mf)
lev_exp = np.arange(np.floor(np.log10(array.min())-1), 
np.ceil(np.log10(array.max())+1))
quadmesh = modelmap.plot_array(array,lev_exp, norm=colors.LogNorm())
cb = plt.colorbar(quadmesh, shrink=0.6, format='%.0e')
cb.ax.tick_params(labelsize=20)
0

1 Answer 1

0

Try setting the limits with vmin=.08 and vmax=.8 inside your plotting function.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.