-
-
Save mfouesneau/c6d27990ba57dabcd9fd to your computer and use it in GitHub Desktop.
ezrc mpl rc update quickly
This file contains 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
def ezrc(fontSize=22., lineWidth=2., labelSize=None, tickmajorsize=10, | |
tickminorsize=5, figsize=(8, 6)): | |
""" | |
Define params to make pretty fig for slides and papers | |
""" | |
from pylab import rc, rcParams | |
if labelSize is None: | |
labelSize = fontSize + 5 | |
rc('figure', figsize=figsize) | |
rc('lines', linewidth=lineWidth) | |
rcParams['grid.linewidth'] = lineWidth | |
rcParams['font.sans-serif'] = ['Helvetica'] | |
rcParams['font.serif'] = ['Helvetica'] | |
rcParams['font.family'] = ['Times New Roman'] | |
rc('font', size=fontSize, family='serif', weight='bold') | |
rc('axes', linewidth=lineWidth, labelsize=labelSize) | |
rc('legend', borderpad=0.1, markerscale=1., fancybox=False) | |
rc('text', usetex=True) | |
rc('image', aspect='auto') | |
rc('ps', useafm=True, fonttype=3) | |
rcParams['xtick.major.size'] = tickmajorsize | |
rcParams['xtick.minor.size'] = tickminorsize | |
rcParams['ytick.major.size'] = tickmajorsize | |
rcParams['ytick.minor.size'] = tickminorsize | |
rcParams['text.latex.preamble'] = ["\\usepackage{amsmath}"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I assume you would use it thusly:
Is there a way to change the rcParams and then force figures to update? So then you could do: