[SciPy-user] Plotting an array

John Hunter jdhunter at ace.bsd.uchicago.edu
Tue Oct 10 13:48:47 EDT 2006


>>>>> "Andrew" == Andrew B Young <andrew.young at sri.com> writes:

    Andrew> Gael, The following little program-- -- test.py
    Andrew> ---------------------- | from scipy import arange, sin,
    Andrew> pi, interpolate | from pylab import plot, show, savefig |
    Andrew> t = arange(0, 2.0, 0.1) | plot(t) | savefig('test.png')

    Andrew> Produces the plot at http://polar.sri.com/~ayoung/test.png

    Andrew> Why does the plot "turn on" at one?  If I, plot( [ 0. ,
    Andrew> 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.  , 1.1,
    Andrew> 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9] ) I get what I
    Andrew> would expect: http://polar.sri.com/~ayoung/test2.png

This looks odd; one possibility is that you are mixing your numerix
packages.  Check you matplotlib rc setting.  If you are using a recent
scipy built on top of a recent numpy, you should setting you numerix
setting to numpy -- see http://matplotlib.sf.net/matplotlibrc

Alternatively, just use the matplotlib numerix namespace to insure
consistency

  from pylab import plot, show, savefig, nx
  t = nx.arange(0, 2.0, 0.1)
  plot(t)
  savefig('test.png')


JDH



More information about the SciPy-User mailing list