Re: Show doesn't work inside Do loop ?
- To: mathgroup at smc.vnet.net
- Subject: [mg101927] Re: [mg101906] Show doesn't work inside Do loop ?
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Thu, 23 Jul 2009 03:55:42 -0400 (EDT)
- Reply-to: hanlonr at cox.net
$Version 7.0 for Mac OS X x86 (64-bit) (February 19, 2009) Manipulate[ Plot[Sin[i*x], {x, -5, 5}], {i, Range[5]}] Or use Print rather than Show Do[Print["i = ", i]; Fig = Plot[Sin[i*x], {x, -5, 5}]; Print[Fig], {i, 1, 5}] Do[Print["i = ", i]; Print[Plot[Sin[i*x], {x, -5, 5}]], {i, 1, 5}] Bob Hanlon ---- "ibmichuco at hotmail.com" <ibmichuco at hotmail.com> wrote: ============= Hi, Is there a way to use Show inside a Do loop? For example, the following doesn't work: Do[ Print["i =",i]; Fig = Plot[Sin[i*x], {x, -5, 5}]; Show[Fig] , {i, 1, 5}] I would like to print different info at each step of the loop, therefore saving all Fig in a Table or Array doesn't help me. Thanks, Michuco