-
Notifications
You must be signed in to change notification settings - Fork 10
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
Plotting functions with more general arrays #78
base: master
Are you sure you want to change the base?
Conversation
@@ -82,19 +86,19 @@ end | |||
end | |||
|
|||
# Recipes for functions | |||
@recipe function f(f::Function, x::T) where T <: AVec{<:Union{Missing,<:Quantity}} | |||
@recipe function f(f::Function, x::T) where T <: AArr{<:UMQ} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaningful change
x, f.(x) | ||
end | ||
@recipe function f(x::T, f::Function) where T <: AVec{<:Union{Missing,<:Quantity}} | ||
@recipe function f(x::T, f::Function) where T <: AArr{<:UMQ} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaningful change
@recipe function f(u::Units, f::Function) | ||
return f, u | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A mirror of f(f, u)
#========================================================================= | ||
If x is an array of arrays of quantities, consider those different series. | ||
No need to dive deeper than this, a plot of arrays of arrays of arrays is | ||
not implemented in Plots. | ||
=========================================================================# | ||
@recipe function f(f::Function, x::AArrArrQ) | ||
for s in x | ||
@series begin | ||
xunit := unit(first(first(x))) | ||
f, s | ||
end | ||
end | ||
end | ||
@recipe function f(x::AArrArrQ, f::Function) | ||
return f, x | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array of array
Codecov ReportBase: 88.80% // Head: 87.40% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #78 +/- ##
==========================================
- Coverage 88.80% 87.40% -1.40%
==========================================
Files 1 1
Lines 125 135 +10
==========================================
+ Hits 111 118 +7
- Misses 14 17 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Solves #71.
Accept unitful AbstractArrays and Vectors of unitful Vectors as the x axis to functions, leading to multiple series.
(Also more consistently abbreviate array types to save text width and increase legibility, and create a
plot(u, f)
recipe to go with theplot(f, u)
recipe)