import matplotlib.pyplot as plt
import matplotlib as mpl
plt.rcParams['font.size'] = 48
plt.rcParams['font.family'] = 'Arial'
plt.rcParams['axes.linewidth'] = 1
fig = plt.figure(figsize=(1, 9))
ax1 = fig.add_axes([0, 0, 1, 1])
cmap = mpl.cm.viridis
norm = mpl.colors.Normalize(vmin=0, vmax=12)
cb1 = mpl.colorbar.ColorbarBase(
ax1, cmap=cmap,
norm=norm,
orientation='vertical'
)
cb1.set_label('colorbar')
cb1.set_ticks([0,3,6,9,12])
cb1.set_ticklabels([0,25,50,75,100])
plt.savefig(
'colorbar_v.png',
dpi=300,
bbox_inches='tight'
)
-
Notifications
You must be signed in to change notification settings - Fork 0
This example shows how to build colorbars without an attached mappable.
License
himoto/colorbar
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
This example shows how to build colorbars without an attached mappable.
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published