File Exchange

image thumbnail

fscatter3.m

version 1.1.0.0 (1.78 KB) by Felix Morsdorf
Makes 3d scatter plot much faster than scatter3.

12 Downloads

Updated 28 Sep 2010

View License

Uses a loop in order to plot colour classes as line objects (plot3) for colouring 3d points.Much faster than scatter3, does not need as much memory.Very useful with large point clouds.

Comments and Ratings (17)

Mau Tien

Great code. Thank you.

hello,
i tried to use function fscatter3 but i have some errores in colormap(cmap) i don't why it's not working
Any body have exemble how can use function fscatter3
Thanks !

Tan Trinh

Awesome code. Thank you!!!

I replaced:
ii = round(interp1([floor(mins) ceil(maxs)],[1 numclass],C));
with
ii=floor(numclass*(Z-minz)/(maxz-minz));
to make the colormap vary wrt Z axis.
That was what I needed anyway...
Thanks for the code.
SG

Me Cas

Been of great help. Excellent.

Tom Geukens

Now we're talking! I was just about to toss Matlab out because of it's horrible graphing for REAL 3D data, but this is just perfect. Great Job!

Emmanuel FARHI

Excellent and fast

root server

Works much faster than griddata + surf

Douglas Lanman

Tom D

I changed the last part so that zeros for Z values will be interpreted as a 2D scatter:

if ~minz & ~maxz
axis([minx maxx miny maxy])
else
axis([minx maxx miny maxy minz maxz])
axis image
end

B. Schönwälder

Works nice, though I had to
drop the "axis image" statement on the last line -
otherwise all three axes are locked to
equal scaling, and that might not be what you are looking for in general. The code is basic, but easy to adapt - surprising speed!

Mathias Laurin

saves time, but the FLOOR and CEIL functions line 40 prevent from using the full color scale; I'd recommand dropping them:
ii = round(interp1([mins maxs],[1 ...
numclass],C));

Mads Hvid Ribergaard

Extremely useful.

Previous I had memory problems when using scatter on huge datasets. But now it is no longer a problem!!!

I had rewritten it to 2D (scatter), by obmitting "Z" in the code and replaced plot3 with plot.

I B

VERY USEFULL when you are working with huge amount of data sets!

Updates

1.1.0.0

Works with latest matlab, code speeded up a bit, new additional structure input option for laser data (raw.x-z and raw.int), default colorbar is now plotted.

1.0.0.0

changed default colorbar to hsv ;-) (replacing the not publicly available ocean2)

changed default colormap to hsv ;-)

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: adinutzyc21/BundlerToMatlab

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor