title: How to show plots inside a loop in mathematica
body: <p>I am wondering if you have good ways to show plots inside a loop in mma. Usually, the output of <code>Plot</code> function is not shown, for example in the following code:</p>
  
  <p><code>For[i = 1, i &lt;= 10, i++, Plot[Sin[i*x], {x, -Pi, Pi}]]</code></p>
  
  <p>Thanks for your help.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>In connection to my <a href="https://stackoverflow.com/questions/5573231/keyboard-functions-in-mathematica">previous question</a>, I already have the For loop, for example, like this <code>For[i = 1, i &lt;= 10, i++, Plot[Sin[i*x], {x, -Pi, Pi}]]</code>. Given this fact, I want to have something like "press any key to continue..." inside the For loop, then refresh the plot every time I press any random key. Could anybody give a complete working code?</p>