You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
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
yt was installed by conda.
The text was updated successfully, but these errors were encountered: