Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Plot in a Do loop does nothing

  • To: mathgroup at
  • Subject: [mg78258] RE: [mg78229] Plot in a Do loop does nothing
  • From: José Luis Gómez <jose.luis.gomez at>
  • Date: Wed, 27 Jun 2007 05:23:03 -0400 (EDT)
  • References: <>

Dear Tim

Solution is simple, just wrap Print[] around Plot[]. I mean:

Do[Print[Plot[Sin[x], {x, 0, 2*n*Pi}]], {n, 1, 2}]

The reason is that in previous Mathematica versions the actual graph was a
"side effect" of the evaluation of Plot, while now in version 6 the actual
graph is the "output" of Plot, and Do is a command that does Not show the
"output" of iterations.

If you are interested in learning the new great, creasy things that can be
done now that the graphs are not side effects, but actual Mathematica output
and input, check the bottom of the page in the following link:



-----Mensaje original-----
De: Tim Birks [mailto:pystab at] 
Enviado el: Martes, 26 de Junio de 2007 03:34 a.m.
Para: mathgroup at
Asunto: [mg78229] Plot in a Do loop does nothing

Can anyone please explain why the line:
Do[Plot[Sin[x], {x, 0, 2*n*Pi}], {n, 1, 2}]

does nothing in Mathematica 6? Or, how else I can produce such a series of 
related plots? It worked fine in Mathematica 5!


  • Prev by Date: Re: "Elastic string" (type of traveling-salesman) paradigm for sampling
  • Next by Date: Is "Find Currently Evaluating Cell" really "Find Topmost Cell in Evaluation Queue"?
  • Previous by thread: Plot in a Do loop does nothing
  • Next by thread: Re: Plot in a Do loop does nothing