Plotting (lazuli_exo.plotting)

Note

Requires the [plot] extra. matplotlib is imported lazily inside these functions, so it is never needed at package import time.

Matplotlib plotting for SimulatedSpectrum and LightCurveSet ([plot] extra).

Every function takes an optional ax and returns the Axes it drew on, so plots compose: pass the same ax to overlay scenarios, or pass one Axes of a subplot grid. matplotlib is imported inside the functions, never at module import. The functions do not touch the global style; set plt.style.use(...) yourself if you want one.

lazuli_exo.plotting.wavelength_axis(ax, ticks=(0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.7), margin=1.03)[source]

Log wavelength axis with the Lazuli band ticks and a plain-number formatter.

Call it after plotting: the x-limits are fitted to the lines on the Axes and on any Axes sharing its x axis (times margin each side), which sidesteps matplotlib’s errorbar data limits on a log axis and keeps shared panels on one range.

lazuli_exo.plotting.plot_spectrum(obs, ax=None, seed=0, show_model=True, show_points=True, units='percent', label=None, title=None, **errorbar_kw)[source]

Model spectrum and one noisy realization of the binned observation.

show_model draws the native-resolution model as a line; show_points draws simulate_points(seed) with the per-bin error bars. The legend names the points “simulated (scenario, R=…)” and the line “model (scenario)”; with show_points=False the line is labelled by scenario. label replaces the scenario text in those entries. units is “percent”, “ppm” or “fraction”. **errorbar_kw goes to ax.errorbar; color/c also colours the model line. A title is set on a new figure or an empty Axes unless title is given.

lazuli_exo.plotting.plot_noise(obs, ax=None, units='ppm', label=None, **plot_kw)[source]

Per-bin 1-sigma depth uncertainty against wavelength (log y).

This is obs.depth_err as binned, with n_transits included, so two observations at different R or N compare directly on one Axes.

lazuli_exo.plotting.plot_light_curves(lc, ax=None, offset=None, show_points=True, show_model=True, label=None, title=None)[source]

Light curves of a LightCurveSet, one per band, stacked by offset.

A single band (white light) draws the noisy realization as points and the noiseless model as a line in a second colour, with a legend; label names the set in both entries (useful when overlaying two). Several bands are stacked offset apart (default 1.25 x the largest depth, or the flux range if no depth is positive), points and model in one colour per band, each annotated with its wavelength range at the left edge. A title is set on a new figure or an empty Axes unless title is given.