|
From: sfeam (E. Merritt) <eam...@gm...> - 2012-10-06 17:03:42
|
On Friday, 05 October 2012, pl...@pi... wrote: > On 10/04/12 16:37, Clement Law wrote: > > One question I have is that the harmonic mean is not defined for > > numbers less than or equal to 0. Should I have harmean4() return 0 in > > these cases? > > > > Clement Law > > If the value is not defined then it should probably return NaN rather > than zero , which would be an incorrect result. > > Presumably physical data where this is the appropriate mean would only > go zero or negative if there was an error in the data. > > Thanks, Peter. I agree. However, the pm3d code currently treats NaN as if it were zero anyhow, so as a practical matter the plot would not come out any different. The "with image" plot modes recognize NaN and do not draw the corresponding rectangular pixel. Should we make pm3d do the same? I haven't looked to see how much work that would be. Ethan |