wolfram mathematica - Speed up ListLinePlot -
i trying use mathematica analyse raw data. i'd able dynamically display range of data i'm interested in using manipulate , listlineplot, plot rendering extremely slow. how can speed up?
here additional details. external text file stores raw data: first column timestamp, second, third , fourth columns data readings, example:
1309555993069, -2.369941, 6.129157, 6.823794 1309555993122, -2.260978, 6.170018, 7.014479 1309555993183, -2.070293, 6.129157, 6.823794 1309555993242, -1.988571, 6.238119, 7.123442 a single data file contains 2·106 lines. display, example, second column, use:
x = import["path/to/datafile"]; listlineplot[x[[all, {1, 2}]]] the execution time of operation unbearably long. display variable range of data tried use manipulate:
manipulate[listlineplot[take[x, numrows][[all, {1, 2}]]], {numrows, 1, length[x]}] this instruction works, crawls when try display more few thousand lines. how can speed up?
some additional details:
- matlab displays same amount of data on same computer instantaneously, raw data size shouldn't issue.
- i tried turn off graphics antialiasing, didn't impact rendering speed @ all.
- using
datarangeavoidtakedoesn't help. - using
maxplotpointsdistorts plot useful. - not using
takeinmanipulatedoesn't help. - the rendering seems take huge amount of time. running
timing[listlineplot[take[x,100000][[all, {1, 2}]]]]returns0.33: means evaluation oftakeinstantaneous, plot rendering slows down. - i running mathematica on ubuntu linux 11.10 using fglrx drivers. forcing mathematica use mesa drivers didn't help.
any hint?
i haven't tested extensively on machine (i have mac, can't rule out linux-specific issues). couple of points occur me. following pretty quick me, slower if data set smaller. plotting hundreds of thousands of data points.
data = accumulate@randomvariate[normaldistribution[], 200000]; manipulate[listlineplot[take[data, n]], {n, 1, length[data]}] - in
manipulate, allowing amount of data showntakevary arbitrarily. try incrementingnumrowsevery 100 or points, there less render. - try using
continuousaction->falseoption (see documentation) (i see @szabolcs had same idea typing. - i suggest
maxplotpoints, instead tryperformancegoal ->"speed"option. (see documentation)
Comments
Post a Comment