Saving image with the plots

Below code segment shows the result correctly on output_axis. I mean, the image C and the plots on the image.
[B,L,N] = bwboundaries(E);
axes(handles.output_axis);
imshow(C);
for k=1:length(B),
boundary = B{k};
if(k<=N)
plot(boundary(:,2),...
boundary(:,1),'r','LineWidth',1.5);
end
end
I need to save the image but I could not achieve this. I use below code to save:
imwrite(getimage(handles.output_axis),file);
It saves only the C image without plots. Please help how can I save the image together with the plots ?

답변 (2개)

Sean de Wolski
Sean de Wolski 2013년 1월 3일

0 개 추천

How about:
doc print
doc saveas
or:

댓글 수: 5

I could not understand how to use them.
saveas(handles.output_axis, 'asd.png');
I tried this but in asd there is only C image again not the plots. Couldnt figure it out.
How about print()?
>>print asd.png -dpng
Yes it works but, I have to save the image on the output axis. How can I give
handles.output_axis
as parameter to the print function. Without this it does not do wwhat I actually want. Thank you very much.
Sean de Wolski
Sean de Wolski 2013년 1월 3일
Huh? What do you mean? What isn't what you want? Do you only want to print the axes?
judy  frost
judy frost 2013년 1월 3일
In gui I have 2 axis, input and output. In the handles.output_axis there is the result I want to print. So I must get the image from this handle(output axis) and save it.

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

카테고리

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

질문:

2013년 1월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by