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()
../_images/notebooks_style_3_0.png

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()
../_images/notebooks_style_6_0.png

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()
../_images/notebooks_style_9_0.png

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()
../_images/notebooks_style_12_0.png

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()
../_images/notebooks_style_14_0.png
[10]:
with ctaplot.plots.style.context('notebook'):
    ctaplot.plot_effective_area_cta_performance('north')
    ctaplot.plot_effective_area_cta_performance('south')
plt.show()
../_images/notebooks_style_15_0.png
[11]:
with ctaplot.plots.style.context('slides'):
    ctaplot.plot_effective_area_cta_performance('north')
    ctaplot.plot_effective_area_cta_performance('south')
plt.show()
../_images/notebooks_style_16_0.png
[12]:
with ctaplot.plots.style.context('paper'):
    ctaplot.plot_effective_area_cta_performance('north')
    ctaplot.plot_effective_area_cta_performance('south')
plt.show()
../_images/notebooks_style_17_0.png
[ ]: