Skip to content

Instantly share code, notes, and snippets.

@joseph-allen
Created November 12, 2020 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseph-allen/982a5cf1a948c863874195048ebe6731 to your computer and use it in GitHub Desktop.
Save joseph-allen/982a5cf1a948c863874195048ebe6731 to your computer and use it in GitHub Desktop.
Branded Seaborn plot
# import packages
import matplotlib as plt
import seaborn as sns
import pandas as pd
# set seaborn style
sns.set(rc={'figure.figsize':(12,8)})
sns.set(font_scale=1.5)
# create UKDS color palette
colors = ['#E03A6C', '#F5AD42', '#ECE64B', '#449858', '#43A6C6', '#6C2B76']
# use n_colors to allow the colors to cycle
palette = sns.set_palette(sns.color_palette(colors), n_colors=100)
# read in data
df = pd.read_csv('data.csv')
# Plot one column
ax1 = sns.barplot(x="Tool", y="Government Staff", data=df_noTotals, color=palette)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment