How to Plot Grid on a Scatter Plot?
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ercan duzgun
le 4 Fév 2021
Modifié(e) : ercan duzgun
le 4 Fév 2021
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/509462/image.png)
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;
0 commentaires
Réponse acceptée
Star Strider
le 4 Fév 2021
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!