CCS intergration training running

notebooks
This commit is contained in:
Steffen
2021-03-24 08:03:11 +01:00
parent d3e7bf7efb
commit 6816e423ff
3 changed files with 34 additions and 1 deletions

View File

@ -1,12 +1,38 @@
try:
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib import pyplot as plt
except ImportError: # pragma: no-cover
raise ImportError('You want to use `matplotlib` plugins which are not installed yet,' # pragma: no-cover
raise ImportError('You want to use `matplotlib` which is not installed yet,' # pragma: no-cover
' install it with `pip install matplotlib`.')
from pathlib import Path
def prettyfy_sns():
plt.style.use('default')
try:
import seaborn as sns
except ImportError:
raise ImportError('You want to use `seaborn` which is not installed yet,' # pragma: no-cover
' install it with `pip install seaborn`.')
sns.set_palette('Dark2')
tex_fonts = {
# Use LaTeX to write all text
"text.usetex": True,
"font.family": "serif",
# Use 10pt font in plots, to match 10pt font in document
"axes.labelsize": 10,
"font.size": 10,
# Make the legend/label fonts a little smaller
"legend.fontsize": 8,
"xtick.labelsize": 8,
"ytick.labelsize": 8
}
plt.rcParams.update(tex_fonts)
class Plotter(object):
def __init__(self, root_path=''):