Plotting

class plot_data.MakePlot(Data_Object, Model_Object, Fit_Object)

Generates the interactive Matplotlib plot

Takes the input data, model, and fit to plot them in an interactive way, where you can mask points and change the fit in real-time

Parameters
  • Data_Object (object) – Generated from the Data class in data_model.py

  • Model_Object (object) – Generated from the Model class in data_model.py

  • Fit_Object (object) – Generated from the Fit class in data_model.py

plot_data()

Plots the data and the model onto the figure

Draws the plot, making sure to clear the axis beforehand and then re-draws with any updates to the data

setup_plot()

Sets the framework for the matplotlib plot

Creates the figure, axis, and defines any interaction on the plot, including clicks and sliders

update_fit()

Updates the Fit class with a new fit, then runs plot_data()

This function should be called after any changes to the data or model to reflect those changes on the plot

update_mask()

Updates the mask by removing or adding the point closest to where the user clicked

The nearest point is computed using euclidian distance, scaled to the length of the axis. The point will not update if it would cause there to be too few points to fit