Skip to content

Instantly share code, notes, and snippets.

@flxai
Last active January 3, 2022 20:59
Show Gist options
  • Save flxai/ccb46e725272943d62325a2e8a1fae4c to your computer and use it in GitHub Desktop.
Save flxai/ccb46e725272943d62325a2e8a1fae4c to your computer and use it in GitHub Desktop.
Gruvbox style variant for matplotlib

Download & installation

Download the gruvbox-colored.mplstyle to the according directory:

$ url="https://gist.githubusercontent.com/flxai/ccb46e725272943d62325a2e8a1fae4c/raw/81c54b723cd69a5f82e673a2f2df6ddc5ac5dc5e/gruvbox-colored.mplstyle"
$ mkdir -p ~/.config/matplotlib/stylelib
$ curl "$url" -o ~/.config/matplotlib/stylelib/gruvbox-colored.mplstyle

Usage

To later use the matplotlib style, activate it within a Python session using:

import pylab
plt.style.use('gruvbox-colored')

To use it within every IPython session (like a Jupyter notebook), place it within a file in the startup directory, e.g. ~/.ipython/profile_default/startup/90-matplotlib.

# Gruvbox colors
# dark0 : #282828;
# dark0_hard : #1d2021;
# dark0_soft : #32302f;
# dark1 : #3c3836;
# dark2 : #504945;
# dark3 : #665c54;
# dark4 : #7c6f64;
# light0 : #fbf1c7;
# light0_hard : #f9f5d7;
# light0_soft : #f2e5bc;
# light1 : #ebdbb2;
# light2 : #d5c4a1;
# light3 : #bdae93;
# light4 : #a89984;
# gray : #928374;
# red : #cc241d;
# light-red : #fb4934;
# faded-red : #9d0006;
# green : #98971a;
# light-green : #b8bb26;
# faded-green : #79740e;
# yellow : #d79921;
# light-yellow : #fabd2f;
# faded-yellow : #b57614;
# blue : #458588;
# light-blue : #83a598;
# faded-blue : #076678;
# purple : #b16286;
# light-purple : #d3869b;
# faded-purple : #8f3f71;
# aqua : #689d6a;
# light-aqua : #8ec07c;
# faded-aqua : #427b58;
# orange : #d65d0e;
# light-orange : #fe8019;
# faded-orange : #af3a03;
# blue, orange, green, red, purple, brown, pink, gray, light-green, aqua
axes.prop_cycle: cycler('color', ['458588', 'd65d0e', '98971a', 'cc241d', 'b16286', 'af3a03', 'd3869b', '928374', 'b8bb26', '689d6a'])
figure.facecolor: 282828
figure.figsize: 25.0, 8.0
text.color: F2E5BC
axes.labelcolor: F2E5BC
legend.frameon: False
legend.numpoints: 1
legend.scatterpoints: 1
xtick.direction: out
ytick.direction: out
xtick.color: F2E5BC
ytick.color: F2E5BC
#image.cmap: Greys
image.cmap: viridis
font.family: sans-serif
font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
font.size: 16
grid.linestyle: -
lines.solid_capstyle: round
axes.axisbelow: True
axes.grid: True
axes.facecolor: 3C3836
axes.edgecolor: white
axes.linewidth: 0
grid.color: 504945
xtick.major.size: 0
ytick.major.size: 0
xtick.minor.size: 0
ytick.minor.size: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment