How to connect points horizontally and vertically in non-rect grid?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hey,
I've been working on a problem and have gotten stuck. I've been trying to make a grid of points of a customized shape. I've got the X and Y points of the grid, but I don't know how to completely connect them in 2 directions.
Here is what I have:

Notice how the lines connect in one direction. I want it such that lines go through the "O's" as well. How do I pull this off?
General code:
-giant X matrix with X coordinate of each point. -giant Y matrix of Y coordinate of each point.
figure plot(X,Y,'-o')
Thanks for any help / advice you can give.
0 commentaires
Réponse acceptée
Teja Muppirala
le 20 Sep 2013
Idea 1. Use SURF
[x,y] = ndgrid(0:0.1:2); %Just making random data
x = sin(x).*y;
y = x+y.^2;
figure, surf(x,y,zeros(size(x)),'facecolor','none','marker','o','edgecolor','k');
view(2);
Idea 2. Use PLOT twice, the second time with the matrices transposed.
[x,y] = ndgrid(0:0.1:2);
x = sin(x).*y;
y = x+y.^2;
figure, plot(x,y,'o-')
hold on;
plot(x',y','o-')
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Graphics Performance 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!