Commit 76b39700 authored by Philipp Oleynik's avatar Philipp Oleynik
Browse files

Fourier package workaround added.

parent 19454532
......@@ -3,13 +3,24 @@
import matplotlib.patches as pt
def setup_latex(rcParams):
def setup_latex(rcParams, noFourier = False):
"""
Sets LaTeX environment for better text formatting on plots.
:param rcParams: rcParams imported locally from matplotlib
:param noFourier: True if there is no fourier package in your LaTeX distribution and it is impossible to install it (e.g. on Dione)
"""
rcParams['text.usetex'] = True
rcParams['text.latex.preamble'] = [
r'\usepackage{amsmath}',
r'\usepackage{amssymb}',
r'\usepackage{graphicx}',
r'\usepackage{fourier}']
if noFourier:
rcParams['text.latex.preamble'] = [
r'\usepackage{amsmath}',
r'\usepackage{amssymb}',
r'\usepackage{graphicx}']
else:
rcParams['text.latex.preamble'] = [
r'\usepackage{amsmath}',
r'\usepackage{amssymb}',
r'\usepackage{graphicx}',
r'\usepackage{fourier}']
rcParams['font.family'] = 'Open Sans'
# rcParams['font.serif'] = 'DejaVu Math TeX Gyre'
rcParams['font.serif'] = 'TeX Gyre Bonum Math'
......@@ -20,6 +31,10 @@ def setup_latex(rcParams):
def setup_plotstyle(rcParams):
"""
Sets various defaults for nice and sustainable style of plots
:param rcParams:
"""
rcParams['grid.alpha'] = 0.3
rcParams['legend.framealpha'] = 1.0
rcParams['xtick.direction'] = 'in'
......@@ -53,11 +68,13 @@ def set_log_axes_simple(axes):
axes.set_yscale("log", nonposy = 'clip')
axes.grid(True, which = 'both', alpha = 0.3, zorder = 0)
def set_time_log_axes_simple(axes):
axes.tick_params(direction = 'in', which = 'both', zorder = 4)
axes.set_yscale("log", nonposy = 'clip')
axes.grid(True, which = 'both', alpha = 0.3, zorder = 0)
def set_lin_axes_simple(axes):
axes.tick_params(direction = 'in', which = 'both', zorder = 4)
axes.set_yscale("linear")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment