How to plot grid-position like figure in Matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Aftab Ahmed Khan
am 7 Mai 2014
Bearbeitet: Star Strider
am 7 Mai 2014
Hello Everyone, I want to plot/make a structure like this in Matlab. Can anyone help me with this ? P.S. I am very new to Matlab as well. Thank you.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162308/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Star Strider
am 7 Mai 2014
This works for the figure on the left:
xy = [1:14]*200;
[X, Y] = meshgrid(xy);
xyo = xy([4 11]);
figure(1)
plot(X, Y, '.k')
hold on
plot(X(:,[4 11]), Y(:,[4 11]), 'ok')
plot(X([4 11],:), Y([4 11],:), 'ok')
plot(X([4 11],[4 11]), Y([4 11],[4 11]), 'sr')
hold off
axis square
This will get you started. Make the necessary changes to get the one on the right. See the documentation for the legend function to get the legend textbox.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!