why when i try to plot data on image, the plot exceed the image?

조회 수: 2 (최근 30일)
daniel
daniel 2014년 5월 5일
댓글: Image Analyst 2014년 5월 5일
Hello,
while I designed a GUI software, i wrote a function which get as in put the handles of the gui. the function loads image and display it on a axes in the GUI with several plots on it (suppose to..)
now i dont know why but my plots just runs over the image or exceed it without displaying the image with the plots.. This is my code:
axes(results_axes);
hold on
imshow(im);
axis([xmin xmax ymin ymax]);
hold on
endplot(new_edge_points_array(:,2),new_edge_points_array(:,1),'o','MarkerEdgeColor','k','MarkerFaceColor',[0.03 0.96 0.65],'MarkerSize',10)
plot(new_nodes_points_array(:,2),new_nodes_points_array(:,1),'o','MarkerEdgeColor','k','MarkerFaceColor',[0.97 0.41 0.04],'MarkerSize',10)
Example of the final result i want to get:
And this is what i keep getting:
it's probably minor mistake but i couldn't figure what it is
any help guys...Thanks!

답변 (1개)

Image Analyst
Image Analyst 2014년 5월 5일
Put this line in between the call to imshow() and plot():
hold on;
  댓글 수: 2
daniel
daniel 2014년 5월 5일
already did it, still not working? does it relate to the axis modification maybe?
Image Analyst
Image Analyst 2014년 5월 5일
Try this:
axes(results_axes);
hold off
cla reset;
imshow(im);
axis([xmin xmax ymin ymax]);
axis on;
hold on
then call the plots.

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

Community Treasure Hunt

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

Start Hunting!

Translated by