Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1861 > unrolled thread

Re: How to create an animated gif (was: How to roll up

Started byHeike Gramberg <heike.gramberg@gmail.com>
First post2011-04-24 12:26 +0000
Last post2011-04-24 12:26 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: How to create an animated gif (was: How to roll up Heike Gramberg <heike.gramberg@gmail.com> - 2011-04-24 12:26 +0000

#1861 — Re: How to create an animated gif (was: How to roll up

FromHeike Gramberg <heike.gramberg@gmail.com>
Date2011-04-24 12:26 +0000
SubjectRe: How to create an animated gif (was: How to roll up
Message-ID<ip14tr$ggt$1@smc.vnet.net>
To create an animated gif, you need to export a list of images, not an Animate object, e.g.

list =
  Table[Graphics[{Blue,
     Table[Line[{{a - x, 0}, {0, x}, {x - a, 0}, {0, -x}, {a - x,
         0}}], {x, 0, a}]}], {a, 0, 20}];

Export["animation.gif", list]

Heike.

On 23 Apr 2011, at 12:49, Sol Lederman wrote:

> Francisco,
>
> Thank you. A little while after I sent my query I was able to figure it out
> myself and I got the same solution you did. And then I extended the command
> in a fun (and mesmerizing) way with Animate.
>
>   Animate[
> Graphics[{
>   Blue,
>   Table[Line[{{a - x, 0}, {0, x}, {x - a, 0}, {0, -x}, {a - x, 0}}], {x, 0,
> a}]
>   }],
> {a, 0, 20}]
>
> I have a follow-on question. I tried creating an animated gif like this:
>
>   list = Animate[
>  Graphics[{
>    Blue,
>    Table[
>     Line[{{a - x, 0}, {0, x}, {x - a, 0}, {0, -x}, {a - x, 0}}], {x, 0, a}]
>    }],
>  {a, 0, 20}]
>
>
>   Export["animation.gif", list]
>
>
> When I look at the gif file in a browser I don't get any animation. I get
> just one frame. What am I missing?
>
>
> Thanks.
>
> Sol
>
> 2011/4/22 Francisco Javier Garc==EDa Capit==E1n <garciacapitan@gmail.com>
>
>> Graphics[Table[Line[{{0, n}, {11 - n, 0}}], {n, 1, 10}]]
>>
>> Francisco Javier.
>>
>> 2011/4/22 Sol Lederman <sol.lederman@gmail.com>
>>
>>> Hi,
>>>
>>> I'm new to Mathematica.
>>>
>>> I have the following bit of graphics:
>>>
>>>  Graphics[{
>>> Line[{{0, 10}, {1, 0}}],
>>> Line[{{0, 9}, {2, 0}}],
>>> Line[{{0, 8}, {3, 0}}],
>>> Line[{{0, 7}, {4, 0}}],
>>> Line[{{0, 6}, {5, 0}}],
>>> Line[{{0, 5}, {6, 0}}],
>>> Line[{{0, 4}, {7, 0}}],
>>> Line[{{0, 3}, {8, 0}}],
>>> Line[{{0, 2}, {9, 0}}],
>>> Line[{{0, 1}, {10, 0}}],
>>> }]
>>>
>>>
>>> I want to simplify it to do some sort of iteration to compute the end
>>> points
>>> of the lines. I can do this easily in a variety of procedural languages
>>> but
>>> I haven't yet grokked how Mathematica would do this.
>>>
>>>
>>> Would someone please show me the short way, I imagine using Table somehow?
>>>
>>>
>>> Thanks.
>>>
>>>
>>> Sol
>>>
>>
>>
>>
>> --
>> ---
>> Francisco Javier Garc==EDa Capit==E1n
>> http://garciacapitan.auna.com
>>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web