Skip to content

Commit

Permalink
Merge pull request #490 from bsavitzky/dev
Browse files Browse the repository at this point in the history
update get_cmap deprecations
  • Loading branch information
bsavitzky authored Jul 19, 2023
2 parents cf9aaa9 + 41ee4cf commit d0cf049
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion py4DSTEM/process/rdf/amorph.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def plot_strains(strains, cmap="RdBu_r", vmin=None, vmax=None, mask=None):
cmap, vmin, vmax: imshow parameters
mask: real space mask of values not to show (black)
"""
cmap = matplotlib.cm.get_cmap(cmap)
cmap = plt.get_cmap(cmap)
if vmin is None:
vmin = np.min(strains)
if vmax is None:
Expand Down
4 changes: 2 additions & 2 deletions py4DSTEM/process/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def radial_reduction(
def plot(img, title='Image', savePath=None, cmap='inferno', show=True, vmax=None,
figsize=(10, 10), scale=None):
fig, ax = plt.subplots(figsize=figsize)
im = ax.imshow(img, interpolation='nearest', cmap=plt.cm.get_cmap(cmap), vmax=vmax)
im = ax.imshow(img, interpolation='nearest', cmap=plt.get_cmap(cmap), vmax=vmax)
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
plt.colorbar(im, cax=cax)
Expand Down Expand Up @@ -636,7 +636,7 @@ def fourier_resample(
#def plot(img, title='Image', savePath=None, cmap='inferno', show=True, vmax=None,
# figsize=(10, 10), scale=None):
# fig, ax = plt.subplots(figsize=figsize)
# im = ax.imshow(img, interpolation='nearest', cmap=plt.cm.get_cmap(cmap), vmax=vmax)
# im = ax.imshow(img, interpolation='nearest', cmap=plt.get_cmap(cmap), vmax=vmax)
# divider = make_axes_locatable(ax)
# cax = divider.append_axes("right", size="5%", pad=0.05)
# plt.colorbar(im, cax=cax)
Expand Down

0 comments on commit d0cf049

Please sign in to comment.