Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active April 16, 2024 13:18
A guide to replacing the deprecated `seaborn.distplot` function.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / right_side_title.py
Created July 18, 2021 20:52
Put a title on the right y axis of a matplotlib axes using the set_title API.
import matplotlib as mpl
import matplotlib.pyplot as plt
f, ax = plt.subplots(figsize=(5, 5))
ax.set_title("Col title", y=1)
title = ax.set_title(
"Row title", loc="right", y=.5,
rotation=270, ha="left", va="center",
)
offset_trans = mpl.transforms.ScaledTranslation(
@mwaskom
mwaskom / ddm_conv.ipynb
Created October 16, 2020 14:12
Comparing CPU- and GPU-based convolution and Fokker-Planck solution for fitting the drift diffusion model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / crest.jscm
Created September 8, 2020 18:47
Perceptually-uniform colormaps for scatter and line plots
{
"content-type": "application/vnd.matplotlib.colormap-v1+json",
"name": "new cm",
"license": "http://creativecommons.org/publicdomain/zero/1.0/",
"usage-hints": [
"red-green-colorblind-safe",
"greyscale-safe",
"sequential"
],
"colorspace": "sRGB",
@mwaskom
mwaskom / histplot_api_examples.ipynb
Last active June 14, 2020 16:50
Draft of API examples for `seaborn.histplot`, prior to merge
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / histplot_features.ipynb
Last active June 13, 2020 21:17
Demo of some features from WIP seaborn.histplot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / matplotlib_animation_of_large_scatterplot.ipynb
Created May 23, 2020 16:42
Animate a lot of points, quickly, in matplotlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / diag_diff_hist.ipynb
Created May 11, 2020 16:15
Scatterplot of x,y with hist of x-y
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.