title: How do I save a plotted image and maintain the original image size in MATLAB?
body: <p>I'd like to show an image and plot something on it and then save it as an image with the same size as the original one. My MATLAB code is:</p>
  
  <pre><code>figH = figure('visible','off');
  imshow(I);
  hold on;
  % plot something
  saveas(figH,'1','jpg');
  close(figH);
  </code></pre>
  
  <p>But the resulting image "1.jpg" has saved non-image areas in the plot as well as the image. How can I solve this problem?</p>