bioverse.plots module

bioverse.plots.plot(d, starID=None, order=None, fig=None, canvas=None)
bioverse.plots.plot_universe(d, N_max=100, ax=None, mark=None)
bioverse.plots.plot_system(d, starID, ax=None, mark=None)

Scatter plot for a single system with one or more planets.

Parameters:
  • d (Table) – Table of simulated planets.

  • starID (int) – Unique identifier of this system in the table (d[‘starID’]).

  • ax (Axes, optional) – Matplotlib Axes to plot the figure on. If not given, a new figure is created.

  • mark (int, optional) – Indicates which planet to circle (if any).

bioverse.plots.plot_spectrum(x, y, dy=None, xunit=None, yunit=None, lw=2)

Plots a spectrum with or without errorbars.

bioverse.plots.occurrence_by_class(d, compare=True)

Plots the number of planets per star as a function of size and instellation.

bioverse.plots.plot_binned_average(d, key1, key2, log=True, bins=10, method='mean', match_bin_counts=False, ax=None, return_xy=False, xm=None, ym=None, **kwargs)

Plots the average value of a parameter as a function of another parameter.

Parameters:
  • d (Table) – Table of simulated planets or measurements.

  • key1 (str) – Name of the parameter with which to bin the data set.

  • key2 (str) – Name of the parameter for which to calculate the average value.

  • log (bool, optional) – Whether to bin the data in log-space.

  • bins (int or float array, optional) – Number of bins or list of bin edges.

  • method ({'mean','median'}, optional) – Whether to take the mean or median in each bin.

  • match_bin_counts (bool, optional) – If True, calculate bins with an equal number of planets in each.

  • xm (float array, optional) – X values of a model to be plotted along with the binned data.

  • ym (float array, optional) – Y values of a model to be plotted along with the binned data.

  • **kwargs – Keyword arguments, passed to matplotlib.pyplot.errorbar.

bioverse.plots.Example1_priority(generator, survey, fig=None, ax=None, show=True)

Plots the prioritization of targets according to a_eff and R (or R_eff).

bioverse.plots.Example1_targets(data, fig=None, ax=None, show=True, cbar=True, bins=10, vmin=None, vmax=None, cax=None, smooth_sigma=None)

Plots the distribution of targets in log(a_eff) and R (or R_eff).

bioverse.plots.Example1_dataset(data, a_inner=0.944911182523068, a_outer=1.643989873053573, show=True, plot_model=True)

Plots data[‘has_H2O’] versus data[‘S’] for a simulated data set. Also plots the habitable zone boundaries.

bioverse.plots.Example2_priority(generator, survey, fig=None, ax=None, show=True)
bioverse.plots.Example2_targets(data, fig=None, ax=None, bins=10, show=True)
bioverse.plots.Example2_dataset(data, flife=0.8, thalf=5.0, show=True, plot_model=False)

Plots data[‘has_O2’] versus data[‘age’] for a simulated data set. Also plots f(O2 | life)(t).

bioverse.plots.Example2_model(show=True, t_half=2.3, f_life=0.75)

Plots the distribution of O2/O3-rich planets versus age.

bioverse.plots.compare_posteriors(results_dict, **kwargs)
bioverse.plots.plot_posterior(chains, params=None, bounds=None, log=None, nbins=30, plot_model=True, show=True, fig=None, axes=None, **hist_kwargs)

Plots the posterior distributions of a set of parameters.

Parameters:
  • chains (float array (NxM)) – N samples from the posterior distribution of each of M parameters

  • params (string list, optional) – List of M parameter names in the order that they appear in chains. Use None to designate which parameters to exclude. If not specified, label as theta_0, theta_1, …

  • bounds (float array (Mx2), optional) – Describes each parameter’s min/max values.

  • log (tuple, optional) – Length M tuple of True/False values indicating which posterior distributions should be plotted in log-scale.

  • nbins (int, optional) – Number of bins the posterior distribution plot.

  • plot_model (bool, optional) – If True, overplot a normal distribution with the same mean and variance as the sample.

  • show (bool, optional) – If True, display the plot. Otherwise, return the figure and axes.

  • fig (Figure, optional) – Figure in which to create the plot. axes must also be passed.

  • axes (Axis list, optional) – List of Axis objects in which to create the plots. fig must also be passed.

Returns:

fig, axes – Figure and flattened array of Axes objects containing the plots. Only returned if show if False.

Return type:

Figure, Axes array

bioverse.plots.plot_power_grid(results, axes=('f_water_habitable', 'f_water_nonhabitable'), log=(True, True), labels=None, cbar=True, method='dlnZ', threshold=None, smooth_sigma=None, fig=None, ax=None, show=True, levels=[15, 60, 80], cmap='Greens', zoom_factor=0, **grid_kwargs)
bioverse.plots.plot_requirements_grid(results, axes=('f_water_habitable', 'f_water_nonhabitable'), variable='t_total', log=(True, True), labels=None, var_label=None, levels=None, method='dlnZ', threshold=None, smooth_sigma=None, show=True, min_power=0.8, fmt=' %.0f d ', N_key='N_EEC', vmin=None, vmax=None, fig=None, ax=None, cmap='Greens_r', zoom_factor=0, **grid_kwargs)
bioverse.plots.plot_habitable_zone_accuracy(results, a_inner=0.931, a_outer=1.674, smooth_sigma=None)
bioverse.plots.plot_Example1_constraints(results, fig=None, ax=None, show=True, c='black', lw=1.0, truth=True, **grid_kwargs)
bioverse.plots.plot_Example2_constraints(results, fig=None, ax=None, show=True, c='black', lw=1.0, **grid_kwargs)
bioverse.plots.image_contour_plot(x, y, z, colorbar=True, labels=None, levels=None, fmt=' %.0f ', ticks=4, vmin=None, vmax=None, linecolor='black', log=None, fig=None, ax=None, return_ctr=False, zoom_factor=None, cmap='Greens', plus=False, smooth_sigma=0)

Plots z(x, y) with a colorbar and contours.

bioverse.plots.plot_number_vs_time(results, smooth_sigma=None, exclude=['N_pl', 'N_EEC'], **grid_kwargs)
bioverse.plots.plot_precision_grid(results, param='a_inner', axes=('f_water_habitable', 'f_water_nonhabitable'), labels=None, cbar=True, method='dlnZ', threshold=None, smooth_sigma=None, show=True, half=False, levels=3, log=None, fmt='%.2f AU', **grid_kwargs)
bioverse.plots.plot_precision(results, params=('a_outer', 'a_inner'), axes=('f_water_habitable', 'f_water_nonhabitable'), labels=None, cbar=True, method='dlnZ', threshold=None, smooth_sigma=None, show=True, half=False, levels=([1.0, 3.0], [0.2, 0.6]), log=None, fmt=' %.2f AU ', **grid_kwargs)
bioverse.plots.plot_simulation_result(results, log=True, method='dlnZ', **grid_kwargs)
bioverse.plots.plot_clear_cloudy_spectra(x, y_clr, y_cld, f_clouds=0.75, lw=3, bands=[], c=[], alpha=0.3, legend=True, xlim=None, ymax=None, fig=None, ax=None)