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

Plot of one dimensional DimArray ignores the lookup values of the dimensions #714

Closed
felixcremer opened this issue May 17, 2024 · 2 comments · Fixed by #715
Closed

Plot of one dimensional DimArray ignores the lookup values of the dimensions #714

felixcremer opened this issue May 17, 2024 · 2 comments · Fixed by #715

Comments

@felixcremer
Copy link
Contributor

felixcremer commented May 17, 2024

When I plot a one-dimensional Array the label is derived from the dimension but the lookup values are not used and the plot axis is from one to length(dim). For a two dimensional array it works as expected.

nx = X(reverse(Float32[75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0]))
ny = Y(reverse(Float32[75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0]))

narr = DimArray(rand(25,25), (ny, nx))
plot(narr) # works as expected.
nsingle = DimArray(rand(25), ny)
plot(nsingle) # Would have expected that the Axis is 15 to 75 
@rafaqz
Copy link
Owner

rafaqz commented May 17, 2024

Looks like we just forgot to pass the xs variable to Makie.convert_arguments

@felixcremer
Copy link
Contributor Author

Yes, that works. I will prepare a PR.

felixcremer added a commit to felixcremer/DimensionalData.jl that referenced this issue May 17, 2024
@felixcremer felixcremer mentioned this issue May 17, 2024
felixcremer added a commit to felixcremer/DimensionalData.jl that referenced this issue Jun 10, 2024
rafaqz pushed a commit that referenced this issue Jun 10, 2024
* Fix Plot of one dimensional DimArray ignores the lookup values of the dimensions #714

* Fix tests

* Add show statements in test and only test plotting

* Call reset_limits! before checks in tests

* Test everything

* Remove unnecessary show statements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants