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 Recipes #86

Open
ChrisRackauckas opened this issue Aug 2, 2016 · 0 comments
Open

Plot Recipes #86

ChrisRackauckas opened this issue Aug 2, 2016 · 0 comments

Comments

@ChrisRackauckas
Copy link

ChrisRackauckas commented Aug 2, 2016

I think units should add plot recipes for the types. However, it's quite hard because it's hard to get the dispatch right. Here's what I tried:

@recipe f{T<:SIUnits.SIQuantity}(::Type{T}, x::T) = x.val # Works
#@recipe f{T<:SIUnits.SIQuantity{N,m,kg,s,A,K,mol,cd,rad,sr}}(::Type{SIUnits.SIQuantity{N,m,kg,s,A,K,mol,cd,rad,sr}},x::T)  map((y)->y.val,x) #Cannot compile
#@recipe f{T<:AbstractArray{SIUnits.SIQuantity}}(::Type{T}, unitArray::T) =  map((x)->x.val,unitArray) # Doesn't dispatch onto this because parametric array problems
@recipe f{T<:AbstractArray{SIUnits.SIQuantity{Float64,0,0,1,0,0,0,0,0,0}}}(::Type{T}, unitArray::T) =  (map((x)->x.val,unitArray)) # Works for seconds

This is related to JuliaPlots/Plots.jl#427

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

1 participant