Plotting beyond memory capabilities
2 次查看(过去 30 天)
显示 更早的评论
I'm looking for a way to dynamically plot a large dataset.
It should be able to behave like this:
I plot 3 segments of the data with a window that views 1 of them, the window can be adjusted to view half of segment 2 and segment 3
when the view is moved far enough into segment 3 then the plot bounds will update and segment 1 will be throw out of memory and segment 4 added so that it will function the same but now will be looking further down the data.
Essentially I have more data than can comfortable fit in memory and I want to visualize it (not necessarily all at once) but not have to continually generate new plots. It is also important to be able to pretend like the separation of the data doesn't exist when viewing.
0 个评论
回答(2 个)
KSSV
2017-7-28
编辑:KSSV
2017-7-28
% some random data
x = rand(1000,1) ;
y = rand(1000,1) ;
z = rand(1000,1) ;
% reshape to plot them in small chunks
X = reshape(x,10,[]) ;
Y = reshape(y,10,[]) ;
Z = reshape(z,10,[]) ;
% 2D plot
h = plot(nan,nan,'r') ;
% 3D plot
% h = plot3(nan,nan,nan,'r') ;
% loop for each chunk
for i = 1:size(X,1)
% 3D
% set(h,'XData',X(:,i),'YData',Y(:,i),'ZData',Z(:,i)) ;
% axis([min(X(:,i)) max(X(:,i)) min(Y(:,i)) max(Y(:,i)) min(Z(:,i)) max(Z(:,i))])
% 2D
set(h,'XData',X(:,i),'YData',Y(:,i)) ;
axis([min(X(:,i)) max(X(:,i)) min(Y(:,i)) max(Y(:,i))])
drawnow
pause(0.1)
end
0 个评论
Steven Lord
2017-9-22
If you have data that is too large to fit in memory that you want to plot, see if you can update to release R2017b. We added support for tall arrays to the plot, scatter, and binscatter functions in that release.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!