Created
November 12, 2020 17:42
-
-
Save joseph-allen/982a5cf1a948c863874195048ebe6731 to your computer and use it in GitHub Desktop.
Branded Seaborn plot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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