Mathematica Mathematica: two animations, one slider

AI Thread Summary
The discussion revolves around creating two animations in Mathematica, each with 187 frames, that share a slider for simultaneous control. A user suggests using the Manipulate function with an Inset to overlay one animation on another. However, challenges arise with frame sizes; despite specifying Medium size, some frames appear Large. The issue seems to be linked to the PlotRange settings, as changing them resolves the size inconsistency. Additionally, there is a problem with the Manipulate function generating an extra frame, leading to warnings about a non-existent 101st frame, despite the slider being set to only go up to 100. The user is using Mathematica 7 and mentions a specific data structure, Final, which contains two rows of numbers. There is a suggestion that simplifying the data input could help resolve the issues encountered.
MartinV
Messages
68
Reaction score
0
Hello everyone.

I have two animations in Mathematica, each with 187 frames. I would like to put one in a corner of the other and for them to share a slider so they both respond to it simultaneously.

Martin
 
Physics news on Phys.org
Try something like this:
Manipulate[
Plot[Cos[\[Omega] t], {t, -\[Pi], \[Pi]},
Epilog ->
Inset[Plot[Sin[\[Omega] t], {t, -\[Pi], \[Pi]},
ImageSize -> Small], {Right, Bottom}, {Right, Bottom},
Background -> Opacity[.7, White]]], {\[Omega], -3, 3}]
 
I've got an interesting problem with Manipulate. A few of the animation frames are Large while most of them are Medium. I explicitly said I want them Medium but they are still Large:

Manipulate[
Block[{spl =
ListLinePlot[Final, PlotRange -> {{-3, 3}, {1, 20}},
ImageSize -> Medium]},
Show[spl,
Graphics[{Red, PointSize[.02],
Point[{Final[[j, 1]], Final[[j, 2]]}]}], PlotLabel -> j]], {j, 1,
M, 1}]

Edit: weird that if I use PlotRange -> {{-1,1},{0,30}}, all frames are Medium. Why does this happen?
 
Now I get another problem. Using the same code as before, I create a Manipulate animation. In a 100-frame animation Mathematica tries to create the 101st. It's always like this. When a graph is formed, I get warnings that 101st frame doesn't exist, even though the counter in Manipulate command only goes to 100. When I move the slider away from 101, the warnings disappear and then the slider has the specified range. Only when I form it, it tries to show me more than possible.
 
I tried to run the code in post 3, but it is not self contained.

I have also had some difficulties in the past using Manipulate. What version of Mathematica are you using?
 
I'm using Mathematica 7.

The code in post #3 uses the Final table, which is 187*2. M is the length, in this case 187. First row of Final is a set of numbers going from -10 to 10; the second row are numbers between 1 and 30.

I think if you just make a few numbers and then put M as the length of that array then the code should work.
 

Similar threads

Replies
5
Views
2K
Replies
4
Views
2K
Replies
5
Views
3K
Replies
6
Views
7K
Replies
13
Views
2K
Back
Top