Commit 0b4444a7 authored by Philipp Oleynik's avatar Philipp Oleynik
Browse files

Latex setup functions added.

Default Figure FONT HAS CHANGED.
parent 5b197384
......@@ -3,37 +3,65 @@
import matplotlib.patches as pt
def setup_latex(rcParams):
rcParams['text.usetex'] = True
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'
rcParams['figure.dpi'] = 120
rcParams['savefig.dpi'] = 300
rcParams['savefig.bbox'] = 'tight'
rcParams['text.hinting_factor'] = 1
def setup_plotstyle(rcParams):
rcParams['grid.alpha'] = 0.3
rcParams['legend.framealpha'] = 1.0
rcParams['xtick.direction'] = 'in'
rcParams['ytick.direction'] = 'in'
rcParams['axes.labelsize'] = 14
def plotsave_transparent(rcParams, transparency = True):
rcParams['savefig.transparent'] = transparency
def set_log_axes_noaspect(axes):
axes.tick_params(direction='in', which='both', zorder=4)
axes.set_xscale("log", nonposx='clip', subsx=[2, 3, 4, 5, 6, 7, 8, 9])
axes.set_yscale("log", nonposy='clip')
axes.tick_params(direction = 'in', which = 'both', zorder = 4)
axes.set_xscale("log", nonposx = 'clip', subsx = [2, 3, 4, 5, 6, 7, 8, 9])
axes.set_yscale("log", nonposy = 'clip')
axes.set_xticks([0.01, 0.03, 0.1, 0.3, 1, 3,
10, 30, 50, 100, 300, 1000, 3000,
10000, 30000, 100000, 300000, 1000000],
minor=False)
minor = False)
axes.set_xticklabels([r'0.01', r'0.03', r'0.1', r'0.3', r'1',
r'3', r'10', r'30', r'50', r'100', r'300', r'1000', r'3G',
r'10G', r'30G', r'100G', r'300G', r'1T'],
minor=False)
axes.grid(True, which='both', alpha=0.3, zorder=0)
minor = False)
axes.grid(True, which = 'both', alpha = 0.3, zorder = 0)
def set_log_axes_simple(axes):
axes.tick_params(direction='in', which='both', zorder=4)
axes.set_xscale("log", nonposx='clip', subsx=[2, 3, 4, 5, 6, 7, 8, 9])
axes.set_yscale("log", nonposy='clip')
axes.grid(True, which='both', alpha=0.3, zorder=0)
axes.tick_params(direction = 'in', which = 'both', zorder = 4)
axes.set_xscale("log", nonposx = 'clip', subsx = [2, 3, 4, 5, 6, 7, 8, 9])
axes.set_yscale("log", nonposy = 'clip')
axes.grid(True, which = 'both', alpha = 0.3, zorder = 0)
def set_log_axes(axes):
set_log_axes_noaspect(axes)
axes.set_aspect(0.56, adjustable='box')
axes.set_aspect(0.56, adjustable = 'box')
def draw_bar_text(axis, begin, end, ypos, text='text', height=10, color='bisque', xposcorr=0.0):
def draw_bar_text(axis, begin, end, ypos, text = 'text', height = 10, color = 'bisque', xposcorr = 0.0):
rect = pt.Rectangle((begin, ypos), end - begin,
height, alpha=1, ec='k', fc=color, zorder=0)
height, alpha = 1, ec = 'k', fc = color, zorder = 0)
axis.add_artist(rect)
axis.text(begin + xposcorr + (end - begin) / 2.0, ypos + height / 2, text,
fontsize=12, ha='center', va='center_baseline',
alpha=1, zorder=1)
fontsize = 12, ha = 'center', va = 'center_baseline',
alpha = 1, zorder = 1)
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