Path: blob/master/notebook_format/formats.py
1470 views
import json1import warnings2import matplotlib3from IPython.core.display import HTML456def load_style(css_style = 'custom1.css', plot_style = True):7"""8custom1.css adapted from9https://github.com/rlabbe/ThinkBayes/blob/master/code/custom.css1011custom2.css adapted from12https://github.com/neilpanchal/iPython-Notebook-Theme13"""1415# recent matplotlibs are raising deprecation warnings that16# we don't worry about (it's the axes_prop_cycle).17warnings.filterwarnings('ignore')1819# update the default matplotlib's formating20if plot_style:21with open('plot.json') as f:22s = json.load(f)2324matplotlib.rcParams.update(s)2526# load the styles for the notebooks27with open(css_style) as f:28styles = f.read()2930return HTML(styles)313233