Merge pull request #2597 from daschw/annotations

fix annotate! shorthands
This commit is contained in:
Daniel Schwabeneder 2020-04-18 19:26:31 +02:00 committed by GitHub
commit fe0858ebcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -438,8 +438,9 @@ julia> plot(1:10)
julia> annotate!([(7,3,"(7,3)"),(3,7,text("hey", 14, :left, :top, :green))])
```
"""
annotate!(anns...; kw...) = plot!(; annotation = collect(anns), kw...)
annotate!(anns::AVec{T}; kw...) where {T<:Tuple} = plot!(; annotation = anns, kw...)
annotate!(anns...; kw...) = plot!(; annotation = anns, kw...)
annotate!(anns::Tuple...; kw...) = plot!(; annotation = collect(anns), kw...)
annotate!(anns::AVec{<:Tuple}; kw...) = plot!(; annotation = anns, kw...)
"Flip the current plots' x axis"
xflip!(flip::Bool = true; kw...) = plot!(; xflip = flip, kw...)