redback.plotting.LuminosityOpticalPlotter

class redback.plotting.LuminosityOpticalPlotter(transient: Transient | None, **kwargs)[source]

Bases: IntegratedFluxPlotter

__init__(transient: Transient | None, **kwargs) None
Parameters:
  • transient – An instance of redback.transient.Transient. Contains the data to be plotted.

  • kwargs – Additional kwargs the plotter uses. ——-

Keyword Arguments:
  • capsize – Same as matplotlib capsize.

  • bands_to_plot – List of bands to plot in plot lightcurve and multiband lightcurve. Default is active bands.

  • legend_location – Same as matplotlib legend location.

  • legend_cols – Same as matplotlib legend columns.

  • color – Color of the data points.

  • band_colors – A dictionary with the colors of the bands.

  • band_labels – List with the names of the bands.

  • band_scaling – Dict with the scaling for each band. First entry should be {type: ‘+’ or ‘x’} for different types.

  • dpi – Same as matplotlib dpi.

  • elinewidth – same as matplotlib elinewidth

  • errorbar_fmt – ‘fmt’ argument of ax.errorbar.

  • model – str or callable, the model to plot.

  • ms – Same as matplotlib markersize.

  • axis_tick_params_padpad argument in calls to ax.tick_params when setting the axes.

  • max_likelihood_alphaalpha argument, i.e. transparency, when plotting the max likelihood curve.

  • random_sample_alphaalpha argument, i.e. transparency, when plotting random sample curves.

  • uncertainty_band_alphaalpha argument, i.e. transparency, when plotting a credible band.

  • max_likelihood_color – Color of the maximum likelihood curve.

  • random_sample_color – Color of the random sample curves.

  • bbox_inches – Setting for saving plots. Default is ‘tight’.

  • linewidth – Same as matplotlib linewidth

  • zorder – Same as matplotlib zorder

  • xy – For `ax.annotate’ x and y coordinates of the point to annotate.

  • xycoords – The coordinate system xy is given in. Default is ‘axes fraction’

  • horizontalalignment – Horizontal alignment of the annotation. Default is ‘right’

  • annotation_sizesize argument of of ax.annotate.

  • fontsize_axes – Font size of the x and y labels.

  • fontsize_legend – Font size of the legend.

  • fontsize_figure – Font size of the figure. Relevant for multiband plots. Used on supxlabel and supylabel.

  • fontsize_ticks – Font size of the axis ticks.

  • hspace – Argument for subplots_adjust, sets horizontal spacing between panels.

  • wspace – Argument for subplots_adjust, sets horizontal spacing between panels.

  • plot_others – Whether to plot additional bands in the data plot, all in the same colors

  • random_models – Number of random draws to use to calculate credible bands or to plot.

  • uncertainty_mode – ‘random_models’: Plot random draws from the available parameter sets. ‘credible_intervals’: Plot a credible interval that is calculated based on the available parameter sets.

  • reference_mjd_date – Date to use as reference point for the x axis. Default is the first date in the data.

  • credible_interval_level – 0.9: Plot the 90% credible interval.

  • plot_max_likelihood – Plots the draw corresponding to the maximum likelihood. Default is ‘True’.

  • set_same_color_per_subplot – Sets the lightcurve to be the same color as the data per subplot. Default is ‘True’.

  • xlim_high_multiplier – Adjust the maximum xlim based on available x values.

  • xlim_low_multiplier – Adjust the minimum xlim based on available x values.

  • ylim_high_multiplier – Adjust the maximum ylim based on available x values.

  • ylim_low_multiplier – Adjust the minimum ylim based on available x values.

  • show_grid – Whether to show grid lines. Default is False.

  • grid_alpha – Transparency of grid lines. Default is 0.3.

  • grid_color – Color of grid lines. Default is ‘gray’.

  • grid_linestyle – Line style of grid lines. Default is ‘–‘.

  • grid_linewidth – Line width of grid lines. Default is 0.5.

  • save_format – Format for saving plots (e.g., ‘png’, ‘pdf’, ‘svg’, ‘eps’). Default is ‘png’.

  • transparent – Whether to save plots with transparent background. Default is False.

  • xscale – X-axis scale (‘linear’, ‘log’, ‘symlog’, ‘logit’). Default is None (auto-determined).

  • yscale – Y-axis scale (‘linear’, ‘log’, ‘symlog’, ‘logit’). Default is None (auto-determined).

  • title – Title for the plot. Default is None (no title).

  • title_fontsize – Font size for the title. Default is 20.

  • linestyle – Line style for model curves. Default is ‘-‘.

  • max_likelihood_linestyle – Line style for max likelihood curve. Default is ‘-‘.

  • random_sample_linestyle – Line style for random sample curves. Default is ‘-‘.

  • markerfillstyle – Fill style for markers (‘full’, ‘left’, ‘right’, ‘bottom’, ‘top’, ‘none’). Default is ‘full’.

  • markeredgecolor – Edge color for markers. Default is None (same as face color).

  • markeredgewidth – Edge width for markers. Default is 1.0.

  • legend_frameon – Whether to draw a frame around the legend. Default is True.

  • legend_shadow – Whether to draw a shadow behind the legend. Default is False.

  • legend_fancybox – Whether to use rounded corners for legend frame. Default is True.

  • legend_framealpha – Transparency of legend frame. Default is 0.8.

  • tick_direction – Direction of tick marks (‘in’, ‘out’, ‘inout’). Default is ‘in’.

  • tick_length – Length of tick marks. Default is None (matplotlib default).

  • tick_width – Width of tick marks. Default is None (matplotlib default).

  • show_spines – Whether to show plot spines (borders). Default is True.

  • spine_linewidth – Width of plot spines. Default is None (matplotlib default).

__call__(**kwargs)

Call self as a function.

Methods

__init__(transient, **kwargs)

get_filename(default)

plot_data([axes, save, show])

Plots the Integrated flux data and returns Axes.

plot_lightcurve([axes, save, show])

Plots the Integrated flux data and the lightcurve and returns Axes.

plot_residuals([axes, save, show])

Plots the residual of the Integrated flux data returns Axes.

Attributes

keyword_docstring

plot_data(axes: Axes = None, save: bool = True, show: bool = True) Axes

Plots the Integrated flux data and returns Axes.

Parameters:
  • axes (Union[matplotlib.axes.Axes, None], optional) – Matplotlib axes to plot the data into. Useful for user specific modifications to the plot.

  • save (bool) – Whether to save the plot. (Default value = True)

  • show (bool) – Whether to show the plot. (Default value = True)

Returns:

The axes with the plot.

Return type:

matplotlib.axes.Axes

plot_lightcurve(axes: Axes = None, save: bool = True, show: bool = True) Axes

Plots the Integrated flux data and the lightcurve and returns Axes.

Parameters:
  • axes (Union[matplotlib.axes.Axes, None], optional) – Matplotlib axes to plot the lightcurve into. Useful for user specific modifications to the plot.

  • save (bool) – Whether to save the plot. (Default value = True)

  • show (bool) – Whether to show the plot. (Default value = True)

Returns:

The axes with the plot.

Return type:

matplotlib.axes.Axes

plot_residuals(axes: Axes = None, save: bool = True, show: bool = True) Axes

Plots the residual of the Integrated flux data returns Axes.

Parameters:
  • axes – Matplotlib axes to plot the lightcurve into. Useful for user specific modifications to the plot.

  • save – Whether to save the plot. (Default value = True)

  • show – Whether to show the plot. (Default value = True)

Returns:

The axes with the plot.

Return type:

matplotlib.axes.Axes