Skip to content

Instantly share code, notes, and snippets.

View Prukutu's full-sized avatar

Luis Ortiz Prukutu

View GitHub Profile
@Prukutu
Prukutu / cbar_subplot.py
Created May 20, 2020 18:37
Create a matplotlib figure with a colorbar using gridspec.
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from numpy.random import randint
# Generate array of random values
data = randint(0,
high=100,
size=(100, 100))
# GridSpec object. second column will hold colorbar