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 percentagesleaf_name (
Optional[str]) – name of the leaf to use in the titleoutput_path (
Optional[str]) – path to save the plot, if None, the plot will not be savedshow (
bool) – whether the plot should be shown; if the plot is being saved, the user may not want to display the plotkwargs – 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 providedhas_embolism_lol (
Optional[List[List[float]]]) – list of embolism percentage lists; if this is None, then summary df must be providedleaf_names_list (
Optional[List[str]]) – the list of leaf names for the x-axisoutput_path (
Optional[str]) – path to save the plot, if None, the plot will not be savedshow (
bool) – whether the plot should be shown; if the plot is being saved, the user may not want to display the plotpercent (
bool) – Annotate the bars using percentages; if this is false, counts will be usedkwargs – 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 plotoutput_path_list (
List[str]) – list of file paths to save the plot, if None, the plot will not be savedleaf_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 plotoutput_path (
str) – path to save the plot, if None, the plot will not be savedtiles (
bool) – whether the tiles belonging to the MaskSequence should be usedleaf_names_list (
List[str]) – the list of leaf names for the x-axisleaf_embolism_only (
bool) – whether only leaves with embolisms should be countedpercent (
bool) – Annotate the bars using percentages; if this is false, counts will be used
- Return type
None- Returns
None