Skip to content

Instantly share code, notes, and snippets.

@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active May 15, 2022
A guide to replacing the deprecated `seaborn.distplot` function.
View replacing_seaborn_distplot.ipynb
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 Jul 18, 2021
Put a title on the right y axis of a matplotlib axes using the set_title API.
View right_side_title.py
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 Oct 16, 2020
Comparing CPU- and GPU-based convolution and Fokker-Planck solution for fitting the drift diffusion model
View ddm_conv.ipynb
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 Sep 8, 2020
Perceptually-uniform colormaps for scatter and line plots
View crest.jscm
{
"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 Jun 14, 2020
Draft of API examples for `seaborn.histplot`, prior to merge
View histplot_api_examples.ipynb
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 Jun 13, 2020
Demo of some features from WIP seaborn.histplot
View histplot_features.ipynb
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
Animate a lot of points, quickly, in matplotlib
View matplotlib_animation_of_large_scatterplot.ipynb
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
Scatterplot of x,y with hist of x-y
View diag_diff_hist.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / wide_to_long_transform.ipynb
Last active May 11, 2020
Notebook for figuring out consistent transformations from a variety of "wide" data to a long-form plot dataframe
View wide_to_long_transform.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / covid_small_multiples.ipynb
Created Apr 2, 2020
Small-multiples approach to comparing cumulative case trajectories across states
View covid_small_multiples.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.