-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Plots.jl compatibility with SIUnits.jl #427
Comments
Can't you just add type recipes for this? |
Oh true, didn't think about that. |
Hey, I got the basic recipe together: @recipe function f{ND,N,m,kg,s,A,K,mol,cd,rad,sr}(::Type{Array{SIUnits.SIQuantity{N,m,kg,s,A,K,mol,cd,rad,sr},ND}},x::Array{SIUnits.SIQuantity{N,m,kg,s,A,K,mol,cd,rad,sr},ND})
map((y)->y.val,x)
end However, I am wondering how I would add the axis to it. I can get a string for the units using using SIUnits.ShortUnits
u = [1.0N 1.0N
1.0N 1.2N
1.5N 1.7N]
x = [1 1
2 2
3 3]
plot(x,u) # Works on all backends I would like to have SIUnits.unit(u[1]) (which returns "kg m s^-2") to be the yguide (but if u and x were flipped, make it the xguide) |
Superseded by #460. |
Currently Plots.jl is not compatible with SIUnits.jl:
However, if you strip the values of their units
This works. (If you find a way to type check this and strip the units without adding the dependency, I'd be interested in something similar).
The text was updated successfully, but these errors were encountered: