How to save the contour as a image?

77 views (last 30 days)
I am generating the contours with the code below but would like to know, how to save that contour as an image into the folder, do not mind the format of the picture it will be saved in!
I = imread(frame1.jpg);
imcontour (I,2);
I am not sure what other command to use after imcontour to save it directly as a image, I can save manually by using figure() but is there a way that I can save it directly to some folder.

Accepted Answer

KSSV on 20 Jul 2020
Read about saveas.
saveas(gcf,'myFigure.png') ;
  1 Comment
muhammad choudhry
muhammad choudhry on 20 Jul 2020
Thanks alot for the link bro, worked!

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 21 Jul 2020
If you have r2020a or later, use exportgraphics().


Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by