Your example works as you describe on recent matplotlib versions. I suspect you are using an old one. The preferred way of handling missing points in numpy, and therefore in matplotlib and pylab, however, is via masked arrays.import pylabimport numpy as npfrom numpy import maa = [1,2,3,4,5]b = np.array([6,2,np.nan,1,9])bm = ma.masked_where(np.isnan(b), b)pylab.plot(a,bm)pylab.show()There are many other examples of masked array use in the examples directory of the matplotlib distribution.EricFernando Abilleira wrote:> Dear sourceforge community,> > I come from a Matlab environment so I am used to plotting matrices that > contain NaN elements. This is very useful because in some cases one > doesn't have data for the entire matrix. If one tries plotting the data, > the NaN elements won't be plotted.
Group items matching
in title, tags, annotations or urlDoug Hellmann: PyMOTW: gc - Garbage Collector - 0 views
User:Marshall Hampton/Sage - OpenWetWare - 0 views
Osh 0.9 User's Guide - 0 views
osh-- Reference Documentation - 0 views
pydev: interactive debugging - 0 views
Pyllar Homepage - 0 views
Socket Programming Tutorial - 0 views
Lesson 1: Socket Communications - 0 views
Large axis labels/positioning the axes - 0 views
pyWinAuto: Index of pywinauto.controls module - 0 views
trentm.com » projects » cmdln.py - 0 views
The Queue module - 0 views
« First
‹ Previous
341 - 360 of 474
Next ›
Last »
Showing 20▼ items per page