如何在所有缩放级别实时准确地绘制大数据向量? [英] How to plot large data vectors accurately at all zoom levels in real time?

查看:188
本文介绍了如何在所有缩放级别实时准确地绘制大数据向量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大量数据(10 Hz数据,每24小时864k点),我需要实时绘制。我们的想法是用户可以缩放并平移到非常详细的散点图。

I have large data sets (10 Hz data, so 864k points per 24 Hours) which I need to plot in real time. The idea is the user can zoom and pan into highly detailed scatter plots.

数据不是很连续且有尖峰。由于数据集太大,每次绘图刷新时都无法绘制每个点。

The data is not very continuous and there are spikes. Since the data set is so large, I can't plot every point each time the plot refreshes.

但我也不能只绘制每个n点,否则我将错过大而短的尖峰等主要功能。

But I also can't just plot every nth point or else I will miss major features like large but short spikes.

Matlab做得对。你可以给它一个864k向量的零,只需将任意一个点设置为1,它就可以用缩放和平移实时绘制。

Matlab does it right. You can give it a 864k vector full of zeros and just set any one point to 1 and it will plot correctly in real-time with zooms and pans.

Matlab如何是吗?

How does Matlab do it?

我的目标系统是Java,所以我会在Swing / Java2D中生成这个图的视图。

My target system is Java, so I would be generating views of this plot in Swing/Java2D.

推荐答案

您应该尝试MATLAB Central中的文件:

You should try the file from MATLAB Central:

https://mathworks.com/matlabcentral/fileexchange/15850-dsplot-downsampled-plot

来自作者:

这个版本的情节将允许您可视化具有的数据非常多的元素。绘制大型数据集会使您的图形变得迟钝,但大多数情况下您不需要绘图中显示的所有信息。您的屏幕只有很多像素,您的眼睛将无法检测到屏幕上未捕获的任何信息。

This version of "plot" will allow you to visualize data that has very large number of elements. Plotting large data set makes your graphics sluggish, but most times you don't need all of the information displayed in the plot. Your screen only has so many pixels, and your eyes won't be able to detect any information not captured on the screen.

此函数将对数据进行下采样并仅绘制数据的子集,从而提高内存要求。放大绘图后,将显示更多信息。做了一些工作以确保捕获异常值。

This function will downsample the data and plot only a subset of the data, thus improving the memory requirement. When the plot is zoomed in, more information gets displayed. Some work is done to make sure that outliers are captured.

语法:

dsplot(x, y)  
dsplot(y)  
dsplot(x, y, numpoints)  

示例:

x =linspace(0, 2*pi, 1000000);  
y1=sin(x)+.02*cos(200*x)+0.001*sin(2000*x)+0.0001*cos(20000*x);  
dsplot(x,y1);

这篇关于如何在所有缩放级别实时准确地绘制大数据向量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆