add slicing of tuples of matrices

This commit is contained in:
Simon Christ 2022-02-18 17:50:17 +01:00
parent ed9f0bcab3
commit e5b33bc5a9
3 changed files with 10 additions and 4 deletions

View File

@ -1750,10 +1750,15 @@ function slice_arg!(
v = get(plotattributes_in, k, plotattributes_out[k])
plotattributes_out[k] =
if haskey(plotattributes_in, k) &&
typeof(v) <: AMat &&
!isempty(v) &&
!(k in _plot_args)
slice_arg(v, idx)
if typeof(v) <: AMat &&
!isempty(v)
slice_arg(v, idx)
elseif typeof(v) <: NTuple{2, AMat}
(slice_arg(v[1], idx), slice_arg(v[2], idx))
else
v
end
else
v
end

View File

@ -417,7 +417,7 @@ ok(tup::Tuple) = ok(tup...)
function make_fillrange_side(y::AVec, rib)
frs = zeros(axes(y))
for (i, yi) in pairs(y)
frs[i] = yi + _cycle(rib, i)
frs[i] = yi .+ _cycle(rib, i)
end
frs
end

View File

@ -32,5 +32,6 @@ end
@test plot(data4; NamedTuple{tuple(attribute)}(Ref(mat))...)[1][i][attribute] ==
[2(i - 1) + 1, 2i]
end
@test plot(data4, ribbon = (mat, mat))[1][i][:ribbon] == ([2(i - 1) + 1, 2i], [2(i - 1) + 1, 2i])
end
end