How to Put Dots on Sphere Mesh Node Points?

9 ビュー (過去 30 日間)
ercan duzgun
ercan duzgun 2021 年 2 月 3 日
コメント済み: Star Strider 2021 年 2 月 4 日
I found those codes for drawing a sphere. I can get the x,y,z coordinates.
I would like to use those x,y,z coordinates. But I don't want to color the sphere by using the surf command. In state, I want it to leave the sphere blank by only with the mesh lines. Then I want to plot a single point on each mesh nodes according to radius. There would be dots on each mesh nodes. And the radius of the dots would be varying by z coordinates. For example, for the downside, the dots would be small, on the upside the dots would be bigger.
[x,y,z] = sphere; %# Makes a 21-by-21 point sphere
x = x(11:end,:); %# Keep top 11 x points
y = y(11:end,:); %# Keep top 11 y points
z = z(11:end,:); %# Keep top 11 z points
r = 1; %# A radius value
surf(r.*x,r.*y,r.*z); %# Plot the surface
axis equal; %# Make the scaling on the x, y, and z axes equal

採用された回答

Star Strider
Star Strider 2021 年 2 月 3 日
編集済み: Star Strider 2021 年 2 月 3 日
Try this (replacing the surf call):
figure
scatter3(r.*x(:),r.*y(:),r.*z(:), 0.001+z(:)*100, 'o', 'filled'); %# Plot the surface
axis equal; %# Make the scaling on the x, y, and z axes equal
EDIT — (3 Feb 2021 at 15:29)
Added plot figure:
.
  4 件のコメント
ercan duzgun
ercan duzgun 2021 年 2 月 4 日
Dear @Star Strider, than you again for your help. I have another question now. I want to add grids on that plot. I asked that question on a seperated question here (https://www.mathworks.com/matlabcentral/answers/736012-how-to-plot-grid-on-a-scatter-plot), if you could answer it too? Thanks.
Star Strider
Star Strider 2021 年 2 月 4 日
I just did!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by