toggle plot legend

This commit is contained in:
2023-11-30 18:30:11 +01:00
parent 9ff4b485ca
commit e960d2a11f

View File

@@ -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):