allow annotations to take a tuple and pass it to text

This commit is contained in:
Michael Krabbe Borregaard 2019-01-02 17:39:28 +01:00
parent d1428b8221
commit 7acb5a4bdb

View File

@ -554,7 +554,7 @@ function process_annotation(sp::Subplot, xs, ys, labs, font = font())
alphabet = "abcdefghijklmnopqrstuvwxyz" alphabet = "abcdefghijklmnopqrstuvwxyz"
push!(anns, (x, y, text(string("(", alphabet[sp[:subplot_index]], ")"), font))) push!(anns, (x, y, text(string("(", alphabet[sp[:subplot_index]], ")"), font)))
else else
push!(anns, (x, y, isa(lab, PlotText) ? lab : text(lab, font))) push!(anns, (x, y, isa(lab, PlotText) ? lab : isa(lab, Tuple) ? text(lab...) : text(lab, font)))
end end
end end
anns anns
@ -569,7 +569,7 @@ function process_annotation(sp::Subplot, positions::Union{AVec{Symbol},Symbol},
alphabet = "abcdefghijklmnopqrstuvwxyz" alphabet = "abcdefghijklmnopqrstuvwxyz"
push!(anns, (pos, text(string("(", alphabet[sp[:subplot_index]], ")"), font))) push!(anns, (pos, text(string("(", alphabet[sp[:subplot_index]], ")"), font)))
else else
push!(anns, (pos, isa(lab, PlotText) ? lab : text(lab, font))) push!(anns, (pos, isa(lab, PlotText) ? lab : isa(lab, Tuple) ? text(lab...) : text(lab, font)))
end end
end end
anns anns