plotting data into an image with plot function

6 ビュー (過去 30 日間)
Andre589
Andre589 2019 年 3 月 27 日
編集済み: Adam Danz 2019 年 3 月 27 日
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 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.
Andre589
Andre589 2019 年 3 月 27 日
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 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by