metawards.analysis.create_average_plot

metawards.analysis.create_average_plot(df, output_dir: Optional[str] = None, format: str = 'jpg', dpi: int = 150, align_axes: bool = True, verbose: bool = True)[source]

Create an average plot of the result.csv data held in the passed pandas dataframe. This returns the figure for you to save if desired (or just call plt.show() to show it in Jupyter)

Note that this won’t do anything unless there are multiple repeats of the model run in the output. In that case, it will return None

If the dataframe contains multiple fingerprints, then this will return a dictionary of figures, one for each fingerprint, indexed by fingerprint

Parameters
  • df (Pandas Dataframe) – The pandas dataframe containing the data from results.csv.bz2

  • output_dir (str) – The name of the directory in which to draw the graphs. If this is set then the graphs are written to files as they are generated and the filenames of the figures are returned. This is necessary when the number of graphs to draw is high and you don’t want to waste too much memory

  • format (str) – Format to save the figures in if output_dir is supplied

  • dpi (int) – dpi (dots per inch) resolution to save the figures with if a bitmap format is used and output_dir is supplied

  • align_axes (bool) – If true (default) then this will ensure that all of the plots for different fingerprints are put on the same axis scale

  • verbose (bool) – Whether or not to print progress to the screen

Returns

The matplotlib figure containing the average plot, or a dictionary of figures if there are multiple fingerprints, or the filename if output_dir was supplied, or a dictionary of multiple filenames indexed by fingerprint

Return type

fig