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

histogram wrong labelled axis #19

Closed
briochemc opened this issue Jan 27, 2020 · 5 comments
Closed

histogram wrong labelled axis #19

briochemc opened this issue Jan 27, 2020 · 5 comments

Comments

@briochemc
Copy link
Collaborator

using Unitful, UnitfulRecipes, Plots
x = randn(100)*u"m"
histogram(x)

gives

test

but the unit should be on the x-axis. I guess it's because in the recipe plot(x) assigns the label to the y-axis automatically.

@jw3126
Copy link
Owner

jw3126 commented Jan 28, 2020

Oh I did not know that. I guess we need to take a loog at the seriestype here: https://github.com/jw3126/UnitfulRecipes.jl/blob/master/src/UnitfulRecipes.jl#L17

@briochemc
Copy link
Collaborator Author

Oh I did not know that. I guess we need to take a loog at the seriestype here: https://github.com/jw3126/UnitfulRecipes.jl/blob/master/src/UnitfulRecipes.jl#L17

Yep I think so too. But maybe there is a smarter way to deal with it? It would be great to be able to infer which axis (and thus which attribute) the data corresponds to... But I'm still not there yet in terms of understanding how all this works 😅

@briochemc
Copy link
Collaborator Author

briochemc commented Feb 24, 2020

I think 1ffc4b6 is a minimal but good (temporary?) fix 😄

Example output from MWE above:

fixed_histogram

@briochemc
Copy link
Collaborator Author

Actually I introduced a (bug) by assuming the :seriestype existed, but now with 4456579 it should be fine (tested locally this time!)

@briochemc
Copy link
Collaborator Author

I will close now but someone might reopen if something is wrong!

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

No branches or pull requests

2 participants