How to Plot Grid on a Scatter Plot?

23 ビュー (過去 30 日間)
ercan duzgun
ercan duzgun 2021 年 2 月 4 日
編集済み: ercan duzgun 2021 年 2 月 4 日
I want to add grids on that plot below. The grids should joints the points . Like similar to the mesh command.( https://www.mathworks.com/help/matlab/ref/mesh.html )
How can I add the grids onto that plot that you created? Is it possible?
This is continuation of my previous question before here:(https://www.mathworks.com/matlabcentral/answers/735077-how-to-put-dots-on-sphere-mesh-node-points)
For the plot the MATLAB command is:
[x,y,z] = sphere;
x = x(11:end,:);
y = y(11:end,:);
z = z(11:end,:);
r = 1;
figure
scatter3(r.*x(:),r.*y(:),r.*z(:), 0.001+z(:)*100, 'o', 'filled'); %# Plot the surface
axis equal;

採用された回答

Star Strider
Star Strider 2021 年 2 月 4 日
Depending on the result you want, here are some options to experiment with:
[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
figure
scatter3(r.*x(:),r.*y(:),r.*z(:), 0.001+z(:)*100, 'o', 'filled'); %# Plot the surface
hold on
mesh(x,y,z, 'EdgeColor','k', 'LineStyle','-')
hold off
axis equal; %# Make the scaling on the x, y, and z axes equal
figure
mesh(x,y,z, 'EdgeColor','k', 'LineStyle',':', 'FaceAlpha',0.1)
hold on
scatter3(r.*x(:),r.*y(:),r.*z(:), 0.001+z(:)*100, 'o', 'filled'); %# Plot the surface
hold off
axis equal; %# Make the scaling on the x, y, and z axes equal
.
  2 件のコメント
ercan duzgun
ercan duzgun 2021 年 2 月 4 日
編集済み: ercan duzgun 2021 年 2 月 4 日
Dear @Star Strider , thank you so much. I really appreciate your help. :)
Star Strider
Star Strider 2021 年 2 月 4 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by