Problems "animated" plot


I visualize experimental data in quasi-realtime while it's acquired.
The x-axis is fixed right from the beginning. However, the y-axis
must be autoscaled depending on the data that's coming in.

So far, I do the following on Windows:


NaN = 0.0

x_values = arange(0, 2 * zyklen, 1.0 / number_of_values)
y_values = total_number_of_values * [NaN]
line, = plot(x_values, y_values)


I have three questions:

1. On Linux, I can say NaN=float("NaN"), which suppresses plot
   points in an area where no plot exists so far. On Windows, I seem
   to be forced to set the un-measures interval to "0". This is
   uglier, is there a better way?

This looks to me like a place where you should try using masked arrays instead of NaN. NaN is not uniformly supported in Python and numerix, but masked arrays, in both numarray and Numeric, can accomplish the same thing and more. See in the mpl examples subdirectory, and see
for an explanation of masked arrays.