|On this page…|
The MuPAD® kernel uses an xml format to communicate with the renderer. Usually, a plot command in MuPAD sends a stream of xml data directly to the viewer which renders the picture.
After double clicking on the picture, the viewer (see section Viewer, Browser, and Inspector: Interactive Manipulation) provides a menu item ‘Edit/Export…' that opens a dialog allowing to save the picture in a variety of graphical formats:
The ‘VCam Graphics' format, indicated by the file extension ‘.xvz'. This is a compressed version of the xml ascii data used by MuPAD.
The ‘Uncompressed VCam Graphics' format, indicated by the file extension ‘.xvc,' saves these xml data in an uncompressed ascii file (the resulting file can be read with any text editor).
One can use the MuPAD graphics tool ‘VCam' to open such files and display the xml data.
Further, there are various standard bitmap formats such as bmp, jpg, eps etc. in which the image may be stored.
MuPAD plots can also be saved in "batch mode" by specifying the attribute OutputFile = filename in a plot call:
plot(primitives, OutputFile = "mypicture.xvz"):
Here, the extension .xvz of the file name "mypicture.xvz" indicates that the MuPAD xml data are to be written and, finally, the file is to be compressed. Alternatively, the extension .xvc may be used to write the xml data without final compression of the file (the resulting text file can be read with any text editor). Files in both formats can be opened by the MuPAD graphics tool ‘VCam' to generate the plot encoded by the xml data.
If the MuPAD environment variable WRITEPATH does not have a value, the previous call creates the file in the directory where MuPAD is installed. An absolute pathname can be specified to place the file anywhere else:
plot(primitives, OutputFile = "C:\\Documents\\mypicture.xvz"):
Alternatively, the environment variable WRITEPATH can be set:
WRITEPATH := "C:\\Documents": plot(primitives, OutputFile = "mypicture.xvz"):
Now, the plot data are stored in the file ‘C:\Documents\mypicture.xvz'.
If a MuPAD notebook of is saved to a file, its location is available inside the notebook as the environment variable NOTEBOOKPATH. If you wish to save your plot in the same folder as the notebook, you may call
plot(primitives, OutputFile = NOTEBOOKPATH."mypicture.xvz"):
Apart from saving files as xml data, MuPAD pictures can also be saved in a variety of standard graphical formats such as jpg, eps, svg, bmp etc. In batch mode, the export is triggered by the OutputFile attribute in the same way as for saving in xml format. Just use an appropriate extension of the filename indicating the format. The following commands save the plot in four different files in jpg, eps, svg, and bmp format, respectively:
plot(primitives, OutputFile = "mypicture.jpg"): plot(primitives, OutputFile = "mypicture.eps"): plot(primitives, OutputFile = "mypicture.svg"): plot(primitives, OutputFile = "mypicture.bmp"):
On Windows® systems, an animated MuPAD plot can be exported to avi format:
plot(plot::Function2d(sin(x - a), x = 0..2*PI, a = 0..5) OutputFile = "myanimation.avi"):
If no file extension is specified by the file name, the default extension .xvc is used, i.e., compressed xml data are written.
OutputOptions = [<ReduceTo256Colors = b >, <DotsPerInch = n1>, <Quality = n2>, <JPEGMode = n3>, <EPSMode = n4>, <AVIMode = n5>, <WMFMode = n6>, <FramesPerSecond = n7>, <PlotAt = l1>]
Each entry of the list is optional. The parameters are:
|b||TRUE or FALSE. Has an effect for export to some raster formats only. With TRUE, only 256 different colors are stored in the raster file. The default value is FALSE.|
|n1||Positive integer setting the resolution in dpi (dots per inch). Has an effect for export to raster formats only. The default value depends on the hardware.|
|n2||One of the integers 1, 2, …, 100. This integer represents a percentage value determining the quality of the export. Has an effect for jpg, 3D eps, 3D wmf, and avi export only. The default value is 75.|
|n3||0, 1, or 2. Has an effect for jpg export only. The flag 0 represents the jpg mode ‘Baseline Sequential,' 1 represents ‘Progressive,' 2 represents ‘Sequential Optimized.' The default value is 0.|
|n4||0 or 1. Has an effect for eps export only. The flag 0 represents the eps mode ‘Painter's Algorithm,' 1 represents ‘BSP Tree Algorithm.' The default value is 0.|
|n5||0, 1 or 2. Has an effect for avi export only. With 0, the ‘Microsoft® Video 1 Codec' is used. With 1, the ‘Uncompressed Single Frame Codec' is used. With 2, the ‘Radius Cinepak Codec' is used. The default value is 0.|
|n6||0, 1 or 2. Has an effect for wmf export only. With 0, the ‘Painter's Algorithm' is used. With 1, the ‘BSP Tree Algorithm' is used. With 2, a ‘embedded bitmap' is created. The default value is 0.|
|n7||Positive integer setting the frames per second for the avi to be generated. Has an effect for avi export only. The default value is 15.|
|l1||List of real values between TimeBegin and TimeEnd which determines the times at which pictures should be saved from an animation.|