Colormaps (cosmoplotian.colormaps
)¶
Colormaps for plotting of cosmological image. This module deals with providing
customizable colormaps implemented with
matplotlib.colors.LinearSegmentedColormap
. The colormaps are
implemented individually, rather than being able to choose colors
‘on-the-fly’, as it results in a simpler interface. Once cosmoplotian
has been implemented, the colormap names will be available thorugh the
cmap
keyword argument.
Examples¶
Divergent colormap
import cosmoplotian
import numpy as np
import matplotlib.pyplot as plt
fig, axes = plt.subplots(figsize=(6, 0.3), dpi=100, sharey=True)
fig.subplots_adjust(
wspace=0, right=0.99, top=0.99, bottom=0.00, left=0.01, hspace=0.0
)
plt.yticks([])
arr = np.tile(np.arange(1000), 100).reshape(100, 1000)
plt.imshow(arr, cmap='div yel grn')
(Source code, png, hires.png, pdf)
Linear colormap
import cosmoplotian
import numpy as np
import matplotlib.pyplot as plt
fig, axes = plt.subplots(figsize=(6, 0.3), dpi=100, sharey=True)
fig.subplots_adjust(
wspace=0, right=0.99, top=0.99, bottom=0.00, left=0.01, hspace=0.0
)
plt.yticks([])
arr = np.tile(np.arange(1000), 100).reshape(100, 1000)
plt.imshow(arr, cmap='lin blu')
(Source code, png, hires.png, pdf)