Skip to content

Commit

Permalink
colorbars for fit origin
Browse files Browse the repository at this point in the history
  • Loading branch information
smribet committed Nov 2, 2023
1 parent 3d220b7 commit 54932e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions py4DSTEM/braggvectors/braggvector_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ def show_origin_fit(
vmin=-1 * plot_range,
vmax=1 * plot_range,
intensity_range="absolute",
show_cbar=True,
**kwargs,
)

Expand Down
6 changes: 5 additions & 1 deletion py4DSTEM/visualize/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def show(
theta=None,
title=None,
show_fft=False,
show_cbar=False,
**kwargs
):
"""
Expand Down Expand Up @@ -302,7 +303,8 @@ def show(
does not add a scalebar. If a dict is passed, it is propagated to the add_scalebar function
which will attempt to use it to overlay a scalebar. If True, uses calibraiton or pixelsize/pixelunits
for scalebar. If False, no scalebar is added.
show_fft (Bool): if True, plots 2D-fft of array
show_fft (bool): if True, plots 2D-fft of array
show_cbar (bool) : if True, adds cbar
**kwargs: any keywords accepted by matplotlib's ax.matshow()
Returns:
Expand Down Expand Up @@ -605,6 +607,8 @@ def show(
ax.matshow(
mask_display, cmap=cmap, alpha=mask_alpha, vmin=vmin, vmax=vmax
)
if show_cbar:
fig.colorbar(cax, ax=ax)
# ...or, plot its histogram
else:
hist, bin_edges = np.histogram(
Expand Down

0 comments on commit 54932e9

Please sign in to comment.