Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
pylib
shamrock
matplotlib
style.py
1
"""
2
Set the matplotlib style for shamrock (doc and standard plots).
3
"""
4
5
6
def
set_shamrock_mpl_style
():
7
"""
8
Set the matplotlib style for shamrock (doc and standard plots).
9
"""
10
try
:
11
import
matplotlib
as
mpl
# pylint: disable=C0415
12
except
ImportError
as
e:
13
raise
ImportError(
14
"matplotlib is required to use the shamrock matplotlib style. "
15
"Please install it using 'pip install matplotlib'."
16
)
from
e
17
18
mpl.rcParams.update(
19
{
20
"font.family"
:
"serif"
,
21
"mathtext.fontset"
:
"cm"
,
22
"font.size"
: 14,
23
"axes.labelsize"
: 16,
24
"axes.titlesize"
: 16,
25
"xtick.labelsize"
: 13,
26
"ytick.labelsize"
: 13,
27
"legend.fontsize"
: 13,
28
"axes.linewidth"
: 1.0,
29
"xtick.direction"
:
"in"
,
30
"ytick.direction"
:
"in"
,
31
"xtick.top"
:
True
,
32
"ytick.right"
:
True
,
33
"xtick.major.size"
: 8,
34
"ytick.major.size"
: 8,
35
"xtick.minor.visible"
:
True
,
36
"ytick.minor.visible"
:
True
,
37
"legend.frameon"
:
True
,
38
"legend.fancybox"
:
False
,
39
"legend.edgecolor"
:
"black"
,
40
"axes.grid.which"
:
"major"
,
# grid only on major ticks
41
}
42
)
shamrock.matplotlib.style.set_shamrock_mpl_style
set_shamrock_mpl_style()
Definition
style.py:6
Generated on
for Shamrock by
1.15.0