Skip to content

Commit

Permalink
fix swap_axes bug wih CellEdgesCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishavlin committed Jan 9, 2025
1 parent 9e483ce commit 39b3ad0
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 @@ -3394,11 +3394,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 39b3ad0

Please sign in to comment.