forked from solveignaess/fourspheremodel
-
Notifications
You must be signed in to change notification settings - Fork 4
/
plotting_convention.py
41 lines (33 loc) · 1.09 KB
/
plotting_convention.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pylab as plt
from matplotlib.colors import LogNorm
# plt.rcParams.update({
# 'xtick.labelsize': 11,
# 'xtick.major.size': 5,
# 'ytick.labelsize': 11,
# 'ytick.major.size': 5,
# 'font.size': 15,
# 'axes.labelsize': 15,
# 'axes.titlesize': 15,
# 'legend.fontsize': 14,
# 'figure.subplot.wspace': 0.4,
# 'figure.subplot.hspace': 0.4,
# 'figure.subplot.left': 0.1,
# })
def mark_subplots(axes, letters='ABCDEFGHIJKLMNOPQRSTUVWXYZ', xpos=-0.12, ypos=1.15):
if not type(axes) is list:
axes = [axes]
for idx, ax in enumerate(axes):
ax.text(xpos, ypos, letters[idx].capitalize(),
horizontalalignment='center',
verticalalignment='center',
fontweight='demibold',
fontsize=12,
transform=ax.transAxes)
def simplify_axes(axes):
if not type(axes) is list:
axes = [axes]
for ax in axes:
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.get_xaxis().tick_bottom()
ax.get_yaxis().tick_left()