Note
Go to the end to download the full example code.
Colormap reference#
Plot hyoga altitude and relief colormaps.
import numpy as np
import matplotlib.pyplot as plt
import hyoga # register colormaps, pylint: disable=unused-import
# initialize figure
fig, axes = plt.subplots(nrows=5)
fig.subplots_adjust(left=0.2)
# prepare gradient image
gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient))
# plot background pattern and color gradients
colormaps = ['Bathymetric', 'Topographic', 'Elevational', 'Matte', 'Glossy']
for ax, name in zip(axes, colormaps):
ax.patch.set(hatch='..', edgecolor='0.5')
ax.imshow(gradient, aspect='auto', cmap=name)
ax.text(-8, .5, name, va='center', ha='right', fontsize=10)
ax.set(xticks=[], yticks=[])
# set title
axes[0].set_title('Hyoga colormaps')
# show
plt.show()
Total running time of the script: (0 minutes 0.120 seconds)