I made the following animation, but the disks and the rectangle are shaking, breaking the smoothness of the motion.
Here is a minimal example. If you look carefully you will see the disks are shaking.
tab = Table[ConstantArray[Cos[0.3* t], 3], {t, 2, 6, 0.02}];
l0 = 1;
show[x_] :=
Block[{},
Graphics[{Rectangle[{0, -.5}, {.5, .5}],
Rectangle[{5, -.5}, {5.5, .5}],
Table[Disk[{x[[i]] + i*l0, 0}, 0.2], {i, 3}]}, ImageSize -> 800]]
plots = Table[show[tab[[i]]], {i, 1, Length@tab, 1}];
Export["temp.gif", plots]
Please not the rectangles are still here, so I don't think it is a scaling issue. This is supported by the fact that specifying PlotRange
does not change anything (ImagePadding -> None
does not either).
plots = Table[Show[show[tab[[i]]], PlotRange -> {{0, 5.5}, {-.5, .5}},
PlotRangePadding -> None], {i, 1, Length@tab, 1}]
A comment suggested to change the frame rate; though less obvious, the shaking motion is still present:
Export["temp.gif", plots, "DisplayDurations" -> 1/50.]
Please not the shaking is not introduced by Export
, since it is also observed with ListAnimate@plots
.
The question is, of course, how to prevent this shaking?
Interestingly, changing Disk
s to Point
works, but I am looking for a more robust solution (in particular, Arrow
s also "shake" and can't be easily replaced...).
show[x_] := Block[{}, Graphics[{Rectangle[{0, -.5}, {.5, .5}],
Rectangle[{5, -.5}, {5.5, .5}], PointSize[0.08],
Table[Point[{x[[i]] + i*l0, 0}], {i, 3}]}, ImageSize -> 800]]
The following animation is fine: there is no vertical jumps.
Animations made with version: 11.0.0 for Linux x86 (64-bit) (July 28, 2016)
.
Using OSX and MMA 11.1, halirutan reduced the gap between the disks to better highlight the shaking motion:
Of course the motion should be smooth, but that's really not the case.