Export plot(s) or animation(s) to a file or files.
hplot.export()
hplot.export(FNAME[,MAG][,'transient']['range',RANGE])
This method exports the current VTK image or animation (or an range of images) to a file for files. It determines the file type based on the filename extension. Valid file types are
.png | Portable Network Graphics (recommended) |
.tiff | Tagged Image File Format |
.jpg | Joint Photographic Experts Group |
.bmp | Bitmap |
.pnm | Portable Any Map |
.avi | Audio Video Interleave (animation). |
.gif | Graphics Interchange Format (animation) |
If the AVI or GIF extension is used, the current result animation will be saved. Otherwise a static image will be saved. AVI support is not available on Mac or Linux.
FNAME is an optional string specifying the filename to create. If it is not supplied, is empty, or contains wildcards, you will be prompted for the filename with a graphical file dialog.
MAG is an optional scalar specifying the image magnification for file creation. Higher magnification results in better image quality at the expense of bigger file size. The default is 1.
The optional input string 'transient' directs EXPORT to create a transient animation, regardless of the VTKPLOT menu setting. This is only valid for AVI or GIF export.
The optional string/value pair 'range' allows you to export a range of results to files. RANGE is a numeric vector containing the result indices. If empty ([]), EXPORT will export all of the results. This option is not compatible with 'transient'. With this option, FNAME becomes the base filename and extension, <basename>.<extension>. The result index number is appended to <basename> for each result exported. For example, if RANGE = 1:2 and FNAME is 'file_.png', results 1 and 2 are exported to 'file_1.png' and 'file_2.png', respectively.
The output FNAME contains the name of the file(s) created. If a range of files were created, FNAME is a cell array of strings.