[SciPy-User] Efficient replacement to matlab textscan

Tim Pitman tapitman11@gmail....
Wed Oct 5 20:57:36 CDT 2011


Hi All,

I'm working on a project which currently uses matlab to generate a
real time plot which uses textscan
(http://www.mathworks.com/help/techdoc/ref/textscan.html) to read a
file with about 800 float values (all in one column but each on it's
own line) every other point is the x value and the off values are the
y values, totaling about 400 points. The function then plots all the
points. This is done about 10 times per second providing a constantly
updating graph. Matlab uses about 9% CPU when this is running. I'm
trying to replace this with numpy/matplotlib in a wxPython app. My
wxPython app runs at about 20% CPU without the plot running but once I
start the plot at 10 updates per second CPU usage jumps up to %70
percent. I'm currently using genfromtxt to read the file. I'm looking
for suggestions on how to optimize this as much as possible.

Thanks!
Tim


More information about the SciPy-User mailing list