collaborative helper extended

This commit is contained in:
2024-06-17 17:03:17 +02:00
parent 25b17435f8
commit 2319fa9cbf
4 changed files with 29 additions and 4 deletions

View File

@@ -157,7 +157,8 @@ 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, show_legend=True, **fig_kw):
def plot_detector_image(image_data, title=None, comment=None, ax=None, rois=None, norms=None,
log_colorscale=False, show_legend=True, ax_colormap=matplotlib.colormaps['viridis'], **fig_kw):
"""
Plots channel data for a channel that contains an image (2d array) of numeric values per pulse.
Optional:
@@ -166,6 +167,7 @@ def plot_detector_image(image_data, title=None, comment=None, ax=None, rois=None
- log_colorscale: True for a logarithmic colormap
- title: Title of the plot
- show_legend: True if the legend box should be drawn
- ax_colormap: a matplotlib colormap (viridis by default)
"""
im = image_data
@@ -187,7 +189,8 @@ def plot_detector_image(image_data, title=None, comment=None, ax=None, rois=None
else:
norm = matplotlib.colors.Normalize(vmin=norms[0], vmax=norms[1])
ax.imshow(im, norm=norm)
ax.imshow(im, norm=norm, cmap=ax_colormap)
ax.invert_yaxis()
if rois is not None: