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: off-axis slicing broken with non-default axis_ordering #5099

Open
chrishavlin opened this issue Jan 16, 2025 · 0 comments
Open

BUG: off-axis slicing broken with non-default axis_ordering #5099

chrishavlin opened this issue Jan 16, 2025 · 0 comments

Comments

@chrishavlin
Copy link
Contributor

Off-axis slicing doesn't work properly when the dataset's axis ordering is not (x, y, z)

import numpy as np 
import yt 

shp = (256, 256, 256)
data = {('gas', 'density'): np.random.random(shp)}

ds = yt.load_uniform_grid(data, 
                          shp, 
                          axis_order=('z', 'y', 'x'))
slc = yt.OffAxisSlicePlot(ds, [1., 0., 0.], ('gas', 'density'))
slc.show()

Image

Should look the same as using the default axis , i.e.,

ds = yt.load_uniform_grid(data, shp)

normal = [0., 0., 1.]
slc = yt.OffAxisSlicePlot(ds, normal, ('gas', 'density'))
slc.show()

Image

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

No branches or pull requests

1 participant