Skip to content

Instantly share code, notes, and snippets.

@natecostello
natecostello / colors.py
Created May 22, 2024 00:25
A script that shows how to produce color schemes for plotting distinct traces from two populations (e.g., pass, fall) #matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import numpy as np
# Generate some data
np.random.seed(0)
x = np.linspace(0, 10, 100)
y1 = [np.sin(x + i) for i in range(5)] # Periodic dataset
y2 = [np.exp(-0.1 * (x + i)) for i in range(5)] # Non-periodic dataset