Plotting ======== The result objects draw themselves. :meth:`~lazuli_exo.SimulatedSpectrum.plot`, :meth:`~lazuli_exo.SimulatedSpectrum.plot_noise` and :meth:`~lazuli_exo.lightcurve.LightCurveSet.plot` wrap the functions in :mod:`lazuli_exo.plotting`. Each takes an optional ``ax`` and returns the matplotlib Axes it drew on, so plots overlay on one Axes or tile into a subplot grid. They need the ``[plot]`` extra (matplotlib). Every figure on this page is drawn when the documentation is built, from the code shown above it, so the plots match the code that produced them. The functions do not set a matplotlib style. The tutorial notebooks apply one in their preamble; use whatever style you like before calling them. .. plot:: :context: reset :nofigs: import matplotlib.pyplot as plt import lazuli_exo obs = lazuli_exo.observe("WASP-39 b", scenario="clear", n_transits=5, R=100) A spectrum ---------- ``obs.plot()`` draws the native-resolution model as a line and one noisy realization of the binned spectrum as points with error bars. ``seed`` picks the realization; ``units`` is ``"percent"`` (default), ``"ppm"`` or ``"fraction"``. .. plot:: :context: close-figs obs.plot(seed=0) Overlaying scenarios -------------------- Pass the same ``ax`` to several calls. ``show_points=False`` draws only the model lines, and the legend entry is the scenario (or ``label`` if given). A title is set only on a new figure or an empty Axes, so set your own after an overlay. .. plot:: :context: close-figs fig, ax = plt.subplots(figsize=(9, 4.5)) for s in ["clear", "cloudy", "hazy", "high_metallicity"]: lazuli_exo.observe("WASP-39 b", scenario=s).plot(ax=ax, show_points=False, units="ppm") ax.set_title("WASP-39 b: scenario presets, 1 transit") Two observations with points can share an Axes as well; ``label`` names the points and the matching model line (``model (