views:

80

answers:

3

Suppose we have a list of images, like the following:

imageList = Table[Plot[Sin[k*x], {x, 0, 2 Pi}], {k, 1, 4, .05}];

We can animate those images like so:

ListAnimate[imageList]

But now suppose we want the animation bigger. We could stick an ImageSize option into the Plot command used to generate the images, but suppose we're not allowed to tamper with imageList.

We could manually resize each frame in the list animation. That works, but how can we accomplish that less tediously?

+1  A: 

I'm a bit puzzled by your question.

    ListAnimate[Table[Plot[x^n, {x, -5, 5}, ImageSize -> {100 n, 75 n}], {n, 1, 5}]]

works fine for me, in as much as it draws the images with the specified sizes. It's a bit of a mess in this example, I grant you. The ListAnimate command also makes a panel with a frame big enough for the largest graphic in this case.

Post again if I've answered the wrong question for you, that's one of my specialities.

High Performance Mark
dreeves
+2  A: 

The key option is ImageSize. You can use it with the various plot commands, as well as with Show and Export. ImageSize can be given as {<width>,<height>} (where either can be Automatic to have the other set according to AspectRatio) or as <width> which is short for {<width>, Automatic}. In short, you can do stuff like

gfx = Plot[x^2, {x, 0, 1}, ImageSize -> 200]
Show[gfx, AspectRatio -> 1, ImageSize -> {Automatic, 100}]

If you really want control of the graphics layout, you need to start playing around with ImagePadding and PlotRangePadding as well, but be prepared for gray hair if you go in this direction!

Edit: For your particular case with the graphics already generated in imageList, it all comes together like so

ListAnimate[Show[#, ImageSize->800]& /@ imageList]
Janus
ImageSize with Show is the key! I'm going to rewrite this question now. Sorry for the lousy first version.
dreeves
All makes sense now -- couldn't figure out how you had missed ImageSize to begin with :). But yes, `Show` is often nice for reformating Graphics.
Janus
Thanks again, Janus. If you want to edit in the Show /@ imageList trick (see my answer) I'll mark this as the Accepted Answer.
dreeves
A: 

The following is one viable answer to the question as currently worded, with thanks to the initial answers by High Performance Mark and Janus:

ListAnimate[Show[#, ImageSize->800]& /@ imageList]
dreeves