How can a plot similar to this one can be done? with squares and dotted lines on each horizontal and vertical direction?

1 view (last 30 days)
juan sanchez
juan sanchez on 6 Oct 2021
Commented: juan sanchez on 5 Nov 2021
How can a plot similar to this one can be done? with squares and dotted lines on each horizontal and vertical direction?

Accepted Answer

DGM
DGM on 6 Oct 2021
Edited: DGM on 6 Oct 2021
If you know where the vertices are, it should be fairly simple. Consider the very simplified example.
x = [0 10 10 0 0];
y = [0 0 10 10 0];
plot(x,y,'k'); hold on;
x = [0 2 2 4 4];
y = [6 6 8 8 10];
plot(x,y,'k:')
axis equal
xlim([-5 15])
ylim([-5 15])
Whether you explicitly define your vertices as literal vectors or whether you derive them from some CAD file shouldn't make much difference.
  3 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!