Hello, I am trying to place a plot over an image and is not working.
CODE: a=[xu,xl]; %start and end x coordinates of blue line
b=[yl,yr]; %start and end y coordinates of blue line
c=[xu,xl]; %start and end x coordinates of green line
d=[yr,yl]; %start and end y coordinates of green line
imshow(img), colormap jet
hold on
plot(a,b,'blue',c,d,'green')
hold off
Does anyone has any ideia of what's wrong?
Thanks!

 채택된 답변

Joseph Cheng
Joseph Cheng 2017년 3월 31일
편집: Joseph Cheng 2017년 3월 31일

1 개 추천

I would check your points. i see that b and d are swapped, but is there sufficient distances for you to see it with the image behind? are you sure that there isn't just a 1~2 pixel line somewhere or that start and end points are the same. you could be drawing a dot, or too small of a line to notice anything.
x = rand(500,500,3);
a=[0 500];
b = [0 500];
c = [500 0];
d = [250 0];
imshow(x),colormap jet
hold on
plot(a,b,'blue',c,d,'green')
works and draws the image and lines.

댓글 수: 1

turningpoint
turningpoint 2017년 3월 31일
You are right! I was using the smaller version of the image(scatterbrain) Thanks a lot!

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

추가 답변 (0개)

카테고리

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

태그

질문:

2017년 3월 31일

댓글:

2017년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by