You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
This function crops annoying borders from the figures. Useful for using before exporting as a PDF with the saveas command from MATLAB.
Example: simple figure with padding
fh = figure;
plot(1:100,cos(1:100));
cropFigure(fh,10); % adds a padding of 10/2 pixels to each side of the figure (10 pixels horizontally and 10 vertically)
Example: figure with many panels:
subplot(2,2,1);plot(1:100,cos(1:100));
subplot(2,2,2);plot(1:100,cos(1:100));
subplot(2,2,3);plot(1:100,cos(1:100));
subplot(2,2,4);plot(1:100,cos(1:100));
cropFigure
General Information
- Version 2.0.0 (3.72 KB)
MATLAB Release Compatibility
- Compatible with R2008a and later releases
Platform Compatibility
- Windows
- macOS
- Linux
