Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
Please be aware that not all output drivers might be installed on your system. Some output drivers dependent on third-party libraries. If these are missing at compilation time Magics++ can  can not support all formats. Please consult the installation guide for more information.

...

.

...

A special output driver is generating Qt which is only intended for screen display. This driver is used by Metview and is not documented further here.

...

Table 3.1. Output Formats


ValueGraphics File FormatPagesDriver
PSvectorproduces a single file*PostScript
EPSvectorproduces multiple filesPostScript
PDFvectorproduces a single fileCairo
PNGrasterproduces multiple filesCairo
GIFrasterproduces multiple filesGD
GIF_ANIMATIONrasterproduces a single fileGD
JPEGrasterproduces multiple files**GD
SVGvectorproduces multiple filesSVG
KMLvectorproduces single KMZ fileKML
 


*It is also possible to produce multiple single-page PostScript files, see “Page Splitting” below.

...

Table 3.2. Selecting Multiple Output Formats


FORTRAN
CHARACTER*10 FORMATS
    DIMENSION    FORMATS(2)
    DATA         FORMATS /'PS', 'PNG'/

    CALL POPEN
    CALL PSET1C ('OUTPUT_FORMATS', FORMATS, 2)
 CALL PSETC
 ('OUTPUT_NAME',
 'multiformat')
C
const char *formats [NumFormats] = {"PS", "PNG"};

    mag_open  ();
    mag_set1c ("OUTPUT_FORMATS", formats, 2);
 
mag_setc 
("OUTPUT_NAME",
 "multiformat");
MagML
<drivers>
 
<ps scale = '95' />
 
<png />
 
<drivers/>


For a single-page plot, the above code will produce two files: multiformat.ps and multiformat.1.png. The following section explains the file-naming rules in more detail. 


Filenames

For a single-file plot, as produced by PS, PDF and GIF_ANIMATION, the default output filename will be magics.<ext> where <ext> is replaced by the extension appropriate to the output format. For the default format (PostScript) this would produce the file magics.ps, for animated PNG it would be magics.png and so on. The following code shows how to change the filename:

    CALL PSETC ('OUTPUT_NAME', 'plot')

...

Table 3.3. Filename Examples


Default
CALL PSETC ('OUTPUT_FORMAT', 'PNG')
 CALL PSETC ('OUTPUT_NAME', 
'plot')
the resultant files will be:
        plot.1.png
        plot.2.png
        plot.3.png
Note that even if the plot has only one page and therefore produces just one file, the name of that file still obeys the rules in the table above.
First page numbering OFF
CALL PSETC ('OUTPUT_FORMAT',
 
'PNG')
 CALL PSETC ('OUTPUT_NAME',
 'plot')
 CALL PSETC ('OUTPUT_NAME_FIRST_PAGE_NUMBER', 'OFF')
the resultant files will be:
        plot.png
        plot.2.png
        plot.3.png


The formatting of the numbers can be modified through the parameter OUTPUT_FILE_MINIMAL_WIDTH. For instance, setting this to 2 would produce a filename such as plot.02.png instead of plot.2.png.

...

Filenames - Legacy and Fine Control

The above file-naming control should be enough for most purposes and is recommended for the most consistent naming of output files.

However, an extra degree of control is available by not using OUTPUT_NAME, but instead:

  • OUTPUT_FULLNAME : does not add an extension to the supplied filename, instead it needs to be supplied with the file name

  • OUTPUT_LEGACY_NAME : behaves similar to MAGICS 6 filenaming

 

...