A more (computational) performant way to plot multiple scatter3 plots in a figure

조회 수: 2 (최근 30일)
John Deer
John Deer 2021년 2월 19일
답변: darova 2021년 2월 19일
I often need to plot multiple scatter3 plots in one figure.
My usual way works fine and is like this:
figName = 'Something';
figure('Name',figName,'Numbertitle','off');
hold on;
for(cnt = 1:size(patchListe,1))
xval = patchListe{cnt,5}(:,1);
yval = patchListe{cnt,5}(:,2);
zval = patchListe{cnt,5}(:,4);
xmed = mean(xval);
ymed = mean(yval);
zmax = max(zval) ;
scatter3(xval,yval,zval,1,zval);
text(xmed,ymed, zmax, num2str(cnt));
end
colormap(jet(200)); colorbar;
title(['Something else', 'Interpreter', 'none');
grid on;
The result is the desired plot.
But the plot is very lazy.
Working with the plot, like Changing colormap or close the figure, takes several seconds
Is there a way to get a more performant and quicker working plot?
Btw: opengl is in fully hardware support mode

답변 (1개)

darova
darova 2021년 2월 19일
Use plot3 instead of scatter3
Scatter is verry expensive function

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by