Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Two sequences in a single animation side by side

37 views
Skip to first unread message

pluto...@gmail.com

unread,
Mar 18, 2019, 11:52:13 AM3/18/19
to
Hello,

I would like to animate two sequences side-by-side, the whole plot being a single animation. I do not want two side-by-side animations, but a single animation where each frame shows two side-by-side plots. It should be something like:

T:=4:step:=10:
A:=[seq(plot(cos(x+t/steps),x=0..1),t=0..T*step)]:
B:=[seq(plot(sin(x+t/steps),x=0..1),t=0..T*step)]:
animate(display(Array([A, B])),insequence=true);

Of course, what's indicated above does not work :( Would you please have an idea?

Thanks!

pluto...@gmail.com

unread,
Mar 18, 2019, 12:07:04 PM3/18/19
to
In order to slightly clarify, I want the animation to be a sequence of Array and not an Array of sequences...

pluto...@gmail.com

unread,
Mar 18, 2019, 12:13:51 PM3/18/19
to
that is something like:

animate([seq[display(Array([plot(cos(x+t),x=0..1),plot(cos(x+t),x=0..1)]))],t=1..2]);


acer

unread,
Mar 18, 2019, 3:20:52 PM3/18/19
to
Here are the two basic ways:

restart;
T:=4:
step:=10:
numframes:=100:

# 1) Use the plots:-animate command, and delay the evaluation
# of the extra arguments (until `t` gets numeric values).

plots:-animate(plots:-display,
['Array([plot(sin(x+t),x=0..1),
plot(cos(x+t),x=0..1)])'],
t=0..T*step, frames=numframes);

# 2) Generate a sequence of them, and then use
# the plots:-display command with its insequence option

S := [seq(plots:-display(Array([plot(sin(x+t),x=0..1),
plot(cos(x+t),x=0..1)])),
t=0..T*step, (T*step-0)/(numframes-1))]:

nops(S); # check we got 100 frames

plots:-display(S, insequence=true);

Using either of those two methods then, upon clicking for focus in the plot area, the play button in the main menubar causes the Array of plots to play together.

I used Maple 2018.2, and if it doesn't work for you then please indicate your version and platform.

pluto...@gmail.com

unread,
Mar 19, 2019, 12:57:55 AM3/19/19
to
Thank you for the suggestions. I will try them later. I am using Maple 16. Sould your code be updated accordingly?

acer

unread,
Mar 19, 2019, 1:41:53 AM3/19/19
to
On Monday, March 18, 2019 at 11:52:13 AM UTC-4, pluto...@gmail.com wrote:
Both methods also work for me using Maple 16.01.

pluto...@gmail.com

unread,
Mar 19, 2019, 6:51:52 AM3/19/19
to
yes, your suggestions work in the sense that both sequences play together in Maple. However, I want to export them together in a single gif file. What I see currently is that the two sequences can only be exported separately. I could certainly use another piece of software to put the two gif file in a single one. However, if there is a solution in Maple, I would be interested.
Message has been deleted

acer

unread,
Mar 19, 2019, 4:31:50 PM3/19/19
to
On Tuesday, March 19, 2019 at 6:51:52 AM UTC-4, pluto...@gmail.com wrote:

> yes, your suggestions work in the sense that both sequences play together in Maple. However, I want to export them together in a single gif file. What I see currently is that the two sequences can only be exported separately. I could certainly use another piece of software to put the two gif file in a single one. However, if there is a solution in Maple, I would be interested.

Why don't people state what they *really* want to accomplish at the beginning?

pluto...@gmail.com

unread,
Mar 19, 2019, 8:28:36 PM3/19/19
to
yes sorry about this. Since I thought it would be possible to have a unique animation of plots arranged in an array, I thought the gif issue would be fixed at the same time and decided to simply my question... :(
0 new messages