Commit 70e48b9c authored by Philipp Oleynik's avatar Philipp Oleynik
Browse files

Matplotlib compatibility issues resolved

parent becd497b
......@@ -12,23 +12,15 @@ def setup_latex(rcParams, no_fourier=False):
"""
rcParams['text.usetex'] = True
if no_fourier:
rcParams['text.latex.preamble'] = [
r'\usepackage{amsmath}',
r'\usepackage{amssymb}',
r'\usepackage{graphicx}']
rcParams['text.latex.preamble'] = r'\usepackage{amsmath}' + '\n' + r'\usepackage{amssymb}' + '\n' + 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'
rcParams['figure.dpi'] = 120
rcParams['savefig.dpi'] = 300
rcParams['savefig.bbox'] = 'tight'
rcParams['text.hinting_factor'] = 1
rcParams['text.latex.preamble'] = r'\usepackage{amsmath}' + '\n' + r'\usepackage{amssymb}' + '\n' + r'\usepackage{graphicx}' + '\n' + r'\usepackage{fourier}'
rcParams['font.family'] = 'Open Sans'
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):
......@@ -61,8 +53,8 @@ def set_log_axes(axes: plt.Axes, aset=False, aspect=0.36):
:param axes: an Axis object to operate on.
"""
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_xscale("log", nonpositive='clip', subs=[2, 3, 4, 5, 6, 7, 8, 9])
axes.set_yscale("log", nonpositive='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],
......@@ -82,8 +74,8 @@ def set_log_axes_simple(axes: plt.Axes):
:param axes: an Axis object to operate on.
"""
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_xscale("log", nonpositive='clip', subs=[2, 3, 4, 5, 6, 7, 8, 9])
axes.set_yscale("log", nonpositive='clip')
axes.grid(True, which='both', alpha=0.3, zorder=0)
......@@ -93,7 +85,7 @@ def set_time_log_axes_simple(axes: plt.Axes):
:param axes: an Axis object to operate on.
"""
axes.tick_params(direction='in', which='both', zorder=4)
axes.set_yscale("log", nonposy='clip')
axes.set_yscale("log", nonpositive='clip')
axes.grid(True, which='both', alpha=0.3, zorder=0)
......@@ -114,8 +106,8 @@ def set_log_axes_2048(axes: plt.Axes):
:param axes: an Axis object to operate on.
"""
axes.tick_params(direction='in', which='both', zorder=4)
axes.set_xscale("log", nonposx='clip', basex=2.0)
axes.set_yscale("log", nonposy='clip', basey=2.0)
axes.set_xscale("log", nonpositive='clip', basex=2.0)
axes.set_yscale("log", nonpositive='clip', basey=2.0)
axes.grid(True, which='both', alpha=0.3, zorder=0)
axes.set_xticks([1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048], minor=False)
axes.set_yticks([1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048], minor=False)
......@@ -132,8 +124,8 @@ def set_log_axes_bin16(axes: plt.Axes):
:param axes: an Axis object to operate on.
"""
axes.tick_params(direction='in', which='both', zorder=4)
axes.set_xscale("log", nonposx='clip', basex=2.0)
axes.set_yscale("log", nonposy='clip', basey=2.0)
axes.set_xscale("log", nonpositive='clip', basex=2.0)
axes.set_yscale("log", nonpositive='clip', basey=2.0)
axes.grid(True, which='both', alpha=0.3, zorder=0)
axes.set_xticks([1, 2, 4, 8, 16, 32, 64, 128, 256,
512, 1024, 2048, 4096, 8192, 16384, 32768, 65536], minor=False)
......
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