-
-
Couldn't load subscription status.
- Fork 371
Description
I know that at various times and in various channels, people have said that recipes are confusing. I have been in that camp, for sure. Some of the advice has been to look at real-world examples of recipes (e.g. https://discourse.julialang.org/t/are-recipes-still-an-advanced-topic/124217), and there are other cool tricks that aren't obvious https://discourse.julialang.org/t/calling-multiple-user-plot-recipes-from-single-recipe/122885/3?u=ickaser
So, my question here is: what would be a good place in the docs for this? Could there be a list of links to examples of recipes? Perhaps just another page of docs with more examples?
Here's an MWE I found very enlightening that I might consider adding to such a list of examples:
@userplot APlot
@recipe function f(a::APlot; asize=10)
ax, ay = a.args
@series begin
linewidth --> asize
ax, ay
end
end
@userplot BPlot
@recipe function f(b::BPlot; bcolor=:purple)
bx, by = b.args
@series begin
seriescolor --> bcolor
bx, by
end
end
@userplot ABPlot
@recipe function f(ab::ABPlot)
ax, ay, bx, by = ab.args
@series begin
asize --> 20
APlot((ax, ay))
end
@series begin
bcolor --> :red
BPlot((bx, by))
end
end
abplot(1:3, rand(3), 1:3, rand(3))
abplot(1:3, rand(3), 1:3, rand(3), asize=3, bcolor=1)