The CAPTURE HTML command redirects Dataplot alphanumeric output
from the screen to the specified file and formats using
HTML syntax. The END OF CAPTURE command reverts alphanumeric
output back to the screen.
The CAPTURE HTML command is useful for generating Dataplot
output in a format suitable for viewing by a web browser
such as Netscape or Internet Explorer.
As of the 2013/12 version of Dataplot, most of the Analysis
commands support HTML formatted output. The following are
the Analysis commands that do not yet support HTML formatted
output (these commands use the <PRE> ... </PRE>
syntax, that is, an "asis" format).
ORTHOGONAL DISTANCE FIT
In addition, WRITE HTML can be used to generate 1-way
tables in HTML format. This is described in more detail
in a Note below.
The CAPTURE HTML option can be used in conjunction with the WEB
command. For example,
READ RIPKEN.DAT Y X1 X2
CAPTURE HTML C:\TABLE.HTM
TABULATE MEAN Y X1
CROSS TABULATE MEAN Y X1 X2
END OF CAPTURE
In addition, if DEVICE 2 is set to PNG, JPEG, SVG, or Postscript,
Dataplot will incorporate the graphics into the web page using the
IMG tag (the SVG device uses the EMBED tag). This is demonstrated
in the sample program below.
Note that for Postscript, Dataplot uses the Ghostscript command
to convert the output to JPEG. A couple of points to note on
- This assumes that Ghostscript is installed on your
system. For Unix platforms, Ghostscript is launched with
a "gs" command. On Windows platforms, Ghostscript is
launched with "C:\GS\GS704\GS\BIN\GSWIN32C.EXE".
If you need to change the path for the Ghostscript command,
enter the following command:
SET GHOSTSCRIPT PATH
For example, on my Windows system, I use
SET GHOSTSCRIPT PATH F:\GS\GS704\GS\BIN\
We suggest that you add this command to your Dataplot
startup file "dplogf.tex".
- We suggest using either the ORIENTATION PORTRAIT or the
ORIENTATION LANDSCAPE WORDPERFECT command to set the
orientation. Plots with a landscape orientation are
rotated in the Dataplot Postscript output (in order to
make full use of the page). Currently, Ghostscript does
not support a command line switch to rotate the graph.
This means that landscape plots will be rotated vertically
on the web page (you can use external programs to rotate
the JPEG files if you like).
The SET POSTSCRIPT CONVERT command can be used to automatically
convert the Postscript output to one of several formats (JPEG,
PDF, TIFF, PBM, PGM, PPM, PNM). If the output is set to PDF
(Portable Document Format), the CAPTURE HTML command will
incorporate the PDF (rather than the Postscript) file into the
web page. For PDF files, Dataplot builds a link to the PDF file.
The advantage of using PDF files is that they are typically of
higher quality than the corresponding JPEG files. The
disadvantage is that you have to link to the file rather than
having it directly in the page.
CAPTURE HTML <file name>
where <file name> is the name of a file where alphanumeric
output is written.
If the file name does not contain a period, place a period (no
spaces) at the end of the file name.
CAPTURE HTML FITOUT.HTM
... DATAPLOT COMMANDS ....
END OF CAPTURE
DATAPLOT has the following restrictions on the file name:
- The file name should be a valid file name on the local
- It must contain a period "." in the file name itself or as
a trailing character. DATAPLOT strips off trailing periods
on those systems where it is appropriate to do so. On
systems where trailing periods can be a valid file name
(e.g., Unix), DATAPLOT opens the file with the trailing
- On systems where file names are case sensitive (i.e., Unix),
the case is preserved as entered on the CAPTURE command.
- The file name cannot contain more than 80 characters.
- If the file name contains a space, then use the SET FILE
NAME QUOTE command and enclose the file name in quotes.
SET FILE NAME QUOTE ON
CAPTURE "junk temp.out"
The capture command can be toggled on and off (END OF CAPTURE
redirects alphanumeric output to the screen). However, a new file
name should be used each time since invoking a new CAPTURE command
overwrites any existing file (END OF CAPTURE automatically closes
Dataplot provides the following switches for controlling
what output Datplot generates:
The PRINT command controls most of the output generated by
the Analysis category commands. Output from most other commands
is controlled by the FEEDBACK command. The purpose of this
distinction is to allow you to generate the output from
commands such as FIT while suppressing most of the other
When generating HTML format output, a common choice is
You can create one-way tables using the command
where <var-list> is a list of variables to print in an HTML
table format. Note that this command is typically entered
after a CAPTURE HTML command.
The following commands can be used to control the appearance
of the HTML table:
SET TABLE TITLE <text>
- allows you to specify a title for the generated
SET TABLE BORDER <ON/OFF/RULE/COLS>
- specify what type of border the table will have
SET TABLE SPACING <value>
- specify a value for the CELLSPACING option
in the <TABLE> element
SET TABLE WIDTH <value>
- specify the width of table columns in pixels
The SET WRITE DECIMALS command can be used to specify how many
digits after the decimal point will be printed (this will apply
to all of the columns, currently there is no way to specify a
different value for different columns).
By default, the column headers will simply be the variable
names. However, if you have entered a VARIABLE LABEL command
for a given variable, the label specified for that variable
will be used instead of the variable name.
Dataplot is not a word processor. The HTML code generated is
fairly basic. That is, Dataplot creates the basic table or
list structure for the output. However, it does not give you
control over font sizes, colors, and so on. We have written
the HTML in a style which we believe is human readable/editable.
If you want to modify the appearance of the HTML output, our
recommendation is to either edit the file using an ASCII editor
or use one of the HTML editors (we have no particular
recommendations on the advantages/disadvantages of the various
= Redirect alphanumeric output to a file.
= Redirect alphanumeric output to a file in
END OF CAPTURE
= Revert alphanumeric output back to the screen.
= Lists the contents of a file.
= Execute commands stored in a file.
= Echo entered commands to a file.
= Automatically generate JPEG, PDF, TIFF, PBM, PGM,
PPM, or PNM from postscript output.
HTML HEADER FILE
= Specify a file to use for the header of the HTML
HTML FOOTER FILE
= Specify a file to use for the footer of the HTML
read gear.dat y x
line blank solid
character x blank
capture html tabulate.htm
tabulate mean y x
tabulate sd y x
set ipl1na meanplot.jpg
device 2 gd jpeg
title mean plot
mean plot y x
device 2 close
end of capture
. file name below needs to be modified
NIST is an agency of the U.S.
Date created: 01/31/2004
Last updated: 12/15/2013
Please email comments on this WWW page to