From: Fabrice S. <si...@lm...> - 2008-05-22 16:00:06
|
Hello, I want to plot data containing nan values, but it seems that matplotlib forget some non-nan values near nan values. In the attached image, I plotted in blue the array for increasing of x-data, and in red for decreasing x-data : import numpy as NX In [1]: from pylab import figure, plot, show In [2]: figure(2) Out[2]: <matplotlib.figure.Figure instance at 0x8445c8c> In [3]: type(Freq) Out[3]: <type 'numpy.ndarray'> In [4]: NX.any(NX.isnan(Freq)) Out[4]: True In [5]: type(Grillefr) Out[5]: <type 'numpy.ndarray'> In [6]: NX.any(NX.isnan(Grillefr)) Out[6]: False In [7]: plot(Grillefr, Freq, 'b', lw=2.) Out[7]: [<matplotlib.lines.Line2D instance at 0x9245e8c>] In [8]: plot(Grillefr[::-1], Freq[::-1], 'r', lw=0.5) Out[8]: [<matplotlib.lines.Line2D instance at 0x9245fec>] In [9]: show() with Grillefr containing values from 100 to 2000. In the matplotlibrc, I have : maskedarray : True Can anybody explain me why some points are not drawn by matplotlib ? -- Fabrice Silva <si...@lm...> LMA UPR CNRS 7051 - équipe S2M |