From e960d2a11f0581eec291630b22dcfc0b72b09e84 Mon Sep 17 00:00:00 2001 From: Alexander Steppke Date: Thu, 30 Nov 2023 18:30:11 +0100 Subject: [PATCH] toggle plot legend --- src/cristallina/plot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cristallina/plot.py b/src/cristallina/plot.py index 1fd6b1e..ba72218 100644 --- a/src/cristallina/plot.py +++ b/src/cristallina/plot.py @@ -157,7 +157,7 @@ def plot_2d_channel(data: SFDataFiles, channel_name, ax=None): axis_styling(ax, channel_name, description) -def plot_detector_image(image_data, title=None, comment=None, ax=None, rois=None, norms=None, log_colorscale=False, **fig_kw): +def plot_detector_image(image_data, title=None, comment=None, ax=None, rois=None, norms=None, log_colorscale=False, show_legend=True, **fig_kw): """ Plots channel data for a channel that contains an image (2d array) of numeric values per pulse. Optional: @@ -207,8 +207,11 @@ def plot_detector_image(image_data, title=None, comment=None, ax=None, rois=None else: description = f"mean: {mean:.2e},\nstd: {std:.2e}" + if not show_legend: + description="" + axis_styling(ax, title, description) - ax.legend(loc=4) + def plot_image_channel(data: SFDataFiles, channel_name, pulse=0, ax=None, rois=None, norms=None, log_colorscale=False):