def set_context(context='paper', fscale=1., figsize=(8., 7.)):
"""
Most of this code has been copied/modified from seaborn.rcmod.plotting_context()
::Arguments::
context (str): 'paper', 'notebook', 'talk', or 'poster'
fscale (float): font-size scalar applied to axes ticks, legend, labels, etc.
"""
# scale all the parameters by the same factor depending on the context
scaling = dict(paper=.8, notebook=1, talk=1.3, poster=1.6)[context]
context_dict = {k: v * scaling for k, v in base_context.items()}
# scale default figsize
figX, figY = figsize
context_dict["figure.figsize"] = (figX*scaling, figY*scaling)
# independently scale the fonts
font_dict = {k: v * fscale for k, v in base_font.items()}
font_dict["font.family"] = ["sans-serif"]
font_dict["font.sans-serif"] = ["Helvetica", "Helvetica Neue", "Arial",
"DejaVu Sans", "Liberation Sans", "sans-serif"]
context_dict.update(font_dict)
return context_dict
I don't want to set font every time and aslo want to use jtplot.style . I think jtplot.style should inherit matplotlibrc then apply the style.
Detail in https://github.com/matplotlib/matplotlib/issues/13904 .
style was set
I used to set font by :
Find matplotlib config path :
python -c 'import matplotlib; print(matplotlib.matplotlib_fname())'
add font to that file:
I also tried:
check by :
Error title showed as
Correct one:
set_context overwrite font :
I don't want to set font every time and aslo want to use
jtplot.style
. I thinkjtplot.style
should inheritmatplotlibrc
then apply the style.