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!