"""Shared publication style. Figure dimensions are final printed inches.""" import os from pathlib import Path import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt DIRECT = '#356a98' CASCADED = '#b74445' EDM = '#777777' TRUTH = '#222222' INK = '#222222' COLORS = {'Direct SI': DIRECT, 'Cascaded SI': CASCADED, 'EDM': EDM, 'Truth': TRUTH} plt.rcParams.update({ 'font.family': 'serif', 'font.serif': ['STIXGeneral'], 'mathtext.fontset': 'stix', 'font.size': 8, 'axes.labelsize': 8, 'axes.titlesize': 8.5, 'xtick.labelsize': 7, 'ytick.labelsize': 7, 'axes.linewidth': .6, 'lines.linewidth': 1.2, 'pdf.fonttype': 42, 'ps.fonttype': 42, 'savefig.facecolor': 'white', }) def save(fig, path): fig.savefig(path.with_suffix('.pdf'), dpi=400) fig.savefig(path.with_suffix('.png'), dpi=240) plt.close(fig)