The first one contains 10000 points per line (3 lines total), the second one, 50 million. When done correctly, it should be impossible to tell the difference between the original plot and one that has been subsampled. A plot of only two values (min and max) would look the same at this zoom level. The right panel is the same line plot but zoomed out where only the minimum and maximum are visible. Figure 1: Left panel shows a basic line plot. Plotting anything besides the maxima and the minima does not add to any visual information, but can slow down the rendering of the graphic. This diagram is meant to illustrate that something which may look complex can be summarized by its extremes when only plotted over the width of a single pixel. The following figure demonstrates a simple signal (left) that when zoomed out appears as a vertical line (right) stretching from its maxima to its minima. When plotting a lot of points, using lines, only the local maxima and minima are visible. Tucker’s code, and mine, works by plotting only a subset of the data points in such a way that it looks like all of the data has been plotted. The following post describes my steps towards speeding up Matlab time-series plots even further, in some cases speeding up Matlab plotting by a factor of over 100x. Īlthough Tucker’s code noticeably sped up plotting, plots were still not plotting/updating as fast as I wanted. I stumbled upon the following submission by Tucker McClure on the Mathworks File Exchange, –big. In the mean time, I took to the internet to see if there was some way of plotting large data, specifically time-series line plots, more quickly in Matlab (more on what a time-series line plot is in a second). Ideally, this is something that Matlab would do better without requiring external tooling. This is not a long time for running a complicated batch analysis, but in the world of data exploration and analysis, in the world of user interaction, it is forever. Zooming and panning then takes multiple seconds as well. In reality plotting may take upwards of 10s of seconds (not forever). Events lasting a couple hundred microseconds will be collected on scales of 10s of minutes to hours. This is particularly true for the type of data I work with that at times contains many tens, if not hundreds of millions of data points. Occasionally however, for large data sets, plotting seems to take forever. Plots render at reasonable rates and interacting with those plots is pleasant. Normally plotting in Matlab is relatively uneventful. Besides using OpenMP and SIMD in C-mex, I also got to learn a little bit about RAM bandwidth.Ĭode for this post can be found at: Introduction This post describes my efforts at reducing the time it takes Matlab to render a time-series line plot, ultimately speeding up Matlab plotting in some cases by over 100x.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |