next up previous contents
Next: 34.49.10 Corel Up: 34.49 Terminal Previous: 34.49.8 Cgi

34.49.9 Cgm

The cgm terminal generates a Computer Graphics Metafile, Version 1. This file format is a subset of the ANSI X3.122-1986 standard entitled "Computer Graphics - Metafile for the Storage and Transfer of Picture Description Information". Several options may be set in cgm.

Syntax:

     set terminal cgm {<mode>} {<color>} {<rotation>} {solid | dashed}
                      {width <plot_width>} {linewidth <line_width>}
                      {"<font>"} {<fontsize>}
                      {<color0> <color1> <color2> ...}

where $<$mode$>$ is landscape, portrait, or default; $<$color$>$ is either color or monochrome; $<$rotation$>$ is either rotate or norotate; solid draws all curves with solid lines, overriding any dashed patterns; $<$plot_width$>$ is the assumed width of the plot in points; $<$line_width$>$ is the line width in points (default 1); $<$font$>$ is the name of a font; and $<$fontsize$>$ is the size of the font in points (default 12).

By default, cgm uses rotated text for the Y axis label.

The first six options can be in any order. Selecting default sets all options to their default values.

Each color must be of the form 'xrrggbb', where x is the literal character 'x' and 'rrggbb' are the red, green and blue components in hex. For example, 'x00ff00' is green. The background color is set first, then the plotting colors. Examples:

     set terminal cgm landscape color rotate dashed width 432 \
                    linewidth 1  'Helvetica Bold' 12       # defaults
     set terminal cgm 14 linewidth 2  14  # wider lines & larger font
     set terminal cgm portrait "Times Italic" 12
     set terminal cgm color solid      # no pesky dashes!

Font The first part of a Computer Graphics Metafile, the metafile description, includes a font table. In the picture body, a font is designated by an index into this table. By default, this terminal generates a table with the following 16 fonts, plus six more with italic replaced by oblique, or vice-versa (since at least the Microsoft Office and Corel Draw CGM import filters treat italic and oblique as equivalent):

CGM fonts  
  Helvetica  
  Helvetica Bold  
  Helvetica Oblique  
  Helvetica Bold Oblique  
  Times Roman  
  Times Bold  
  Times Italic  
  Times Bold Italic  
  Courier  
  Courier Bold  
  Courier Oblique  
  Courier Bold Oblique  
  Symbol  
  Hershey/Cartographic_Roman  
  Hershey/Cartographic_Greek  
  Hershey/Simplex_Roman  
  Hershey/Simplex_Greek  
  Hershey/Simplex_Script  
  Hershey/Complex_Roman  
  Hershey/Complex_Greek  
  Hershey/Complex_Script  
  Hershey/Complex_Italic  
  Hershey/Complex_Cyrillic  
  Hershey/Duplex_Roman  
  Hershey/Triplex_Roman  
  Hershey/Triplex_Italic  
  Hershey/Gothic_German  
  Hershey/Gothic_English  
  Hershey/Gothic_Italian  
  Hershey/Symbol_Set_1  
  Hershey/Symbol_Set_2  
  Hershey/Symbol_Math  
  ZapfDingbats  
  Script  
  15  
The first thirteen of these fonts are required for WebCGM. The Microsoft Office CGM import filter implements the 13 standard fonts listed above, and also 'ZapfDingbats' and 'Script'. However, the script font may only be accessed under the name '15'. For more on Microsoft import filter font substitutions, check its help file which you may find here:
 C:\Program Files\Microsoft Office\Office\Cgmimp32.hlp

and/or its configuration file, which you may find here:
 C:\Program Files\Common Files\Microsoft Shared\Grphflt\Cgmimp32.cfg

In the set term command, you may specify a font name which does not appear in the default font table. In that case, a new font table is constructed with the specified font as its first entry. You must ensure that the spelling, capitalization, and spacing of the name are appropriate for the application that will read the CGM file. (Gnuplot and any MIL-D-28003A compliant application ignore case in font names.) If you need to add several new fonts, use several set term commands.

Example:

     set terminal cgm 'Old English'
     set terminal cgm 'Tengwar'
     set terminal cgm 'Arabic'
     set output 'myfile.cgm'
     plot ...
     set output

You cannot introduce a new font in a set label command.2 fontsize Fonts are scaled assuming the page is 6 inches wide. If the size command is used to change the aspect ratio of the page or the CGM file is converted to a different width, the resulting font sizes will be scaled up or down accordingly. To change the assumed width, use the width option. Linewidth The linewidth option sets the width of lines in pt. The default width is 1 pt. Scaling is affected by the actual width of the page, as discussed under the fontsize and width options Rotate The norotate option may be used to disable text rotation. For example, the CGM input filter for Word for Windows 6.0c can accept rotated text, but the DRAW editor within Word cannot. If you edit a graph (for example, to label a curve), all rotated text is restored to horizontal. The Y axis label will then extend beyond the clip boundary. With norotate, the Y axis label starts in a less attractive location, but the page can be edited without damage. The rotate option confirms the default behavior. Solid The solid option may be used to disable dashed line styles in the plots. This is useful when color is enabled and the dashing of the lines detracts from the appearance of the plot. The dashed option confirms the default behavior, which gives a different dash pattern to each curve. Size Default size of a CGM plot is 32599 units wide and 23457 units high for landscape, or 23457 units wide by 32599 units high for portrait. Width All distances in the CGM file are in abstract units. The application that reads the file determines the size of the final plot. By default, the width of the final plot is assumed to be 6 inches (15.24 cm). This distance is used to calculate the correct font size, and may be changed with the width option. The keyword should be followed by the width in points. (Here, a point is 1/72 inch, as in PostScript. This unit is known as a "big point" in TeX.) Gnuplot expressions can be used to convert from other units.

Example:

     set terminal cgm width 432            # default
     set terminal cgm width 6*72           # same as above
     set terminal cgm width 10/2.54*72     # 10 cm wide

Nofontlist The default font table includes the fonts recommended for WebCGM, which are compatible with the Computer Graphics Metafile input filter for Microsoft Office and Corel Draw. Another application might use different fonts and/or different font names, which may not be documented. As a workaround, the nofontlist option deletes the font table from the CGM file. In this case, the reading application should use a default table. Gnuplot will still use its own default font table to select font indices. Thus, 'Helvetica' will give you an index of 1, which should get you the first entry in your application's default font table. 'Helvetica Bold' will give you its second entry, etc.

The former winword6 option is now a deprecated synonym for nofontlist. The problems involving the color and font tables that the winword6 option was intended to work around turned out to be gnuplot bugs which have now been fixed.


next up previous contents
Next: 34.49.10 Corel Up: 34.49 Terminal Previous: 34.49.8 Cgi
Shigeharu TAKENO
2002年 11月 16日