A fast scatter plot
h=fastscatter(X,Y,C [,markertype,property-value pairs])
Inputs:
X,Y: coordinates
C: color
Examples:
N=100000;
fastscatter(randn(N,1),randn(N,1),randn(N,1))
N=100;
fastscatter(randn(N,1),randn(N,1),randn(N,1),'+','markersize',7)
______________________________________
An illustrative example of the speed-up when using fastscatter over scatter:
N=200000;
X=randn(N,1);Y=randn(N,1);C=X.^2+Y.^2+randn(N,1);S=ones(N,1);
tic; for ii=1:10, clf; fastscatter(X,Y,C); drawnow; end; fastscatter_time=toc
tic; for ii=1:10, clf; scatter(X,Y,S,C); drawnow; end; regularscatter_time=toc
speed_increase=regularscatter_time/fastscatter_time
fastscatter_time = 3.4 seconds
regularscatter_time = 63.3 seconds
speed_increase = 18x
And for N=400000, the performance boost was ~38x.
Cita come
Aslak Grinsted (2024). fastscatter.m (https://www.mathworks.com/matlabcentral/fileexchange/47205-fastscatter-m), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- MATLAB > Graphics > 2-D and 3-D Plots > Discrete Data Plots >
- MATLAB > Graphics > 2-D and 3-D Plots > Animation >
Tag
Riconoscimenti
Ispirato: fastscatterm
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.