On 2013/11/13 11:40 AM, robertdcurrier wrote: > I've pulled my hair out for the past day trying to solve this problem and > have done extensive searches to no avail. Here's my situation: > > I have data from an autonomous underwater vehicle. I have three np arrays to > plot: > 1) time on the x axis > 2) vehicle depth on the y axis > 3) sensor reading to set the color for the scatter plot at time/depth point. > > Unfortunately for me the vehicle reports sensors at different rates which > means that I might have a time and depth stamp with a 'NaN' for the sensor > value. The x/y portion of scatter deals with the NaNs with no problem, but > when I call scatter(time, depth, c=mySensorArray) and mySensorArray contains > a 'NaN' matplotlib borks. I have not been able to come up with a method > to allow the values of the sensor being plotted to set the color of the > scatter or skip the entry when the value is a 'NaN'.
mySensorArray = np.ma.masked_invalid(mySensorArray) Eric ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users