Skip to content

Commit

Permalink
Merge pull request #5097 from meeseeksmachine/auto-backport-of-pr-509…
Browse files Browse the repository at this point in the history
…5-on-yt-4.4.x

Backport PR #5095 on branch yt-4.4.x (BUG: fix swap_axes bug wih CellEdgesCallback)
  • Loading branch information
neutrinoceros authored Jan 10, 2025
2 parents 4923a93 + 3acb570 commit 85cddce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yt/visualization/plot_modifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -3407,11 +3407,16 @@ def __call__(self, plot):
extent = self._plot_bounds(plot)
if plot._swap_axes:
im_buffer = im_buffer.transpose((1, 0, 2))
# note: when using imshow, the extent keyword argument has to be the
# swapped extents, so the extent is swapped here (rather than
# calling self._set_plot_limits).
# https://github.com/yt-project/yt/issues/5094
extent = _swap_axes_extents(extent)

plot._axes.imshow(
im_buffer,
origin="lower",
interpolation="bilinear",
extent=extent,
alpha=self.alpha,
)
self._set_plot_limits(plot, extent)

0 comments on commit 85cddce

Please sign in to comment.