Skip to content

Commit

Permalink
Document use of tuples in annotate! shorthand
Browse files Browse the repository at this point in the history
Include a description of the use of vectors of plain tuples in
the docstring for `annotate!`.
  • Loading branch information
anowacki committed Jul 8, 2021
1 parent 5d935d2 commit 0e25767
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shorthands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,14 @@ Add annotations to an existing plot.
# Arguments
- `anns`: An `AbstractVector` of tuples of the form `(x,y,text)`. The `text` object
can be a `String` or `PlotText`.
can be a `String`, `PlotText` PlotText (created with `text(args...)`),
or a tuple of arguments to `text` (e.g., `("Label", 8, :red, :top)`).
# Example
```julia-repl
julia> plot(1:10)
julia> annotate!([(7,3,"(7,3)"),(3,7,text("hey", 14, :left, :top, :green))])
julia> annotate!([(4, 4, ("More text", 8, 45.0, :bottom, :red))])
```
"""
annotate!(anns...; kw...) = plot!(; annotation = anns, kw...)
Expand Down

0 comments on commit 0e25767

Please sign in to comment.