From 0e25767cd34856a9a6b26131273363ddd6d5cd3d Mon Sep 17 00:00:00 2001 From: Andy Nowacki Date: Thu, 8 Jul 2021 11:22:44 +0100 Subject: [PATCH] Document use of tuples in annotate! shorthand Include a description of the use of vectors of plain tuples in the docstring for `annotate!`. --- src/shorthands.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shorthands.jl b/src/shorthands.jl index dfcc23023..74a7b26c0 100644 --- a/src/shorthands.jl +++ b/src/shorthands.jl @@ -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...)