|
From: Eric F. <ef...@ha...> - 2008-01-09 20:04:05
|
Darren Dale wrote: > It looks like the new transforms codebase does not support data that contains > NaNs the way the old trunk did: > > plot([1,2,NaN,4,5]) produces a plot with no line break > plot([NaN,2,3,4,5]) produces a plot with no line > > I know use of NaN's is not encouraged, and we have discussed it on this list. > But since they are sometimes unintended and unavoidable, I'm reporting the > behavior so people are not surprised when they get an empty plot. > > Darren This comes up often enough that it might be worth doing automatic masking of NaNs in the high-level argument processing wherever we are now doing x=npy.ma.asarray(x) or similar. The calls could be replaced with x=npy.ma.masked_where(~npy.isfinite(x),x) I have resisted adding this overhead, but now I think the overhead might be negligible in almost all cases. It looks like it would be on the order of milliseconds per high-level call, where by high-level call I mean plot, pcolor, quiver, etc. (either via pylab or Axes method). Eric |