File Exchange

image thumbnail

print a gif in matlab

version (1.73 KB) by Ben Barrowes
printgif prints gif files in matlab

1 Download

Updated 04 Jun 2010

View License

% printgif(varargin) prints gif files in matlab
% printgif accepts all print arguments in varargin.
% printgif ignores all printer drivers passed to it
% ('-deps', '-dtiff', etc.)
% instead it used the -djpeg100' driver and converts
% the resulting jpg file to a gif using
% imread/rgb2ind/imwrite
% printgif(gcf,'foo')
% prints the file foo.gif

Cite As

Ben Barrowes (2021). print a gif in matlab (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Donn Shull

Hi Ben,

This is a nicely written file with good help, an H1 line and helpful comments in the code. I have a few suggestions if you want to make your function a little more like a MathWorks function.

You may wiant to consider changing the name. When I first saw your submission I thought it was for sending a gif file to a printer. Some alternate names might be fprintgif, writegif, or imwritegif.

Your file has an all lowercase name. This is the standard case for MathWorks api functions. The MathWorks uses an uppercase version of the function name on the H1 line without the argument list. This makes the H1 line stand out and without the arguments list there is more room for the description on the H1 line.

The MathWorks help usually follows the H1 line with some form of syntax help for calling the function and descriptions of the required inputs. You may want to consider explicitly naming the required inputs figure, and filename and checking that they are correct and then explaining them in the help.

The MathWorks includes a See Also section in their help. In this case you may want to reference print, imread, and imwrite.

Your help text is indented one space more than what The MathWorks uses.

These are all just suggestions.


MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!