Use different colormaps#

This example shows how to use different colormaps.

../_images/different_cmaps_4_0.png
import numpy as np
from brainplotlib import brain_plot
import matplotlib.pyplot as plt

rng = np.random.default_rng(0)
v = rng.random((1175, ))
fig, axs = plt.subplots(2, 2, dpi=300, figsize=([_/300 + 1 for _ in [1728, 1560]]))
cmaps = ['viridis', 'jet', 'bwr', 'plasma']
for i in range(2):
    for j in range(2):
        ax = axs[i][j]
        cmap = cmaps[i*2+j]
        img = brain_plot(v, vmax=1, vmin=0, cmap=cmap)
        ax.imshow(img)
        ax.axis('off')
        ax.set_title(cmap)
plt.show()

<< Go back to the gallery of examples