Skip to content

Commit

Permalink
Merge pull request #5095 from chrishavlin/fix_cell_edge_swap_axes
Browse files Browse the repository at this point in the history
BUG: fix swap_axes bug wih CellEdgesCallback
  • Loading branch information
neutrinoceros authored Jan 10, 2025
2 parents 4a0c1fc + 39b3ad0 commit a887cf0
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 @@ -3411,11 +3411,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 a887cf0

Please sign in to comment.