You can change the tick size using:

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

See the docs for ax.tick_params here for more parameters that can be modified.

Answer from Ffisegydd on Stack Overflow
Discussions

Change the label size and tick label size of colorbar
Still don't know how to decouple the axis tick size from colorbar tick size. here is the code: import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt More on github.com
🌐 github.com
September 2, 2019
Alter font-size of colorbar tick-labels - Community - Matplotlib
I’m plotting a hist2d and a colorbar along with it, like so: IM = AXES.hist2d(...) FIG.colorbar(IM[3], ax=AXES) How do I control the font-size of the labels of the ticks on the color-bar? This is the only relevant discussion I could find, but how do I do that for a hist2d? More on discourse.matplotlib.org
🌐 discourse.matplotlib.org
0
October 14, 2020
attributes - Python matplotlib decrease size of colorbar labels - Stack Overflow
The difference is that ticklabels are for ticks themselves. These are the numbers that appear on the colorbar. The labels on the other hand is a name/quantity/unit that you want displayed as a text for your colorbar. So, you can play around with both their sizes separately. More on stackoverflow.com
🌐 stackoverflow.com
matplotlib - Python - Decreasing color bar major ticks size - Stack Overflow
I just started implementing rc Parametrization with matplotlib to clean up productivity when it comes to plotting data. When playing with the parameter of the axis ticks, it effects my colorbar tick size, making it look goofy. More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
geeksforgeeks.org › change-the-label-size-and-tick-label-size-of-colorbar-using-matplotlib-in-python
Change the label size and tick label size of colorbar using Matplotlib in Python - GeeksforGeeks
November 5, 2021 - Prerequisites: Seaborn A colorbar is a rectangular color scale that is used to interpret the data of a heatmap. By default, it is of the same size as the heatmap but its size can be changed using the cbar_kws parameter of the heatmap() function.
🌐
GitHub
github.com › pydata › xarray › issues › 3275
Change the label size and tick label size of colorbar · Issue #3275 · pydata/xarray
September 2, 2019 - import xarray as xr import matplotlib.pyplot as plt airtemps = xr.tutorial.open_dataset('air_temperature') air = airtemps.air - 273.15 air2d = air.isel(time=500) im = air2d.plot.pcolormesh(add_colorbar=False) cb = plt.colorbar(im, orientation="horizontal", pad=0.15) cb.set_label(label='Temperature ($^{\circ}$C)', size='large', weight='bold') cb.ax.tick_params(labelsize='large')
🌐
Saturn Cloud
saturncloud.io › blog › how-to-change-the-font-size-of-colorbars-in-matplotlib-a-guide
How to Change the Font Size of Colorbars in Matplotlib: A Guide | Saturn Cloud Blog
May 1, 2026 - This method allows you to change various parameters related to the ticks, including their font size. ... In this line of code, labelsize=20 changes the font size of the colorbar labels to 20. You can adjust this value to suit your needs. ... Finally, use plt.show() to display the plot. ... import matplotlib.pyplot as plt import numpy as np np.random.seed(0) data = np.random.rand(10, 10) plt.imshow(data, cmap='hot', interpolation='nearest') cbar = plt.colorbar() cbar.ax.tick_params(labelsize=20) plt.show()
🌐
Matplotlib
matplotlib.org › stable › api › _as_gen › matplotlib.pyplot.colorbar.html
matplotlib.pyplot.colorbar — Matplotlib 3.11.2 documentation
The shrink kwarg provides a simple way to scale the colorbar with respect to the Axes. Note that if cax is specified, it determines the size of the colorbar, and shrink and aspect are ignored.
🌐
Matplotlib
discourse.matplotlib.org › community
Alter font-size of colorbar tick-labels - Community - Matplotlib
October 14, 2020 - CBAR = FIG.colorbar(IM[3], ax=AXES) CBAR.tick_params(labelsize=8)
Find elsewhere
🌐
Matplotlib
matplotlib.org › stable › api › colorbar_api.html
matplotlib.colorbar — Matplotlib 3.11.2 documentation
If False the minimum and maximum colorbar extensions will be triangular (the default). If True the extensions will be rectangular. ... If None, ticks are determined automatically from the input.
🌐
Google Groups
groups.google.com › g › pyart-users › c › eg00Fr79Tk4
change colorbar tick and label sizes in display.plot
xsect = pyart.util.cross_section_ppi(radar, [320]) display = pyart.graph.RadarDisplay(xsect) fig= plt.figure(figsize=(30,30)) ax1 = fig.add_subplot(311) display.plot('DBZH',0, cmap='pyart_Carbone42', vmin=-5, vmax=65, ax=ax1,colorbar_label= 'DBZH [dBZ]',title=" ") ax1.set_ylim([0, 14]) ax1.set_xlim([60, 100]) ax1.set_xlabel('', fontsize=24) ax1.set_ylabel('Distance above radar [km]', fontsize=24) plt.xticks(fontsize=20) plt.yticks(fontsize=20) ax2 = fig.add_subplot(312) display.plot('VELH',0, cmap='pyart_Carbone42', vmin=-30, vmax=30,ax=ax2,colorbar_label= 'VELH [m/s]',title=" ") ax2.set_ylim(
🌐
GeeksforGeeks
geeksforgeeks.org › setting-the-number-of-ticks-in-pltcolorbar-in-matplotlib
Setting the Number of Ticks in plt.colorbar in Matplotlib? - GeeksforGeeks
August 8, 2024 - Overlapping Labels: If labels overlap, reduce the number of ticks or adjust the font size. Incorrect Tick Labels: Ensure that the tick positions and labels match the data range. Use set_ticks and set_ticklabels carefully to avoid mismatches. Compatibility: Some older versions of Matplotlib may not support all features. Ensure you are using a compatible version if you encounter errors. In conclusion, setting the number of ticks in plt.colorbar in Matplotlib allows for precise control over how data values are represented visually on a colorbar.
🌐
Matplotlib
discourse.matplotlib.org › community › matplotlib-users
How to set the colorbar ticks fontsize. - matplotlib-users - Matplotlib
August 4, 2019 - Hi all, I looking for a way to modify the colorbar ticks font size. a=rand(100,100) imshow(a) colorbar() and then?? For instance, xticks(fontsize=20) works well to modify the ticks fontsize along the X-axis but col…
🌐
Readthedocs
aplpy.readthedocs.io › en › stable › api › aplpy.Colorbar.html
Colorbar — aplpy v2.0.2
set_axis_label_font(family=None, style=None, variant=None, stretch=None, weight=None, size=None, fontproperties=None)[source]¶ · Set the font of the tick labels. ... Default values are set by matplotlib or previously set values if set_font has already been called. Global default values can be set by editing the matplotlibrc file. ... Set the colorbar label displacement, in points.
🌐
Matplotlib
matplotlib.org › stable › gallery › ticks › colorbar_tick_labelling_demo.html
Colorbar Tick labelling — Matplotlib 3.11.2 documentation
fig, ax = plt.subplots() data = rng.standard_normal((250, 250)) cax = ax.imshow(data, vmin=-1, vmax=1, cmap='coolwarm') ax.set_title('Gaussian noise with vertical colorbar') # Add colorbar, make sure to specify tick locations to match desired ticklabels cbar = fig.colorbar(cax, ticks=[-1, 0, 1], ...
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-add-matplotlib-colorbar-ticks
How to add Matplotlib Colorbar Ticks?
March 25, 2026 - You can further customize the appearance of colorbar ticks ? import numpy as np import matplotlib.pyplot as plt # Create data data = np.random.uniform(0, 100, (8, 8)) # Create plot im = plt.imshow(data, cmap='plasma') # Add colorbar with many ticks ticks = np.arange(0, 101, 10) # Ticks every 10 units cb = plt.colorbar(im, ticks=ticks) # Customize tick parameters cb.ax.tick_params(labelsize=8, rotation=45) cb.set_label('Values', rotation=270, labelpad=15) plt.title('Colorbar with Rotated Tick Labels') plt.show()
🌐
GitHub
github.com › matplotlib › matplotlib › issues › 21674
[ENH]: fontsize argument for colorbar · Issue #21674 · matplotlib/matplotlib
November 18, 2021 - Add a keyword plt.colorbar(fontsize=20) or plt.colorbar(size=20)? ... Its ambiguous which font you would be setting. The magic command should be the same as for all axes: cb.ax.yaxis.set_tick_params(labelsize=32). I admit that is a bit of a pain, but its the same for all axes. I don't think I would be in favour of adding a different API for colorbars... https://matplotlib.org/stable/api/_as_gen/matplotlib.axis.Axis.set_tick_params.html
🌐
Matplotlib
matplotlib.org › 3.1.1 › gallery › ticks_and_spines › colorbar_tick_labelling_demo.html
Colorbar Tick Labelling Demo — Matplotlib 3.1.2 documentation
May 1, 2020 - fig, ax = plt.subplots() data = ... # Add colorbar, make sure to specify tick locations to match desired ticklabels cbar = fig.colorbar(cax, ticks=[-1, 0, 1]) cbar.ax.set_yticklabels(['< -1', '0', '> 1']) # vertically oriented colorbar...