Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: fix swap_axes bug wih CellEdgesCallback #5095

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

chrishavlin
Copy link
Contributor

Closes #5094

Using the sample dataset in #5094, on this branch:

import yt
ds = yt.load("plt00450")
slice_plot = yt.SlicePlot(ds, "y", ("boxlib", "theta"))
slice_plot.set_width((6000, 10000)) # This sets the width in both directions
slice_plot.annotate_cell_edges(line_width=0.0001) # Add grid lines to the plot
slice_plot.swap_axes() # Swap the axes
slice_plot.show() # Display the plot

results in the correctly rotated cell edges
image

@chrishavlin
Copy link
Contributor Author

Just for completeness, here's the incorrect image you get running the same code on main:

image

Copy link

@wang1202 wang1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works. Thanks!

Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the quick fix !

@neutrinoceros neutrinoceros merged commit a887cf0 into yt-project:main Jan 10, 2025
13 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/yt that referenced this pull request Jan 10, 2025
neutrinoceros added a commit that referenced this pull request Jan 10, 2025
…5-on-yt-4.4.x

Backport PR #5095 on branch yt-4.4.x (BUG: fix swap_axes bug wih CellEdgesCallback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yt.SlicePlot.annotate_cell_edges does not swap axis with the plot
3 participants