Exporting MATLAB Subplots

I am trying to plot 3 shapes in MATLAB and they come out very well in MATLAB. Here is a screenshot of what it looks like in MATLAB. (i.e. after executing my script) enter image description here

However, when I save it with print -djpeg -r300 Output.jpeg

, it looks like this: enter image description here

How can I fix it without downloading files from FileExchange? However, I went through similar SE questions, they all recommend using the files available on FileExchange.

Here's what I've already tried:

set(gcf, 'PaperUnits', 'inches');
set(gcf, 'PaperSize', [10 10]); 
set(gcf, 'PaperPosition', [0 0 10 10]);%No improvement

      

+3


source to share


1 answer


Try set(gcf, 'PaperPositionMode','auto')



It will adjust the print size to fit the shape. It will solve all the relative sizing problems you have :)

0


source







All Articles