Re: ListLinePlot[] inside a loop
- To: mathgroup at smc.vnet.net
- Subject: [mg82417] Re: ListLinePlot[] inside a loop
- From: "David Park" <djmpark at comcast.net>
- Date: Fri, 19 Oct 2007 05:11:13 -0400 (EDT)
- References: <ff789h$nrs$1@smc.vnet.net>
This question appeared a number of times when Version 6 first appeared. Pre-Version 6 plots were produced as a side effect. Now they are direct output. But a Do statement produces no direct output. The solution is to Print the plots within the Do loop. Do[Print@ListLinePlot[Table[{x, Sin[i*x Degree]}, {x, 0, 360}], PlotRange -> {{0, 360}, {-1.1, 1.1}}], {i, 1, 3}]; -- David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ "Luiz Melo" <luiz.melo at polymtl.ca> wrote in message news:ff789h$nrs$1 at smc.vnet.net... > Hi mathgroup, > > Why is the plot of a list not displayed when ListLinePlot[] is used ins= ide > a Do > loop (Mathematica 6.0)? > For instance, suppose we want to produce the graphics of Sin[i*x] as a > function > of x, each time i is iterated from 1 to 3 (in steps of 1). I naively > tryed: > > Do[ListLinePlot[Table[{x, Sin[i*x Degree]}, {x, 0, 360}], > PlotRange -> {{0, 360}, {-1.1, 1.1}}], {i, 1, 3}]; > > The specifications "For[]" and "While[]" don't work either. > Thanks, > Luiz > > > > -- > Luiz Melo > =C9cole Polytechnique de Montr=E9al > D=E9partement de G=E9nie Physique > C.P.6079, succ. Centre-ville > Montr=E9al (QC) Canada > H3C 3A7 > T=E9l (514)340-4711-7454 > Fax (514)340-3218 >