Scatter and missing data

The data I deal with regularly has 'missing' values. I am quite pleased that plot handles this situation so gracefully.
I tried a scatter plot with two arrays with missing data and was a little surprised that it failed.
Is this a bug or a feature?
I can appreciate that in the plot case one can plainly see the gaps where the missing data lie, whilst in the scatter case points would be silently eliminated. So one might be reluctant to have this aspect of the data hidden in the scatter.

I would like to have scatter handle missing data - i.e. if either array has a missing value then the point is not plotted.
I have looked a bit at the plot code and must confess that exactly how the missing stuff is implemented is not obvious to me.

--Jim

Jim,

James Boyle wrote:

The data I deal with regularly has 'missing' values. I am quite pleased that plot handles this situation so gracefully.
I tried a scatter plot with two arrays with missing data and was a little surprised that it failed.
Is this a bug or a feature?

I guess I would call it a missing feature. I added masked_array support to line drawing, but neglected scatter. I think I can do it later today.

Eric

Hi James,

Guess I can't provide what Jim wants to code, but perhaps the wiki entry I
wrote a while ago will help out:
http://new.scipy.org/Wiki/Cookbook/Matplotlib/Plotting_values_with_masked_arrays
(apparently the new highlighter messed up some lines, but it is still
readable)

Christian

Christian, James,

I added masked_array support to the scatter function in CVS yesterday, so that with mpl from CVS one should be able to used masked arrays for any or all of the array arguments and it will plot only the unmasked values. I added examples/scatter_masked.py to illustrate this.

Eric

Christian Meesters wrote:

ยทยทยท

Hi James,

Guess I can't provide what Jim wants to code, but perhaps the wiki entry I wrote a while ago will help out: http://new.scipy.org/Wiki/Cookbook/Matplotlib/Plotting_values_with_masked_arrays
(apparently the new highlighter messed up some lines, but it is still readable)

Christian

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users