plotting data into an image with plot function

Hello everyone I got the following problem.
I loaded an image into MatLab now the image has a matrix of 720x752x3
I have a Data matrix that is 10x2
I want to plot the datapoints into my image but when I use normal plot I get an error that my data has more than 2 dimensions. Does anyone have an idea how to fix that?
Thanks for helping me

댓글 수: 8

Adam I think you mean https://in.mathworks.com/matlabcentral/answers/452798-plotting-data-into-a-image , the link you posted redirects to this page.
Adam Danz
Adam Danz 2019년 3월 27일
Thanks!
@Andre589 since these two posts address the same question, please delete one of them.
Andre589's answer moved here:
Oh sorry for me it didnt show up in my profile so I thought I might did a mistake creating the question again now I deleted one
Jan
Jan 2019년 3월 27일
Please post the code and a copy of the complete message. Then explain, how the result should look like. There is no unique definition of "plot the datapoints into my image".
Adam OP deleted the other question.
Adam Danz
Adam Danz 2019년 3월 27일
편집: Adam Danz 2019년 3월 27일
Ahhh, now things are tidy again ;)
@ Andre589 I'd be glad to help but I agree with Jan that we need to see your code.
clear all
close all
I = imread('test.png');
imshow(I)
C = [115 182
225 113
328 58
515 426
422 460
309 535
100 150
478 628
322 411
490 541 ];
plot(C,?)
The result should look like I get the data points I have in my Matrix C into my image I

댓글을 달려면 로그인하십시오.

답변 (1개)

Adam Danz
Adam Danz 2019년 3월 27일

0 개 추천

I'm guessing that you want to plot the coordinates listed in C on top of the image.
I = imread('test.png');
imshow(I)
axis on %this will show you the axis ticks; note the y axis is reversed!
hold on
plot(C(:,1), C(:,2), 'bx')

댓글 수: 2

Andre589
Andre589 2019년 3월 27일
Yes thank you for your help just before I looked here I found out myself :)
Adam Danz
Adam Danz 2019년 3월 27일
편집: Adam Danz 2019년 3월 27일
Nice work! If your solution differed greatly from mine, you should share it here so others who are looking for similar solutions can learn from your work.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2019년 3월 27일

편집:

2019년 3월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by