How do I make a scatter plot with spheres?

15 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2010 年 6 月 21 日
I am using SCATTER3 to generate my plot. I would like the circles to be spheres instead.

採用された回答

MathWorks Support Team
MathWorks Support Team 2010 年 6 月 21 日
In order to produce a scatter plot with 3D objects like a ball you can use the SPHERE function to generate the object surface data and then use the X,Y and Z coordinates that you used with SCATTER3 function as the center coordinates of the each sphere. You may generate your plot using a script similar to the one found in the attached file 'my3dplot.m'.
The x,y and z vectors in this script can essentially be replaced with the 3D coordinates of your data. These coordinates will act as the center of the sphere defined by x1,y1 and z1.
To alter the size of each sphere, vary the scale factor by which x1,y1 and z1 are multiplied (SPHERE function generates unit spheres) .You can specify the sphere color through the use of the 'FaceColor' property when calling the SURF function.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R14SP2

Community Treasure Hunt

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

Start Hunting!

Translated by