How to change tick font size matplotlib.pyplot.colorbar.ColorbarBase?

I would like to know how to change font size of ticks of ColorbarBase matplotlib . The following lines are an important part of my analysis script that uses ColorbarBase .

 import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import matplotlib as mpl axcb = fig.add_axes([0.9, 0.135, 0.02, 0.73]) cb = mpl.colorbar.ColorbarBase(axcb, norm=LogNorm(vmin=7e-5, vmax=1), cmap=plt.cm.CMRmap) cb.set_label("Relative Photon Intensity", labelpad=-1, size=14) 

I am using matplotlib ver 1.4.3 with Python 2.7 on OS X.

+7
matplotlib
source share
1 answer

You can resize the checkmark using:

 font_size = 14 # Adjust as appropriate. cb.ax.tick_params(labelsize=font_size) 

See the docs for ax.tick_params for more information on parameters that can be changed.

+19
source share

All Articles