Skip to content

Instantly share code, notes, and snippets.

@jcheong0428
Last active September 14, 2018 17:57
Show Gist options
  • Save jcheong0428/13a4ec46459a380cd9f7d80ec45acdd6 to your computer and use it in GitHub Desktop.
Save jcheong0428/13a4ec46459a380cd9f7d80ec45acdd6 to your computer and use it in GitHub Desktop.
Creating illustrator ready matplotlib plots
# This sets the pdf font type so that it imports correctly in Adobe Illustrator.
# Source: http://jonathansoma.com/lede/data-studio/matplotlib/exporting-from-matplotlib-to-open-in-adobe-illustrator/
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
# Generating 2x retina plots
%config InlineBackend.figure_format = 'retina'
# Set base figure size
matplotlib.rc("figure", figsize=(5, 5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment