fitbenchmarking.results_processing.plots module

Higher level functions that are used for plotting the fit plot and a starting guess plot.

class fitbenchmarking.results_processing.plots.Plot(best_result, options, figures_dir)

Bases: object

Class providing plotting functionality.

static best_filename(result)

Returns the filename of the best fit plot.

Parameters:

result (FittingResult) – The result to plot

Returns:

path to the saved file

Return type:

str

best_fit_line = {'color': '#6699ff', 'dash': 'dot'}
data_marker = {'color': 'black', 'symbol': 'x'}
legend_options = {'bgcolor': 'rgba(0,0,0,0.1)', 'x': 0.01, 'xanchor': 'left', 'y': 0.99, 'yanchor': 'top'}
plot_initial_guess(df)

Plots the initial guess along with the data and stores in a file

Parameters:

df (Pandas dataframe) – A dataframe holding the data

Returns:

path to the saved file

Return type:

str

plot_posteriors(result)

Use Plotly to plot estimated posterior pdfs.

Parameters:

result (FittingResult) – The result to plot

Returns:

path to the saved file

Return type:

str

classmethod plot_summary(categories, title, options, figures_dir)

Create a comparison plot showing all fits from the results with the best for each category highlighted.

Parameters:
  • categories (dict[str, list[FittingResults]]) – The results to plot sorted into colour groups

  • title (str) – A title for the graph

  • options (utils.options.Options) – The options for the run

  • figures_dir (str) – The directory to save the figures in

Returns:

The path to the new plot

Return type:

str

plotly_fit(df)

Uses plotly to plot the calculated fit, along with the best fit. Stores the plot in a file

Parameters:

df (Pandas dataframe) – A dataframe holding the data

Returns:

A dictionary of paths to the saved files

Return type:

dict[str, str]

summary_best_plot_line = {'width': 2}
summary_plot_line = {'width': 1}

Writes an html file for the figure passed as input and includes link to the relevant plotly.js file.

Parameters:
  • fig (plotly.graph_objs._figure.Figure) – Figure to be saved

  • figures_dir (str) – The directory to save the figures in

  • htmlfile (str) – Name of the figure

  • options (utils.options.Options) – The options for the run

Returns:

None