On Sat, Mar 28, 2009 at 15:45, Bala subramanian
<bala.biophys...@gmail.com> wrote:
> Friends,
> In the following. I am not able to understand how this plot.show() works. I
> have commented the problem in the following examples.

You have to call plt.show() only when you want to actually show the
figure. That's because you're using python command interpreter.

Try:

plt.plot(x,y,'b-')
plt.ylim( (1.5,4.5) )
plt.show()

If you want to do interactive plotting, I suggest using ipython.

ipython -pylab

already import the pylab module, that provide all the pyplot functions.

I prefer to do something like

$ipython

  import matplotlib.pyplot as plt
  plt.ion() # incase it's not already in interactive mode
  <do my printing>

This way, it will open the figure window and you'll be able to
"decorate" the plot in the ipython shell and see the result applied to
the "background" figure with no need to execute "plt.show()" or close
the windows between a command and a "show()".

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to