As discussed recently in this thread, we are wondering whether it is possible to create one initial plot with subplots, which then can be individually modified by push!.
So instead of creating two separate plots and then combining them in a call to plot:
using Plots
N = 200
u1 = 20*rand(3, N)
u2 = 15*rand(3, N)
plt1 = plot3d(
1,
xlim = (-30, 30),
ylim = (-30, 30),
zlim = (0, 60),
title = ["Some trajectory"],
legend = false,
marker = 2,
)
plt2 = plot3d(
1,
xlim = (-30, 30),
ylim = (-30, 30),
zlim = (0, 60),
title = ["Other trajectory"],
legend = false,
marker = 2,
)
@gif for i in range(1, size(u1, 2))
push!(plt1, u1[:, i]...)
push!(plt2, u2[:, i]...)
plot(plt1, plt2)
end every 10
I’d expect something like
N = 200
u1 = 20*rand(3, N)
u2 = 15*rand(3, N)
plt = plot3d(
1,
xlim = (-30, 30),
ylim = (-30, 30),
zlim = (0, 60),
title = ["Some trajectory" "Other trajectory"],
legend = false,
marker = 2,
layout = (1, 2)
)
@gif for i in range(1, size(u1, 2))
push!(plt[1], u1[:, i]...)
push!(plt[2], u2[:, i]...)
end every 10
or even being able to push to both subplots in one joint call.