4
$\begingroup$

I want to export a list of matrices as a gif so that they will appear one after another 2 seconds apart. I've tried the following but when I open it up it only does the first two matrices and I have 10 altogether.

list = MatrixForm /@ {{{0.3333, 0, 0}, {0, 0.3333, 0}, {0, 0,0.3333}}, {{0.04466, 0, 0}, {0, 0.3333, 0}, {0, 0, 0.622}}, {{0.05954, 0, 0}, {0, 0.8293, 0}, {0, 0,0.1111}}, {{0.1163, 0, 0}, {0, 0.8681, 0}, {0, 0,0.01558}}, {{0.01707, 0, 0}, {0, 0.9511, 0}, {0, 0, 0.03185}}, {{0.01707, 0, 0}, {0, 0.9511, 0}, {0, 0, 0.03185}}, {{0.001264, 0, 0}, {0, 0.9811, 0}, {0, 0, 0.01761}}, {{0.0006892, 0, 0}, {0, 0.998, 0}, {0, 0, 0.001286}}, {{0.0006901, 0, 0}, {0, 0.9993, 0}, {0, 0, 0}}, {{0, 0, 0}, {0, 1, 0}, {0, 0, 0}}};

Export["N://presentation28.gif", list, "DisplayDurations" -> 3]
$\endgroup$
  • $\begingroup$ It is working ok on Win7 V9.0.1.0. $\endgroup$ – Kuba Jan 30 '14 at 12:03
  • $\begingroup$ Im using it on the university desktop and not sure what they run. $\endgroup$ – user32462 Jan 30 '14 at 12:06
  • $\begingroup$ Try $Version. $\endgroup$ – Kuba Jan 30 '14 at 12:14
  • $\begingroup$ Sorry what does that mean? $\endgroup$ – user32462 Jan 30 '14 at 12:21
  • 1
    $\begingroup$ 7.0 mathematica on windows 7 $\endgroup$ – user32462 Jan 30 '14 at 13:45
6
$\begingroup$

It appears that Export to "GIF" in Mathematica 7 fails (with a corrupt file) if the image frames (source elements) are not all the same size. I'm surprised I don't remember this problem, but then again I don't remember a lot of things these days. Anyway, a hackish solution for now:

bbox = MapThread[Max, Rasterize[#, "RasterSize"] & /@ list];

list2 = ImageCrop[Rasterize[#], bbox, Padding -> White] & /@ list;

Export["A://zod.gif", list2, "DisplayDurations" -> 3]

enter image description here

$\endgroup$
  • 1
    $\begingroup$ @user32462 Glad I could help! :-) Please consider Accepting this answer after a while, unless someone posts a better one. $\endgroup$ – Mr.Wizard Jan 30 '14 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.