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: plot bounds are off with ds.r[...].plot in non-cartesian geometries #4499

Open
neutrinoceros opened this issue Jun 11, 2023 · 2 comments
Labels
api-consistency naming conventions, code deduplication, informative error messages, code smells... bug coordinates: non-cartesian viz: 2D

Comments

@neutrinoceros
Copy link
Member

Bug report

Bug summary

This was discovered in #4497, which I reproduce here for self-consistency

Code for reproduction

import yt
import yt.testing

ds = yt.testing.fake_amr_ds(geometry="spherical")
c = ds.domain_center
ds.r[:,c[1],:].plot("Density").save("/tmp/test.png")

Actual outcome

test

Expected outcome

The output should look identical to

import yt
import yt.testing

ds = yt.testing.fake_amr_ds(geometry="spherical")
c = ds.domain_center
yt.SlicePlot(ds, "theta", "Density").save("/tmp/test2.png")

test2

@neutrinoceros
Copy link
Member Author

#4500 fixes the simple cases that are illustrated here and in #4497, but actual tests are needed to close this, which will be easier to manage on the dev branch (especially considering #4362)

@neutrinoceros
Copy link
Member Author

I am not so sure about what the "correct" behavior should be (the current one is still clearly incorrect). Given that YTSlice.plot is already slightly different from SlicePlot in that it uses ˋorigin="native"` by default, maybe it would make sense to also use native plot axes (as #4179 attempts at enabling).
@matthewturk, @jzuhone I would be interested in your opinions on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-consistency naming conventions, code deduplication, informative error messages, code smells... bug coordinates: non-cartesian viz: 2D
Projects
None yet
Development

No branches or pull requests

1 participant