Merge pull request #2522 from wfrgra/time_annotation

Fix for #2349. Converts TimeTypes in annotations to numbers to allow their placement
This commit is contained in:
Daniel Schwabeneder 2020-03-31 12:06:41 +02:00 committed by GitHub
commit 4c839837d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -595,6 +595,8 @@ function process_annotation(sp::Subplot, xs, ys, labs, font = font())
ylength = length(methods(length, (typeof(ys),))) == 0 ? 1 : length(ys)
for i in 1:max(xlength, ylength, length(labs))
x, y, lab = _cycle(xs, i), _cycle(ys, i), _cycle(labs, i)
x = typeof(x) <: TimeType ? Dates.value(x) : x
y = typeof(y) <: TimeType ? Dates.value(y) : y
if lab == :auto
alphabet = "abcdefghijklmnopqrstuvwxyz"
push!(anns, (x, y, text(string("(", alphabet[sp[:subplot_index]], ")"), font)))