I am using MATLAB R2014b on Mac OS X 10.10 Yosemite. Since I will be plotting a large amount of figures, I am seeking for a parallel computing solution. The test code I am using is as follows:
parfor ii=1:12
figure(ii);plot(ii*2:ii:ii*10000);
set(ii,'PaperPositionMode','auto','Color',[1 1 1]);
set(ii,'Units','pixels','Position',[0 0 1200 800]);
saveas(ii,[num2str(ii),'test.png']);
end
MATLAB was able to generate the figures with the correct filename. However, the saved image is strangely cropped. An example of the images can be found here:
I tried removing the two lines which set the image size and paper position, however the problem still exists.
I would like to know what I have done wrong, or it is simply a bug with MATLAB R2014b.
Regards, Jonathan
Update:
Just found out that such a problem does not exist with contour plots.