Home / Matplotlib / Matplotlib
Configuration
Stored in ~/.matplotlib/matplotlibrc
1
# Export with transparent background.
savefig.transparent: True
# Use LaTeX by default.
text.usetex: True
# Fix spindly LaTeX font and add support for Physics awesomness.
text.latex.preamble: \usepackage{mlmodern} \usepackage{physics}
# Set colors.
<<matplotlib-style()>>
where <<matplotlib-style>>
is
source ~/.venv/bin/activate
STYLE=$(find ${VIRTUAL_ENV} -name dark_background.mplstyle | head)
cat ${STYLE} | grep :
lines.color: white patch.edgecolor: white text.color: white axes.facecolor: black axes.edgecolor: white axes.labelcolor: white axes.prop_cycle: cycler('color', ['8dd3c7', 'feffb3', 'bfbbd9', 'fa8174', '81b1d2', 'fdb462', 'b3de69', 'bc82bd', 'ccebc4', 'ffed6f']) xtick.color: white ytick.color: white grid.color: white figure.facecolor: black figure.edgecolor: black boxplot.boxprops.color: white boxplot.capprops.color: white boxplot.flierprops.color: white boxplot.flierprops.markeredgecolor: white boxplot.whiskerprops.color: white
Footnotes:
1
~/.config/matplotlib/
is not searched on MacOS; the file must be in:
import matplotlib as mpl
mpl.get_configdir()
/Users/rudy/.matplotlib