Skip to content

Some utilities to create better plots with seaborn

Notifications You must be signed in to change notification settings

maweigert/betterplots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some helper functions for creating decent plots (based on seaborn)

Installation

pip install git+https://github.com/maweigert/betterplots

Install Palatino

mkdir -p ~/.local/share/fonts
wget --directory-prefix ~/.local/share/fonts https://raw.githubusercontent.com/maweigert/betterplots/main/betterplots/fonts/Palatino.ttf
sudo fc-cache -fv
rm -rf ~/.cache/matplotlib

Examples

boxstripplot

Provides a boxplot overlayed with a stripplot:

import matplotlib.pyplot as plt 
import seaborn as sns  
from betterplots import boxstripplot, set_style


set_style() 

df = sns.load_dataset("penguins")


plt.figure()
boxstripplot(data=df, x='species', y='body_mass_g', hue='sex', width=.3)
sns.despine()
plt.legend(loc=(1,.8), frameon=False)
plt.tight_layout()
plt.show()

Image

About

Some utilities to create better plots with seaborn

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages