Plotting

src.actions.plots.plot_embolism_profile(embolism_percentages, leaf_name=None, output_path=None, show=True, **kwargs)[source]

Plots an embolism profile. There are two plots. The first shows the VC for the series. The second plot shows the embolism percentage per mask. There is an option to save the plot.

Parameters
  • embolism_percentages (List[float]) – list of embolism percentages

  • leaf_name (Optional[str]) – name of the leaf to use in the title

  • output_path (Optional[str]) – path to save the plot, if None, the plot will not be saved

  • show (bool) – whether the plot should be shown; if the plot is being saved, the user may not want to display the plot

  • kwargs – subplot kwargs

Return type

None

Returns

None

src.actions.plots.plot_embolisms_per_leaf(summary_df=None, has_embolism_lol=None, leaf_names_list=None, output_path=None, show=True, percent=False, **kwargs)[source]

Creates a bar plot showing the number of leaves with and without embolisms for a leaf. The input can either be a summary df, of list of embolism percentage lists.

Parameters
  • summary_df (Optional[DataFrame]) – a summary dataframe created using the code base; if this is None, then has_embolism_lol must be provided

  • has_embolism_lol (Optional[List[List[float]]]) – list of embolism percentage lists; if this is None, then summary df must be provided

  • leaf_names_list (Optional[List[str]]) – the list of leaf names for the x-axis

  • output_path (Optional[str]) – path to save the plot, if None, the plot will not be saved

  • show (bool) – whether the plot should be shown; if the plot is being saved, the user may not want to display the plot

  • percent (bool) – Annotate the bars using percentages; if this is false, counts will be used

  • kwargs – subplot kwargs

Return type

None

Returns

None

src.actions.plots.plot_mseq_profiles(mseqs, show, output_path_list, leaf_name_list)[source]

Plots a sequence of embolism profiles using a list of MaskSequence objects.

Parameters
  • mseqs – list of MaskSequence objects to use

  • show (bool) – whether the plot should be shown; if the plot is being saved, the user may not want to display the plot

  • output_path_list (List[str]) – list of file paths to save the plot, if None, the plot will not be saved

  • leaf_name_list (List[str]) – list of leaf names to use in the title of each plot

Return type

None

Returns

None

src.actions.plots.plot_mseq_embolism_counts(mseqs, show, output_path, tiles, leaf_names_list, leaf_embolism_only=False, percent=False)[source]

Creates a bar plot showing the number of leaves with and without embolisms for a leaf, using a list of MaskSequence objects

Parameters
  • mseqs – list of MaskSequence objects

  • show (bool) – whether the plot should be shown; if the plot is being saved, the user may not want to display the plot

  • output_path (str) – path to save the plot, if None, the plot will not be saved

  • tiles (bool) – whether the tiles belonging to the MaskSequence should be used

  • leaf_names_list (List[str]) – the list of leaf names for the x-axis

  • leaf_embolism_only (bool) – whether only leaves with embolisms should be counted

  • percent (bool) – Annotate the bars using percentages; if this is false, counts will be used

Return type

None

Returns

None