Code covered by the BSD License  

Highlights from
BUBBLEPLOT3

4.75

4.8 | 12 ratings Rate this file 23 Downloads (last 30 days) File Size: 2.6 KB File ID: #8231
image thumbnail

BUBBLEPLOT3

by Peter (PB) Bodin

 

06 Aug 2005 (Updated 02 Aug 2009)

A simple 3D-bubbleplot.

| Watch this File

File Information
Description

BUBBLEPLOT3(x,y,z,r), where x, y, z and r are four vectors of the
same length, plots bubbles of radii r in 3-space with centers at
the points whose coordinates are the elements of x, y and z. If r
is a matrix of size numel(x)x3, BUBBLEPLOT3 produces ellipsoids with
centers x(i),y(i),z(i) and radii r(i,1), r(i,2) and r(i,3).

BUBBLEPLOT3(x,y,z,r,c), where c is a rgb-triplet array (in [0,1])
with numel(x) rows, plots bubbles with colours specified by c.

BUBBLEPLOT3(x,y,z,r,c,Alpha), where Alpha is a scalar with value from
0.0 to 1.0, plots bubbles with FaceAlpha Alpha.

BUBBLEPLOT3(x,y,z,r,c,Alpha,n,m), where m and n are scalar values that
decides the size of the arrays used to render the bubbles.
The largest radius in the set is rendered with (n+1)x(n+1) points.
To increase efficiency, the number of rendering points used is
decreasing linearly with the radius but is never rendered with
fewer points than (m+1)x(m+1).

BUBBLEPLOT3(x,y,z,r,c,Alpha,n,m,'PropertyName',PropertyValue,...)
Any property-value pair setting valid for a SURFACE object can be
passed as optional parameters.

BUBBLEPLOT3 returns a column vector of handles to surface objects.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
08 Aug 2005 urs (us) schwarz

very nice and cleanly coded snippet, <peter>; one minor rant: it would be nice if you'd call <view3> in the end - and - after all...
us

08 Aug 2005 Peter (PB) Bodin

Thanks <Urs> for the valuable (as always) points. I´ve already made some minor updates and posted the code. The view3 will be added as soon as possible.

15 Aug 2005 Yuri K

That's exactly what I was looking for a long time. Adding lighting after that makes the figure even greater. Thanks a lot, Piter. I'd give more then 5 stars if I could.

01 Sep 2005 Greg Georgalli

Great, exactly what i needed.

16 Sep 2005 Susanna Yang

Thanks for the great code. It helped me a lot...

14 Mar 2006 Theodore Sande

These bubbles look good enought to eat !

17 Oct 2006 arif santoso

no comment

26 Jan 2007 Sanjib Sikder

It was of great help. :))

03 Jun 2008 Hernan R

WOW!! I would give more that 5 start if I could. This is amazing and saved me hours or maybe days of work. And the picture looks really great.

01 Dec 2008 Shi Jin

This is great.
I have a question: what if I want to specify another variable as the color field and use a color bar?
Right now, the c field is a rgb-triplet. What I want is another scalar field, for example, density rho.
Even if I specify c as a rgb triplet, the colorbar is still using the z values. Is this something that can be added?
Thanks.

Shi

06 Dec 2010 Ryan Molecke

Thank you for this!

05 Apr 2011 Sonia Chikh

thx a lot!! it helped much

21 Jul 2011 Yasser Khan

Exactly what I needed to plot 3D spheres, takes in three coordinates arrays and one for radius. Then, ta-da! Thanks.

22 Jul 2011 Wuhan University

It is very helpful.Thanks.

Please login to add a comment or rating.
Updates
09 Aug 2005

This version allows the bubbles to be ellipsoids as well as spheres.

15 Aug 2005

small changes

02 Aug 2009

licensing

Tag Activity for this File
Tag Applied By Date/Time
specialized Peter (PB) Bodin 22 Oct 2008 07:55:09
plotting Peter (PB) Bodin 22 Oct 2008 07:55:09
bubbleplot Cristina McIntire 06 Feb 2009 10:54:59
3d Cristina McIntire 06 Feb 2009 10:54:59
bubble Cristina McIntire 06 Feb 2009 10:54:59
3d Kameliya Koleva 07 Apr 2010 09:57:13
bubble Ian Howat 12 Jun 2010 07:35:22

Contact us at files@mathworks.com