handle unmatching vectors

This commit is contained in:
Simon Christ 2020-03-11 12:11:10 +01:00
parent 2c4535f6f2
commit fd17dceecc

View File

@ -348,17 +348,20 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
# add to legend?
if sp[:legend] != :none && pgfx_should_add_to_legend(series)
leg_entry = if opt[:label] isa AVec
opt[:label][i]
get(opt[:label], i, "")
elseif opt[:label] isa AbstractString
if i == 1 && opt[:label] != ""
if i == 1
opt[:label]
else
push!(segment_plot.options, "forget plot" => nothing)
continue
""
end
else
throw(ArgumentError("Malformed label. label = $(opt[:label])"))
end
if leg_entry == ""
push!(segment_plot.options, "forget plot" => nothing)
continue
end
leg_opt = PGFPlotsX.Options()
if ribbon !== nothing
pgfx_filllegend!(axis.contents[end - 3].options, opt)