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

[FR] create syntax myplot!(p, args...; kwargs...) for user recipes #4970

Closed
matthieugomez opened this issue Aug 7, 2024 · 1 comment
Closed
Labels
enhancement improving existing functionality good first issue

Comments

@matthieugomez
Copy link
Contributor

The docs for RecipeBases suggests to define a user recipe as follows:

mutable struct MyPlot
    args
end
export myplot, myplot!
myplot(args...; kw...) = plot(MyPlot(args); kw...)
myplot!(args...; kw...) = plot!(MyPlot(args); kw...)

To be more consistent with the ecosystem, I think the docs (and the macro @userplot) should add the following definition:

myplot!(p::AbstractPlot, args...; kw...) = plot!(p, MyPlot(args); kw...)
@matthieugomez matthieugomez changed the title Allow the syntax myplot!(p, args...; kwargs...) for user recipes [FR] Allow the syntax myplot!(p, args...; kwargs...) for user recipes Aug 7, 2024
@matthieugomez matthieugomez changed the title [FR] Allow the syntax myplot!(p, args...; kwargs...) for user recipes [FR] create syntax myplot!(p, args...; kwargs...) for user recipes Aug 7, 2024
@BeastyBlacksmith BeastyBlacksmith added enhancement improving existing functionality good first issue labels Aug 8, 2024
@matthieugomez
Copy link
Contributor Author

the macro already does it actually. opened a PR in plotdocs to correct the docs.
JuliaPlots/PlotDocs.jl#355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improving existing functionality good first issue
Projects
None yet
Development

No branches or pull requests

2 participants