Skip to content

Instantly share code, notes, and snippets.

View DanielKotik's full-sized avatar
💭
I may be slow to respond.

Daniel Kotik DanielKotik

💭
I may be slow to respond.
View GitHub Profile
@bdjackson
bdjackson / SetMidpoint.py
Last active September 15, 2021 23:55
Setting the midpoint of a matplotlib colormap
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
class MidpointNormalize(mpl.colors.Normalize):
"""
class to help renormalize the color scale
"""
def __init__(self, vmin=None, vmax=None, midpoint=None, clip=False):
self.midpoint = midpoint