mpl
This commit is contained in:
parent
31eeb53dea
commit
9e77fc8f03
8 changed files with 57 additions and 40 deletions
|
@ -25,3 +25,26 @@ class OptimizeResult(dict):
|
|||
|
||||
def __dir__(self):
|
||||
return list(self.keys())
|
||||
|
||||
|
||||
|
||||
|
||||
def is_latex_installed():
|
||||
import shutil
|
||||
return shutil.which("latex") is not None or shutil.which("pdflatex") is not None
|
||||
|
||||
def setup_matplotlib():
|
||||
"""
|
||||
Configure matplotlib with LaTeX text rendering and custom font sizes.
|
||||
|
||||
"""
|
||||
import matplotlib.pyplot as plt
|
||||
plt.rc('text', usetex=is_latex_installed())
|
||||
plt.rcParams.update({
|
||||
'figure.dpi': 300,
|
||||
'figure.figsize': (10, 6),
|
||||
'axes.labelsize': 26,
|
||||
'xtick.labelsize': 32,
|
||||
'ytick.labelsize': 32,
|
||||
'legend.fontsize': 23,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue