Skip to content

Instantly share code, notes, and snippets.

@2n3906
Last active September 17, 2018 20:49
Show Gist options
  • Select an option

  • Save 2n3906/85af5b8919f2a5607f360a2880b5b975 to your computer and use it in GitHub Desktop.

Select an option

Save 2n3906/85af5b8919f2a5607f360a2880b5b975 to your computer and use it in GitHub Desktop.
Better Matplotlib styles
# Store in ~/.matplotlib/stylelib, or install with:
# curl --create-dirs -o ~/.matplotlib/stylelib/scottoplot.mplstyle https://gist.githubusercontent.com/2n3906/85af5b8919f2a5607f360a2880b5b975/raw/scottoplot.mplstyle
# To use, invoke in Python:
# mpl.style.use('scottoplot')
# from http://www.huyng.com/posts/sane-color-scheme-for-matplotlib/
patch.linewidth: 0.5
patch.facecolor: 348ABD # blue
patch.edgecolor: EEEEEE
patch.antialiased: True
font.size: 10.0
font.sans-serif: Source Sans Pro
axes.titlesize: 20.0
axes.titleweight: bold
axes.facecolor: E5E5E5
axes.edgecolor: white
axes.linewidth: 1
axes.grid: True
# axes.titlesize: x-large
axes.labelsize: large
axes.labelcolor: 555555
axes.axisbelow: True # grid/ticks are below elements (e.g., lines, text)
axes.prop_cycle: cycler('color', ['E24A33', '348ABD', '988ED5', '777777', 'FBC15E', '8EBA42', 'FFB5B8'])
# E24A33 : red
# 348ABD : blue
# 988ED5 : purple
# 777777 : gray
# FBC15E : yellow
# 8EBA42 : green
# FFB5B8 : pink
xtick.color: 555555
xtick.direction: out
ytick.color: 555555
ytick.direction: out
grid.color: white
grid.linestyle: - # solid line
figure.facecolor: white
figure.edgecolor: 0.50
figure.figsize: 16, 9
# for simple scaling:
figure.dpi: 100
savefig.dpi: 100
# speed-up
path.simplify: True
path.simplify_threshold: 1.0
agg.path.chunksize: 10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment