ctaplot styles
ctaplot comes with different styles, based on seaborn-deep
with a couple adjustements. - notebook - slides - paper
On can set ctaplot plot style easily with ctaplot.set_style()
. Or use the context manager.
[1]:
import ctaplot
import matplotlib.pyplot as plt
import matplotlib as mpl
%matplotlib inline
Default matplotlib style
[2]:
mpl.rcParams.update(mpl.rcParamsDefault)
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
ctaplot.plot_effective_area_cta_requirement('north')
ctaplot.plot_effective_area_cta_requirement('south')
plt.show()
notebook style
larger figures
no LaTeX distribution required (faster to plot)
[3]:
ctaplot.set_style('notebook')
[4]:
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
ctaplot.plot_effective_area_cta_requirement('north')
ctaplot.plot_effective_area_cta_requirement('south')
plt.show()
Slides style
larger figures
LaTeX distribution used if available (longer to plot)
[5]:
mpl.rcParams.update(mpl.rcParamsDefault)
ctaplot.set_style('slides')
[6]:
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
ctaplot.plot_effective_area_cta_requirement('north')
ctaplot.plot_effective_area_cta_requirement('south')
plt.show()
Paper style
LaTeX distribution used if available (longer to plot)
plots with a width equal to one column in two-columns articles
[7]:
mpl.rcParams.update(mpl.rcParamsDefault)
ctaplot.set_style('paper')
[8]:
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
ctaplot.plot_effective_area_cta_requirement('north')
ctaplot.plot_effective_area_cta_requirement('south')
plt.show()
Context management
You can also use the context manager to change the style temporarily.
[9]:
# Let's reset the style to the default one first
import matplotlib as mpl
mpl.rcParams.update(mpl.rcParamsDefault)
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
plt.show()
[10]:
with ctaplot.plots.style.context('notebook'):
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
plt.show()
[11]:
with ctaplot.plots.style.context('slides'):
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
plt.show()
[12]:
with ctaplot.plots.style.context('paper'):
ctaplot.plot_effective_area_cta_performance('north')
ctaplot.plot_effective_area_cta_performance('south')
plt.show()
[ ]: