threeML.io.plotting.data_residual_plot module

class threeML.io.plotting.data_residual_plot.ResidualPlot(**kwargs)[source]

Bases: object

add_data(x, y, residuals, label, xerr=None, yerr=None, residual_yerr=None, show_data=True, **kwargs)[source]

Add the data for the this model

Parameters:
  • x – energy of the data

  • y – value of the data

  • residuals – the residuals for the data

  • label – label of the data

  • xerr – the error in energy (or bin width)

  • yerr – the errorbars of the data

  • **kwargs

    any kwargs passed to plot

Returns:

add_model(x, y, label, **kwargs)[source]

Add a model and interpolate it across the energy span for the plotting.

Parameters:
  • x – the evaluation energies

  • y – the model values

  • label – the label of the model

  • **kwargs

    any kwargs passed to plot

Returns:

None

add_model_step(xmin, xmax, xwidth, y, label, **kwargs)[source]

Add a model but use discontinuous steps for the plotting.

Parameters:
  • xmin – the low end boundaries

  • xmax – the high end boundaries

  • xwidth – the width of the bins

  • y – the height of the bins

  • label – the label of the model

  • **kwargs

    any kwargs passed to plot

Returns:

None

property axes
property data_axis: Axes

the top or data axis

Type:

return

property figure: Figure

the figure instance

Type:

return

finalize(xlabel='x', ylabel='y', xscale='log', yscale='log', show_legend=True, invert_y=False)[source]
Parameters:
  • xlabel

  • ylabel

  • xscale

  • yscale

  • show_legend

Returns:

property ratio_residuals
property residual_axis: Axes

the bottom or residual axis

Type:

return

property show_residuals: bool