How to draw a line through a set of points?
Mostra commenti meno recenti
Hi, I have an image and a set of points present in the image. These points are not aligned with each other and I would like to draw a line that intersects the points
3 Commenti
Ameer Hamza
il 3 Nov 2020
Do you have the coordinates of these points?
John D'Errico
il 3 Nov 2020
PLEASE DON'T ASK THE SAME QUESTION REPEATEDLY!
I've deleted my answer. since you already have answers to your last question.
Risposta accettata
Più risposte (1)
Ameer Hamza
il 3 Nov 2020
If you have the coordinates then you can use plot()
img; % your image
x; % x-coordinates of points
y; % y-coordinates of points
imshow(img);
hold on
plot(x, y)
6 Commenti
valerio auricchio
il 3 Nov 2020
Ameer Hamza
il 3 Nov 2020
The answer assumes that x and y are vectors with several points. You can try
plot(A, B)
valerio auricchio
il 3 Nov 2020
Ameer Hamza
il 3 Nov 2020
This is strange behaviour. Normallt
plot(A, B)
should draw a line. But If you do something like this
plot(A, B, '+')
then only markers are shown.
Can you show your code?
Aniket Agrawal
il 10 Giu 2021
how can i store that curve produced using plot(x,y) in a variable.
Rik
il 10 Giu 2021
You can store a handle to the graphics object. Is that what you mean by storing the curve?
Categorie
Scopri di più su Geographic Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
