|
GDName:
GIF is the most popular format. However, Dataplot (and free software in general) will not support it due to patent issues. (NOTE 3/2006: The patent is no longer being enforced, so free software can now support GIF without paying a royalty). JPEG is primarily intended for photographic type images, although it can be used for basic plotting images as well. PNG was developed as a free and non-patented alternative to GIF. It is the primary image format for a number of popular software programs (for example, Perl). Built-in support is available for JPEG files on just about all graphics capable browsers. PNG is slightly less well supported, but it is gaining in popularity. In particular, reasonably current versions of Netscape and Internet Explorer provide built-in PNG viewers (i.e., no external plug-ins need to downloaded and installed), so it can be used with <img> tags in the same fashion as GIF and JPEG images. Although GIF, JPEG, and PNG images can be created from Dataplot Postscript files using one of the numerous image conversion programs now available, it is still convenient to be able to generate these files directly from Dataplot. This can now be done using the GD device driver. Note that Postscript files may still be of interest for some applications due to the fact that the typeset quality fonts in Postscript can generate higher quality images. In addition to web applications, PNG and JPEG images provide an alternative for importing Dataplot graphics into word processors and other programs. Although Postscript images provide the highest quality graphics for this purpose, PNG and JPEG graphics do have some advantages. For example, for on screen Power Point slide shows, PNG may be preferred because the Dataplot Postscript files typically only display a blank grey box on the screen (Dataplot does not generate a bitmap preview for Postscript files). Also, Postscript files must be printed on a Postscript printer. PNG and JPEG files do not have this restriction. Dataplot uses the GD library, developed by the Boutell company, to generate PNG and JPEG files. This is the library used by Perl (and many other programs) to generate PNG images. GD in turn uses three additional libraries: zlib, libpng, and libjpeg. These libraries are all freely downloadable from the web. The URL for GD is (this site contains links to the other three libraries):
The availability of the GD device driver in Dataplot is dependent on having these libraries built on the given platform. Currently, the status of the Dataplot executables provided by Dataplot is:
Note that if you need to build the Dataplot executable from source, then you also have to build the underlying GD libraries. The current version of Dataplot uses:
If you build from source, it is recommended that you use these versions of the libraries. Other versions may in fact work, but they will not have been explicitly tested with the Dataplot interface.
Specifically, the pre-built executables for Linux, Cygwin, and Solaris use the updated versions of the libraries. We anticipate upgrading several of the other pre-built executables in the near future. Since many installations provide these libraries independent of Dataplot, we wanted to make Dataplot reasonably current. The primary substantive difference is that version 2.0.33 of GD now supports GIF files. Dataplot executables built with 1.84 will not support GIF while those built with version 2.0.33 will support GIF.
where PNG specifies PNG output and JPEG specifies JPEG outout. This form designates device 1 as an GD graphics device.
where PNG specifies PNG output and JPEG specifies JPEG outout. This form designates one of DATAPLOT's 3 devices (typically device 2) as an GD device.
DEVICE 2 GD JPEG
DEVICE 2 GD PNG generate first plot DEVICE 2 CLOSE SET IPL1NA PLOT2.PNG DEVICE 2 GD PNG generate second plot DEVICE 2 CLOSE The SET IPL1NA command specifies the name of the file. Note that this name is currently converted to upper case. This command should come before the DEVICE 2 GD command.
DEVICE 2 GD PNG DEVICE 2 PICTURE POINTS 300 300 generate first plot DEVICE 2 CLOSE
Under Windows, an alternative is to use Ghostview to convert postscript files to JPEG or PNG. Once you import the Dataplot postscript graph into Ghostview, select "File" and then select "Convert". This menu will then let you select the image type and the resolution (we suggest using 300 dpi since this is the default resolution Dataplot uses for Postscript graphs). This is preferred method under Windows since it allows you to preserve the high quality fonts and 300 dpi resolution of the original Postscript graph while providing a graphics format that can be easily handled by most Windows applications. The one drawback is that it doesn't work if you need a fully automated process.
DEVICE 2 GD PNG DEVICE 2 PICTURE POINTS 400 300 TITLE SAMPLE PNG PLOT PLOT X**2 FOR X = 1 1 9 DEVICE 2 CLOSE SET IPL1NA PLOT2.PNG DEVICE 2 GD PNG DEVICE 2 PICTURE POINTS 500 400 TITLE SECOND SAMPLE PNG PLOT PLOT X**3 FOR X = 1 1 9 DEVICE 2 CLOSE
Date created: 6/5/2001 |