Skip to content

Commit

Permalink
plotting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gvarnavi committed Dec 16, 2023
1 parent 6982280 commit 5909396
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions py4DSTEM/process/phase/iterative_parallax.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,9 @@ def preprocess(

if plot_average_bf:
figsize = kwargs.pop("figsize", (8, 4))
cmap = kwargs.pop("cmap", "RdBu_r" if self._normalized_stack else "magma")

fig, ax = plt.subplots(1, 2, figsize=figsize)

self._visualize_figax(fig, ax[0], cmap=cmap, **kwargs)
self._visualize_figax(fig, ax[0], **kwargs)

ax[0].set_ylabel("x [A]")
ax[0].set_xlabel("y [A]")
Expand Down Expand Up @@ -823,7 +821,6 @@ def tune_angle_and_defocus(
figsize = kwargs.get(
"figsize", (4 * num_defocus_values, 4 * num_angle_values)
)
cmap = kwargs.pop("cmap", "RdBu_r" if self._normalized_stack else "magma")

fig = plt.figure(figsize=figsize)

Expand All @@ -847,7 +844,6 @@ def tune_angle_and_defocus(
self._visualize_figax(
fig,
ax=object_ax,
cmap=cmap,
**kwargs,
)

Expand Down Expand Up @@ -1047,7 +1043,6 @@ def reconstruct(

figsize = kwargs.pop("figsize", (4 * ncols, 4 * nrows))

cmap = kwargs.pop("cmap", "RdBu_r" if self._normalized_stack else "magma")
fig = plt.figure(figsize=figsize)

xy_center = (self._xy_inds - xp.median(self._xy_inds, axis=0)).astype("float")
Expand Down Expand Up @@ -2904,7 +2899,7 @@ def _visualize_figax(
"""

cmap = kwargs.pop("cmap", "magma")
cmap = kwargs.pop("cmap", "RdBu_r" if self._normalized_stack else "magma")

if upsampled:
cropped_object = self._crop_padded_object(
Expand Down

0 comments on commit 5909396

Please sign in to comment.