Section: Handle-Based Graphics
print(filename)
or, alternately,
print filename
where filename is the (string) filename of the destined file. The current
fig is then saved to the output file using a format that is determined
by the extension of the filename. The exact output formats may vary on
different platforms, but generally speaking, the following extensions
should be supported cross-platform:
jpg, jpeg -- JPEG file
pdf -- Portable Document Format file
png -- Portable Net Graphics file
--> x = linspace(-1,1);
--> y = cos(5*pi*x);
--> plot(x,y,'r-');
--> print('printfig1.jpg')
--> print('printfig1.png')
which creates two plots printfig1.png, which is a Portable
Net Graphics file, and printfig1.jpg which is a JPEG file.