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

yt.SlicePlot.annotate_cell_edges does not swap axis with the plot #5094

Closed
wang1202 opened this issue Jan 9, 2025 · 4 comments · Fixed by #5095
Closed

yt.SlicePlot.annotate_cell_edges does not swap axis with the plot #5094

wang1202 opened this issue Jan 9, 2025 · 4 comments · Fixed by #5095
Assignees

Comments

@wang1202
Copy link

wang1202 commented Jan 9, 2025

plt00450.zip

Bug report

Bug summary

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

Code for reproduction

import yt

ds = yt.load("plt00450")
slice_plot = yt.SlicePlot(ds, "y", ("boxlib", "theta"))
slice_plot.swap_axes() # Swap the axes
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.show() # Display the plot

Expected outcome

The x and y axes of the cell edges should be swapped as the plot. The cell edges appear correctly if I comment out the line slice_plot.swap_axes(), but I want the x-axis to appear in the horizontal direction.

Version Information

  • Operating System: macOS Sequoia 15.2
  • Python Version: 3.12.2
  • yt version: 4.4.0
  • Other Libraries (if applicable):

yt was installed by conda.

Copy link

welcome bot commented Jan 9, 2025

Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue.

@chrishavlin
Copy link
Contributor

thanks for the report! I'll take a look since I wrote all the swapping logic.

@chrishavlin
Copy link
Contributor

Thanks for uploading a dataset, @wang1202 ! It made it much easier to reproduce and fix the bug. Feel free to try out the branch over in #5095 if you're comfortable installing from source.

@wang1202
Copy link
Author

wang1202 commented Jan 9, 2025

The issue has been resolved by your modification, @chrishavlin. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants