Save figure to file, choose the dimensions and crop figure

Save figure to file. Choose the dimensions and crop figure (remove homogeneous edges).
1.6K 次下载
更新时间 2014/7/15

查看许可证

USAGE
fig_print(fig,figname)
fig_print(fig,figname,dim)
fig_print(fig,figname,dim,crop)
fig_print(fig,figname,dim,crop,magn_factor, bg_color)

INPUT
- FIG: figure handle
- FIGNAME: file name, including extension (BMP, JPG, PNG or TIF)
- DIM: 1x2 numeric array with the image dimensions. If DIM=[], the current figure size times MAGN_FACTOR will be used.
- CROP: 1 (crop image) or 0 (do not crop [default]). Remove homogeneous edges
- MAGN_FACTOR: magnification factor (any positive number). Only effective when DIM=[]. Default: 1
- BG_COLOR : If specified, the figure window background color will be changed. You can specify a color using a three-element vector of RGB values or one of the MATLAB predefined names (short name: 'y', 'm', 'c', 'r', 'g', 'b', 'w', 'k')

OUTPUT
- FIGNAME in the current folder or in the folder specified by its path. The file format depends on the given extension.

引用格式

Guilherme Coco Beltramini (2024). Save figure to file, choose the dimensions and crop figure (https://www.mathworks.com/matlabcentral/fileexchange/42035-save-figure-to-file-choose-the-dimensions-and-crop-figure), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Printing and Saving 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.2.0.0

Added the option to change the figure background color

1.1.0.0

Added screenshot

1.0.0.0