add slicing of tuples of matrices for plotattributes (#4109)
* add slicing of tuples of matrices * remove dot * format files
This commit is contained in:
parent
ed9f0bcab3
commit
51358717ee
12
src/args.jl
12
src/args.jl
@ -1748,12 +1748,14 @@ function slice_arg!(
|
|||||||
remove_pair::Bool,
|
remove_pair::Bool,
|
||||||
)
|
)
|
||||||
v = get(plotattributes_in, k, plotattributes_out[k])
|
v = get(plotattributes_in, k, plotattributes_out[k])
|
||||||
plotattributes_out[k] =
|
plotattributes_out[k] = if haskey(plotattributes_in, k) && !(k in _plot_args)
|
||||||
if haskey(plotattributes_in, k) &&
|
if typeof(v) <: AMat && !isempty(v)
|
||||||
typeof(v) <: AMat &&
|
|
||||||
!isempty(v) &&
|
|
||||||
!(k in _plot_args)
|
|
||||||
slice_arg(v, idx)
|
slice_arg(v, idx)
|
||||||
|
elseif typeof(v) <: NTuple{2,AMat}
|
||||||
|
(slice_arg(v[1], idx), slice_arg(v[2], idx))
|
||||||
|
else
|
||||||
|
v
|
||||||
|
end
|
||||||
else
|
else
|
||||||
v
|
v
|
||||||
end
|
end
|
||||||
|
|||||||
@ -32,5 +32,7 @@ end
|
|||||||
@test plot(data4; NamedTuple{tuple(attribute)}(Ref(mat))...)[1][i][attribute] ==
|
@test plot(data4; NamedTuple{tuple(attribute)}(Ref(mat))...)[1][i][attribute] ==
|
||||||
[2(i - 1) + 1, 2i]
|
[2(i - 1) + 1, 2i]
|
||||||
end
|
end
|
||||||
|
@test plot(data4, ribbon = (mat, mat))[1][i][:ribbon] ==
|
||||||
|
([2(i - 1) + 1, 2i], [2(i - 1) + 1, 2i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user