Colorbars¶
Basics¶
Plot Colorbar Only¶
Plot n Colorbars, 1 Plot¶
- How to Plot Only One Colorbar for Multiple Plot Using Matplotlib - jdhao's Blog
- Matplotlib Docs
- StackOverflow
Colorbar Position¶
Scaling¶
cbar = plt.colorbar(pts, fraction=0.046,)
Normalizing¶
import matplotlib.colors as colors
boundaries = (0.0, 1.0)
# plot data
pts = ax.pcolor(
X,Y,Z,
norm=colors.Normalize(vmin=boundaries[0], vmax=boundaries[1])
cmap='grays'
)
# plot colorbar
cbar = plt.colorbar(pts, ax=ax, extend='both')
Normalizations
- Log Scale
- Symmetric Log Scale
Resources
- Matplotlib Tutorial - ColorMap Norms
- Jake Vanderplas - Customizing Colorbars