SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search Dataplot Pages

Dataplot Frequently Asked Questions (FAQS)

Installation Questions
  1. How do I download and install Dataplot?
  2. The GUI version of Dataplot does not run under Windows, what do I do?
  3. The fonts in the GUI menus are too small, what do I do?
  4. Can I redistribute Dataplot with my own applications?
  5. On what platforms does Dataplot run?
Printing Questions
  1. How do I import a Dataplot graph into Word or Power Point (or some other external program)?
  2. How do print my Dataplot graphics in the Unix version of Dataplot?
  3. How do print my Dataplot graphics in the Windows version of Dataplot?
  4. How do print the current screen plot (PP) under Unix and Windows?
  5. How do I get named plot files?
  6. How do I generate portrait mode Postscript plots
Data and I/O Questions
  1. Can I read Excel files into Dataplot?
  2. What type of data files does Dataplot read?
  3. Can I read character data into Dataplot?
Graph Construction Questions
  1. How do I position the title?
  2. How do I reposition the vertical axis label?
  3. How do I set the margin spacing within a plot?
  4. How do I Generate text with upper and lower case script?
  5. How do I encircle/highlight data points on a plot?
  6. How do I have two different left/right axis labels?
  7. How do I correct an oversized default font on the screen?
Fitting and Data Analysis Questions
  1. How do I capture regression output to an external file?
  2. How do I access regression coefficient standard deviations?
Dataplot Programming Questions
  1. How do I repeat blocks of commands?
  2. Where should I have the Dataplot login file dplogf.tex?
  3. How do I integrate Dataplot with my own Fortran/C programs?
  4. Can I extract the Dataplot source code to use in my own Fortran/C programs?

Installation Questions

How Do I Download and Install Dataplot? Question: How do download and install the Dataplot software?

Instructions for downloading and installing Dataplot can be found at the download web page.

Separate pages are setup for Windows, Linux/Unix and MacOS downloads. The Linux/Unix and MacOS are source builds while the Windows version downloads a pre-built executable.

Return to FAQ list
The GUI Version of Dataplot Does Not Run Under Windows, What Do I Do? Question: The GUI version of Dataplot does not run under Windows, what do I do?

If the GUI version of Dataplot fails to run under Windows, check the following:

  1. Did you install the Tcl/Tk software? The Dataplot GUI is written as Tcl/Tk scripts. Tcl/Tk is a separate program that must be installed independently of Dataplot. Tcl/Tk is freely available.

    By default, Dataplot assumes that you have installed the version of Tcl/Tk provided by MagicSplat. You can alternatively install the ActiveState version of Tcl/Tk (although this version is also freely available, it does requires that you register). The installation notes for Windows provides instructions if you use the ActiveState version rather than the MagicSplat version. Note that there may be other implementations of Tcl/Tk. This is not recommended unless you are somewhat familiar with Tcl/Tk (you will need to modify the file C:\Program Files (x86)\NIST\DATAPLOT\DP.BAT to reflect the correct path for your version of Tcl/TK).

  2. When you install the MagicSplat version of Tcl/Tk, you have the option of installing either for a single user (i.e., yourself) or for all users. If you installed for all users, you need to do the following:

      Right click on the DATAPLOT_GUI shortcut and select "Properties". In the "Target field", you need to add "all" (without the quotes) to the end of field.

  3. Did you install Tcl/Tk on a drive other than "C:\"? If so, the Windows installation notes provided instructions on what you need to do.
If you still unable to resolve the problem, then contact Alan Heckert for additional assistance.
Return to FAQ list
The Fonts in the GUI Menus Are Too Small, What Do I Do? Question: The fonts in the GUI menus are too small, what do I do?

There is a configuration file for the Tcl/Tk scripts. You can change the size of the requested fonts in this configuration file. Note that you can also change the default editor and the default web browser in this file as well. This configuration file is an ASCII file that can be edited with your favorite text editor. The comments in the configuration file give the specific instructions for modifying the font sizes.

For Linux/Unix platforms, the configuration file is located in the "frscript" subdirectory in the Dataplot auxillary directory (/usr/local/lib/dataplot by default). The name of the file is "xdpConfig". If you copy this file to your home directory, the version in the home directory overrides the version in "frscript". You can modify the "frscript" version to set site wide defaults and you can, optionally, have the version in your home directory to set personal defaults. Font sizes will typically be a site wide default. On the other hand, the choice of default browser and editor is often a personal default.

For Windows platforms, the default location for the configuration file is "C:\Program Files (x86)\NIST\DATAPLOT\FRSCRIPT\XDPCONFIG".

Can I Redistribute Dataplot with my Own Applications? Question: Can I redistribute Dataplot with my own applications?

You are free to redistribute Dataplot as part of your own applications software.

Return to FAQ list
On what platforms does Dataplot run? Question: On what platforms does Dataplot run?

Dataplot is available as a binary installation on Windows platforms (it should run under Windows 7/8/10/11). Note that for the Linux-like enviornments under Windows (e.g., CygWin, MSYS, MINGW and WSL) Dataplot can be built from the source code as it is for Linux operating systems.

Dataplot can be built from source for Linux/Unix platforms. We currently test this build for RedHat Fedora, Rocky 8 (this is essentially RedHat Enterprise 8), Ubuntu, SUSE and Manjaro. In addition, we build on Cygwin, MSYS and MINGW. WSL is essentially Ubuntu. Building on other Linux/Unix platforms should be straightforward. The primary requirement is that the gfortran/gcc compilers be installed. Dataplot can optionally utilize several external libraries if available, but these are not essential.

There may be limited support for binary "package" installs for a few select Linux platforms.

Building Dataplot for MacOS is essentially equivalent to a Linux source build.

We do not currently provide native installations for smart phones or tablets. There are Linux installations available for Android, although we have not explicitly tested this.

Return to FAQ list

Printing Questions

How Do I Import a Dataplot Graph Into Word or Power Point (or Some Other External Program)? Question: How do I import a Dataplot graphic into Word or Power Point or some other external program?

It is common to want to import a Dataplot graphic into a report written in Word, WordPerferct, LaTeX, or some other word processor or page publishing system. You may also want to include Dataplot graphics into a Power Point presentation or import the graph into a graphics editing program such as Adobe Illustrator.

Dataplot typically generates its graphics output in Postscript format (there is an option for the Postscript graphs to be automatically converted to PDF format).

The first question is whether the desired program can import Postscript (or PDF) directly. For example, there are several packages that allow LaTex to import Postscript or PDF documents.

Word processing software, e.g. Word, is less likely to support direct importing of Postscript/PDF files. We have found the following methods to work reasonably well.

  • On Windows platforms, open up the a PDF version of the graph using the Adobe Reader in full screen mode. Do a "copy" of the graph to the clipboard. Then in Word, do a "Paste Special" to import the graph from the clipboard.

  • Use software to convert the PDF file to a supported bit-map format such as JPEG or PNG (the supported formats will depend on what word processing program you are using). One issue is that Dataplot generates the Postscript file at 600 dpi in a vector format. Conversion to a bit-map format is generally at 72 dpi. This can result in some fuzziness in the converted graph. Some conversion software will apply anti-aliasing to the converted graph. This will typically sharpen the image and remove the fuzziness.

    We have had success using the open source GIMP program. With GIMP, be sure to check the "anti-aliasing" box when importing the Postscript/PDF graph. The "Export" option under the File menu can be used to convert the graph to the desired bit-map format.

    There are a number of programs that will convert the Postscript/PDF format to bit-map formats. If the software you are using results in a "fuzzy" graph, this is most likely an indication that anti-aliasing has not been applied.

If you are generating multiple graphs to be imported, it is typically desirable to create each graph in a separate file. You can do this as follows

             device 2 close
             set ipl1na plot1.ps
             device 2 postscript
                 ... generate plot 1 ...
             device 2 close
             set ipl1na plot2.ps
             device 2 postscript
                 ... generate plot 2 ...
             device 2 close
             
The command "set ipl1na" defines the name of the plot file. Note that this must come before the "device 2 postscript" command. Dataplot uses a default name of "dppl1f.dat". However, if you are generating multiple graphs, using the default name will overwrite the previous graph whenever you enter a new "device 2 postscript" command.
Return to FAQ list
How Do I Print My Dataplot Graphics in the Unix Version of Dataplot? Question: How do I print my Dataplot graphics in the Linux/Unix version of Dataplot?

Printing the graphics files dppl1f.dat or dppl2f.dat is performed in the standard way for your operating system. For example, on Unix you would enter the Unix command

    lpr -P<printer id> dppl1f.dat
If you are not sure how to print files on your operating system, check with your local system administrator.

The above command assumes that your printer supports the printing of Postscript files. This should be the case for most printers used in a Unix/Linux environment. If your printer does not support Postscript, then investigate Ghostview/Ghostscript. First, check the Ghostview/Ghostscript documentation to see if your printer is supported. If so, then check to see if Ghostview/Ghostscript is already installed on your system. If not, you need to download and install it (hopefully, your local system administrator will be willing to help).

Note that in Unix, there is not a common "graphics device" interface for printers. The protocol for a given printers has to be explicitly supported. For this reason, Postscript is the preferred protocol for printers in the Unix world and the list of supported printers in Ghostview may be smaller in the Unix implementation than the Windows implementation. This is more likely to be an issue for PC based Unix/Linux platforms than for workstation based platforms.

Return to FAQ list
How Do I Print Dataplot Graphics in the Windows Version of Dataplot? Question: How do I print Dataplot graphics in the Windows version of Dataplot?

Open the Postscript (or PDF) file using Ghostview. Then use the Print option (under the File menu) in Ghostview to print the graph.

Note that there are other programs that can be used to view and print Postscript files.

Return to FAQ list
How Do I Print the Current Screen Plot (PP) Under Unix and Windows? Question: How do I print the current screen plot (PP) under Unix and Windows?

The Dataplot command PP is used to print the most recent plot in Dataplot.

Under Linux/UNIX, Dataplot issues the following command:

    lpr dppl2f.dat
If you do not want to send the graph to your default printer, enter the command (before the PP command):
    set printer <printer-id>
where <printer-id> is the name of the desired printer.

Under Windows, Dataplot issues the following command:

    GSPRINT.EXE -printer "printer-id" dppl2f.dat
where printer-id is the name of the desired printer. To set the name of the printer, enter the command
    set printer <printer-id>
where <printer-id> is the name of the desired printer. If no printer name is given, the graph will be sent to the default printer.

In order for the PP command to work under Windows, the Ghostview/Ghostscript software must be installed. If the software is installed and the PP command is not working, check the file "C:\Program Files (x86)\NIST\DATAPLOT\DPLOGF.TEX". Check that the line

    SET GHOSTVIEW PATH
matches the installation location of Ghostview on your machine.
Return to FAQ list
How Do I Get a Named Print File Question: How do I get a named print file?

Dataplot maintains three graphics devices. These can all be used simultaneously and independently. The graphics devices are:

    DEVICE 1 is your terminal screen.
    DEVICE 2 output is generated to the file dppl1f.dat in your current directory
    DEVICE 3 output is generated to the file dppl2f.dat in your current directory
DEVICE 3 is special. It maintains a copy of the current plot in Postscript format. DEVICE 3 is automatically opened and closed by Dataplot without any explicit action by the user. By contrast, DEVICE 2 must be explicitly opened and closed by the user and will contain ALL plots generated while the device is open.

There are 2 basic approaches to creating your own named plot files.

  1. Method 1:

    In the first method, you can explictly name the file. For example,

      SET IPL1NA PLOT1.PS
      DEVICE 2 POSTSCRIPT
      ... generate plot ...
      DEVICE 2 CLOSE
      SET IPL1NA PLOT2.PS
      DEVICE 2 POSTSCRIPT
      ... generate second plot ...
      DEVICE 3 CLOSE

    This sequence can be repeated as many times as needed. Note that this captures the DEVICE 2 output (which is normally written to dppl1f.dat). The command SET IPL1NA defines the name of the file. This command MUST be entered before the DEVICE 2 POSTSCRIPT command since the file is opened at that point.

    You are not restricted to Postscript output. The DEVICE 2 command can specify any valid Dataplot output device. The restriction on the file name is that it be 80 characters or less.

    Although this approach can also be used with DEVICE 3, it is a little trickier due to the fact that Dataplot opens and closes the output file automatically. For DEVICE 3, method 2 is recommended.

  2. Method 2:

    This method takes advantage of the fact that a postscript version of the plot currently on your screen also resides in the file dppl2f.dat. To copy a pre-existing plot out to file XYZ., one needs only to

      DEVICE 3 CLOSE
      COPY SYSTEM DPPL2F.DAT XYZ.

    The advantage of this approach is that it can be done after the fact. The basic idea can be applied to DEVICE 2 output as well (copy the dppl1f.dat file instead of the dppl2f.dat file).

Return to FAQ list
How Do I Generate Portrait Mode Postscript Plots? Question: How do I generate a portrait-mode postscript plot? In particular, How do I generate a plot of Y = x**2 with titles and labels and have it in portrait mode as opposed to the default landscape mode?

The following code will generate the portrait-mode Postscript plot:

    DEVICE 2 POSTSCRIPT
    ORIENTATION PORTRAIT
    PLOT X**2 FOR X = 1 1 10
    EXIT
In this example, the postscript output for DEVICE 2 will by default go to the file DPPL1F.DAT. Do a system print of the file to any postscript printer. For example, on Unix you would enter
    lpr dppl1f.dat
If you do not prefer the positioning of the plot on the vertical page, then adjustments may be made via the FRAME COORDINATES command, as in
    DEVICE 2 POSTSCRIPT
    ORIENTATION PORTRAIT
    FRAME COORDINATES 10 20 90 90
    PLOT X**2 FOR X = 1 1 10
    EXIT
This code will make the plot a little larger on the page by changing the lower left corner of the plot frame lines from the default of 15 20 (15% over and 20% up) to 10 20 (10% over and 20% up), and the upper right corner of the plot frame lines from the default of 85 90 (85% over and 90% up) to 90 90 (90% over and 90% up).

If you are generating multiple plots per page and you wish to have portrait mode output, then to additionally adjust the aspect ratio, you may also use the MULTIPLOT COORDINATES command which will adjust the size and position of the entire set of multiplots from its default of 15 20 85 90. An example of the use of that command is

    MULTIPLOT COORDINATES 10 20 90 85
Adjustments on the vertical axis label (to prevent possible overwriting on tic lables) may be done via the Y1LABEL OFFSET command (default is 8), as in
    Y1LABEL OFFSET 15
which would move the left vertical axis 15% to the left of the left vertical frame line. If you are using filled symmetric plot characters (for examples, circles) and you want to maintain the symmetry after conversion to portrait mode, then you may use the CHARACTER HW command (default height = 2% and default width = 1%) of total screen height and width, respectively, as in
    CHARACTER FILL 1 1.4 ALL
which would set all within-plot characters to a height of 1% and to a width of 1.4% (such a sizing yields symmetric circles as opposed to ellipses) for 2 by 2 multiplots.

In summary, therefore, for a 2 by 2 multiplot, the following code yields nice output for portrait mode:

    DEVICE 2 POSTSCRIPT
    .
    ORIENTATION PORTRAIT
    .
    MULTIPLOT 2 2
    MULTIPLOT COORDINATES 10 20 90 90
    FRAME COORDINATES 10 20 90 85
    .
    CHARACTERS CIRCLE
    CHARACTER FILL ON
    CHARACTER HW 1 1.4
    .
    Y1LABEL Y
    XLABEL X
    .
    PLOT X FOR X = 1 1 10
    PLOT X**2 FOR X = 1 1 10
    PLOT X**3 FOR X = 1 1 10
    Y1LABEL OFFSET 10
    PLOT X**4 FOR X = 1 1 10
    .
    EXIT
Return to FAQ list

Data and I/O Questions

Can I Read Excel Files into Dataplot? Question: Can I read Excel (or other spreadsheet or database programs) files into Dataplot?

Dataplot does not have native support for reading Excel files.

Here are several ways you can read data that is stored in an Excel spreadsheet.

  1. Excel can write the data to an ASCII file. There are several alternatives (comma delimited, space delimited or tab delimited).

  2. You can copy the data to the clipboard and then use the READ CLIPBOARD command.

  3. The READ EXCEL command can be used to read Excel files using Python (and specifically the Pandas package). This command assumes that Python and Pandas are already installed (Dataplot does not automatically initiate the installation of Python).
Methods 1 and 3 work best with clean data sheets (i.e., just the data, no graphs, summaries or cross-tabulations). If you do not have a clean data sheet, writing to the clipboard will be the easiest method.

This is discussed in more detail in ASCII files.

Return to FAQ list
What Types of Data Files Does Dataplot Read? Question: What types of data files does Dataplot read?

Currently, Dataplot reads ASCII files. These files can be created either using your favorite text editor or as the output from an commercial software program or as output from one of your own programs.

The standard format of the ASCII file is a rectangular block of data. That is, the columns represent variables and the rows represent observations (Dataplot assumes that all variables in a given file have the same number of observations). If your data files is structured so that rows represent variables and columns represent observations, then you can use the SERIAL READ command to read the data.

Dataplot supports a number of commands for skipping header lines, restricting which rows and columns are read, and specifying a fixed format for the data. These are documented in Chapter 9 of Volume I of the Reference Manual.

Dataplot does support unformatted Fortran files. This is typically reserved for very large data files to speed up the reading and writing of data files. Dataplot does not currently support reading generic binary files (e.g., binary data written from a C program). For details on using Fortran unformatted files, enter the Dataplot command HELP READ FORMAT (SET).

For a discussion of various issues regarding reading ASCII files, enter the command

Return to FAQ list
Can I Read Character Data into Dataplot? Question: Can I read character data into Dataplot?

By default, Dataplot expects data entered using the READ command to be numeric data only. However, Dataplot does provide some limited suupport for character data. Character data typically is one of the following

  1. Many data files will contain a "row label" identifier (typically in the first column). Dataplot currently can use row labels in the CHARACTER command and the WRITE command.

  2. Character data is most typically used for categorical variables. Dataplot can use the character representation with the GROUP LABEL command for axis tic mark labels. However, to use categorical data in computations, you need to convert it to a numerical variable.

If your data file contains character data, then you can do one of the following

  • You can skip over the character data using either the COLUMN LIMITS command or the READ FORMAT command. However this requires that the rows have a consistent format.

  • You can read row labels using the ROW LABELS command. Row labels can be used as the CHARACTER setting (to label individual plot points) for subsequent plots.

  • The SET CONVERT CHARACTER can be used to specify how character fields are handled. You can choose to interpret any character data as an error (the default), ignore character fields or attempt to read the character fields. One option will automatically create a numeric variable from the character field.

  • Dataplot does not support arrays of strings (i.e., character variables). However, you can emulate this capability to a degree using the LET STRING and the substitution character ("^"). For example, if columns 11 through 20 of the data file TEST.DAT contain an alphabetic variable, you could do something like the following:

      LET NROWS = 30
      COLUMN LIMITS 11 20
      LOOP FOR K = 1 1 NROWS
      LET NSKIP = K - 1
      SKIP NSKIP
      READ STRING TEST.DAT S^K
      END OF LOOP

    Then the syntax ^S^K would extract the value of the kth string in subsequent Dataplot commands.

Return to FAQ list

Graph Construction Questions

How Do I Position the Title? Question: How do I go about moving the title on my plot down closer to the upper frame line?

In Dataplot

    the bottom of your screen is at 0
    the top of your screen is at 100
    the top frame line of your plot is at 90
    the title line is at 97 (= 7 units above the top frame line)
To change the default TITLE position, use the TITLE OFFSET (= the TITLE DISPLACEMENT) command, as in
    TITLE OFFSET 3
which would offset the TITLE on all succeeding plots to be at 93 (= 3 units above the top frame line).

To make this permanent, put the appropriate TITLE OFFSET command in your DPLOGF.TEX so that it will be automatically executed upon entry into Dataplot.

Return to FAQ list
How Do I Reposition the Vertical Axis Label? Question: The default positioning of the left vertical axis label (as obtained by the Y1LABEL command) is such that the label happens to be overwriting the tic mark numbers. How do I move the label to the left so as to avoid this overwriting?

In Dataplot

    the left edge of your screen is at 0
    the right edge of your screen is at 100
    the left vertical frame line is at 15
    the left vertical axis label is at 7 (8 units to the left of the axis line)
To change the default Y1LABEL position, use the Y1LABEL OFFSET (= the Y1LABEL DISPLACEMENT) command, as in
    Y1LABEL OFFSET 10
which would offset the Y1LABEL on all succeeding plots 10 units to the left of the left frame line.

To make this permanent, put the appropriate Y1LABEL OFFSET command in your DPLOGF.TEX so that it will be automatically executed upon entry into Dataplot.

Return to FAQ list
How Do I Set the Margin Spacing Within a Plot? Question: Some of my plots have data points which end up on the frame lines and so are hard to see and easy to miss. How do I build in a buffer zone within a plot so that the plot points are visibly off the frame lines?

This problem is caused (by default) because the tic mark minimum and maximum are at the frame corners. The easiest way to solve the problem is to offset the minimum and maximum away from the corners. This is done via the TIC OFFSET command. The TIC OFFSET may be done either in data units or in screen (0 to 100) units. The most common offsetting is done in screen units. Thus, for example, to build in a 5% buffer zone inside all 4 frame lines of a plot, enter

    TIC OFFSET UNITS SCREEN
    TIC OFFSET 5 5
To make this permanent, put the above 2 commands into your DPLOGF.TEX so that it will be automatically executed upon entry into Dataplot.
Return to FAQ list
How Do I Generate Text with Upper and Lower Case Script? Question: In a Dataplot macro, I had
    TITLE Calibration Analysis
(a mixture of upper and lower case) but the output on a plot was
    CALIBRATION ANALYSIS
(all caps). Why did this happen and how can I fix it? I have similar questions regarding automatic capitalization for plot labels, plot tic labels, plot legends, general text strings, etc.

The case of output strings is controlled by various forms of the CASE command. The default is UPPER which means the default output case for titles, labels, tic labels, legends, text, etc. (regardless of the case of the input string as specified by the TITLE, LABEL, TIC LABEL, LEGEND, and TEXT commands) is UPPER (= upper case). Three cases are allowed:

    UPPER (upper case--the default)
    LOWER (lower case)
    ASIS ("as is", whatever mixture you have in the string)
In particular, if you want all succeeding titles to be "as is", then enter (somewhere before the first plot command, and usually in the vicinity of the first TITLE command) the following command:
    TITLE CASE ASIS
Similarly, one would have
    LABEL CASE ASIS to specify that all labels are "as is"
    TIC LABEL CASE ASIS to specify that all tic labels are "as is"
    LEGEND CASE ASIS to specify all legends as "as is"
    CASE ASIS to specify all TEXT command string as "as is"
Since it is quite common to have all titles, labels, tic labels, legends, and text strings "as is", then it is recommended to have the following five commands stored in your Dataplot login file (DPLOGF.TEX) so that they will be automatically executed upon entry into Dataplot and thus the analyst need not worry about it further:
    TITLE CASE ASIS
    LABEL CASE ASIS
    TIC LABEL CASE ASIS
    LEGEND CASE ASIS
    CASE ASIS
Return to FAQ list
How Do I Encircle/Highlight Data Points On a Plot? Question: I have a plot of Y versus X. I would like to draw the viewer's attention to a particular data point on the plot by drawing a circle around that point (only). How do I do that? In particular, suppose I have a plot of Y = X**2 for X = 1 (at increments of 1) up to 10. Suppose I want to draw a circle around the data point at X = 8 (that would be Y = 64). How do I do that?

The easiest way to do that is to make use of the Dataplot multitrace capability (via consecutive PLOT statements connected by AND) and

  1. plot the raw data with usual characters and usual character sizes

  2. plot the highlighted data with circles of a larger size.
The following code will work for the problem at hand:
    TITLE Encircle/Highlight a Plot Point
    TITLE CASE ASIS
    TITLE DISPLACEMENT 2
    LET X = SEQUENCE 1 1 10
    LET Y = X**2
    CHARACTERS X CIRCLE
    CHARACTER HW 2 1 5 4
    LINES BLANK BLANK
    PLOT Y X AND
    PLOT Y X SUBSET X 7.5 TO 8.5
This results in the following plot.

Sample plot showing highlighting of a point

Return to FAQ list
How Do I Have Two Different Left/
Right Axis Labels?
Question: I have a function
    y = 220 - 200*exp(-x)
relating farenheit temperature (y) to time (x) for the time range x: 0 to 10. The temperature y is in farehnheit and will range from 20 degrees F to 220 degrees F. I would like to produce a single-trace plot of temperature (vertically) versus time (horizontally). Rather than generate the single left-axis-only plot that is Dataplot's default, I would like to generate a dual-axis plot consisting of
  1. neat farehnheit units from 20 to 220 on the left axis, and

  2. neat Celsius units from 0 to 100 on the right axis (properly positioned relative to the left axis and the trace).
How is this done most easily?

Inasmuch as the default Dataplot settings for tic labels are such that

  1. they float with the data;

  2. they are neat;
  3. only the left axis tics and tic labels are on (not the right);
  4. if on, the right axis tic labels would be identical to the left;
then all of these defaults must be overridden in order to achieve the desired plot. The following code will work:
    Y2TICS ON (turn the right tics on)
    Y2TIC LABELS ON (turn the right tic labels on)
    .  
    LET FMIN = 20 (set the left axis minimum at 20)
    LET FMAX = 220 (set the left axis maximum at 220)
    LET CMIN = 0 (set the right axis minimum at 0)
    LET CMAX = 100 (set the right axis maximum at 100)
    Y1LIMITS FMIN FMAX (set the left axis limits at 20 and 220)
    Y2LIMITS CMIN CMAX (set the right axis limits at 0 and 100)
    .  
    LET CMIN2 = (5/9)*(FMIN-32) (calculate what 20 F is in Celsius units)
    LET CMAX2 = (5/9)*(FMAX-32) (calculate what 220 F is in Celsius units)
    LET DELMIN = CMIN-CMIN2 (compute a lower right tic offset)
    LET DELMAX = CMAX2-CMAX (compute an upper right tic offset)
    .  
    TIC OFFSET UNITS DATA (specify that the tic offset units will be in "data units")
    TIC OFFSET 0 0 (set all tic offsets to 0 for lower tic and 0 for upper tic)
    Y2TIC OFFSET DELMIN DELMAX (set tic offsets for right axis)
    .  
    LABEL CASE ASIS (set case for axes labels to "as is")
    Y1LABEL Temperature (F) (set the left axis label)
    Y2LABEL Temperature (C) (set the right axis label)
    X2LABEL Time (set the bottom axis label)
    TITLE CASE ASIS (set case for title to "as is")
    TITLE Generate a Dual-Axis Plot (set the plot title)
    .  
    LET FUNCTION F = FMAX-(FMAX-FMIN)*EXP(-X) (define the function to be plotted)
    PLOT F FOR X = 0 .1 10 (plot the function)
This results in the following plot.

Sample plot showing dual axes

Return to FAQ list
How Do I Correct an Oversized Default Font on the Screen? Question: In generating Dataplot graphics, I commonly use the default font for graphics appearing on the screen (= device 1), and postscript renditions of the same font for paper output (= device 2). I notice that when I do multiplotting (multiple plots on the same page) even though I get nice postscript paper output plots with publication-quality helvetica font, the multiple plots on the screen are of considerably poorer quality. It seems that although the font on paper output is scaled continuously and can get arbitrarily small (while still maintaining high resolution), the font on the screen appears limited as to how small it can get and thus moderate-sized characters appear when much smaller characters are needed--thus resulting in overwriting. How can I correct this?

The questioner's observation is correct: screen graphics for the default font is limited in size, whereas device 2 postscript paper output font is continuous. For 1-plot-per-page graphics, there is no problem; however, for multiplotting, there is a problem in how text appears on plots on the screen.

The explanation for this requires an understanding of the distinction between hardware and software characters. When Dataplot draws text, it does so in one of the following two ways:

  1. Dataplot can use the character generator on the given graphics device. This is referred to as using "hardware characters". The primary advantage of using hardware characters include

    • Hardware characters are typically quite fast to generate.

    • Some graphics devices support high quality typeset quality fonts. It is desirable to use these fonts when they are available.

    The disadvantages include

    • You cannot draw special characters (e.g., Greek characters, mathematical symbols) using hardware characters (note that Postscript ca generate some special characters using the SYMBOL font).

    • The primary disadvantage is that hardware characters are device dependent and graphics devices vary considerably in the capabilities of their hardware characters.
    • Hardware characters on a given device may lack flexibility. That is, they may not support rotation and they may support a limited number of sizes.

    For example, Postscript offers fully scalable typeset quality fonts. So for Postscript output, we prefer to use hardware characters whenever possible. On the other hand, X11 fonts are a fixed size. The only way to change the size of hardware characters on the X11 device is to change the hardware font (you can do this in Dataplot with the command SET X11 FONT). However, all text elements in a plot are drawn using the same hardware font.

  2. Dataplot can also draw text using a series of moves and draws. This is referred to as using "software characters". Currently, Dataplot supports seven Hershey fonts for drawing software characters. The advantages of software characters include

    • The appearance of text characters is consistent across graphics devices.

    • Special characters (e.g., Greek characters, mathematical symbols) can be drawn with software characters.
    • Software drawn text can be quite flexible. For example, text can be rotated to an arbitrary angle and text can be scaled to an arbitrary size.

    The disadvantages of software characters include

    • They take longer to generate than hardware characters.

    • Dataplot does not currently support any typeset quality fonts. The COMPLEX font comes closest, but it is still not typeset quality. This means the appearance of text using a software font will not be as nice as the text generated by devices that do support typeset quality fonts (e.g., Postscript).

The problem with the oversized screen fonts is typically caused because the screen device is unable to scale hardware characters to the desired size.

There are two solutions for this:

Solution 1:

The first solution is to globally (across all devices) change the font from the default (= tektronix = hardware generated text) font to one of the seven continuously-scaled fonts available in Dataplot:

    simplex, duplex, triplex, triplex italic, complex, and complex script
For example, you can enter FONT SIMPLEX anywhere before the first plot and this will yield graphs on the screen with properly-scaled characters. The good news is that this will yield plots on the screen with properly-scaled characters; the neutral news is that such plots take a bit longer to generate; the bad news is that if device 2 is turned on to postscript (for example, by DEVICE 2 POSTSCRIPT ), the resulting postscript paper output will in fact be postscript, but will be a postscript rendition of a simplex font plot. This is quite good but is not as good as a postscript rendition of a default font plot (which makes use of the built-in laser printer fonts).

This solution will yield good screen graphics and adequate postscript paper output.

Solution 2:

Prior to July 1996, solution 1 was the only solution. As of July, 1996, Alan Heckert of NIST has provided a more acceptable second solution. Solution 2 is to change the font from default to scalable for device 1 only (the screen), while maintaining a high-quality postscript rendition of the default font for device 2 (paper output). In practice, to maintain acceptably fast screen graphics, use the fastest scalable font (simplex).

This solution will yield both good (simplex font) screen graphics, and excellent postscript (default font) paper output graphics. Some trial and error may be required due to the fact that the Postscript hardware fonts come out somewhat smaller than the Dataplot Hershey fonts.

Return to FAQ list

Fitting and Data Analysis Questions

How Do I Capture Regression Output to an External File? Question: How do I capture the text output from a regression out to a file so that I can use it as part of a report?

The text output from the FIT command (or the text output from any Dataplot command for that matter) may be captured by use of the CAPTURE command. For example, if one wants to capture the text output from a quadratic fit to the file XYZ., then one would enter

    CAPTURE XYZ. (to initiate the capture of text out to file XYZ.)
    QUADRATIC FIT Y X (to regenerate the fit output; nothing will go to the screen)
    END OF CAPTURE (to terminate the capture of text out to file XYZ.)
    LIST XYZ. (to view on screen the contents of file XYZ.)
To have the FIT output generated to both the output file and to the screen, enter (before the CAPTURE XYZ. command)
    CAPTURE SCREEN ON
If this option is set to ON, then all subsequent CAPTURE commands will write the output to both the screen and the specified CAPTURE file. If this option is set to OFF, then the CAPTURE output will only be written to the specified CAPTURE file.
Return to FAQ list
How Do I Access Regression Coefficient Standard Deviations? Question: When I do a regression, the coefficients become Dataplot parameters (scalars) but the standard deviation of the coefficients, though seen on the screen, are not saved as Dataplot parameters. I would like to have the coefficient standard deviations as parameters for printing and/or for annotation on plots. How do I get these coefficient standard deviations?

Whenever a FIT command is executed, the coefficients and their standard deviations are copied out to file dpst1f.dat in your current directory. Thus to get the standard deviations, simply read them in (via the READ command), as in:

    QUADRATIC FIT Y X (carry out the quadratic fit)
    SKIP 1 (since dppl1f.dat has one header lines)
    READ DPST1F.DAT COEF SDCOEF (read in coefficients & sd(coefficients) into vectors COEF and SDCOEF)
    LET SDA0 = SDCOEF(1) (copy the first element of SDCOEF into the parameter SDA0)
    LET SDA1 = SDCOEF(2) (copy the second element of SDCOEF into the parameter SDA1)
    LET SDA2 = SDCOEF(3) (copy the third element of SDCOEF into the parameter SDA2)
    WRITE A0 A1 A2 SDA1 SDA1 SDA2 (write (to screen) the coefficients and their sd's)
    X2LABEL AO = ^A0 SDA0 = ^SDA0 (define contents of X2LABEL for future plots)
    PLOT RES X (generate a residual plot--including X2LABEL)
Return to FAQ list

Dataplot Programming Questions

How Do I Repeat Blocks of Commands? Question: How do I go about re-executing a previous command or a previous set of commands?

If you want to repeat a single command, then you may use the REPEAT (or R for short) command. To re-execute the last command, enter any of the following:

    REPEAT
    R
    REPEAT 1
    R 1
If you want to repeat a command that occurred a few commands back but you are not sure how far back, then precede the R command with a LIST (or L) command with no arguments:
    LIST
    L
This will list out the previous 20 commands or so. If the desired command was, say, 7 commands back, then you would follow the LIST command by either of the following:
    REPEAT 7 R 7
If you need to re-execute a group of commands, then this is done via a sequence of the following commands:
    LIST (or L) (to list and see the previous commands with line numbers)
    SAVE (or S) (to save, in whatever order desired, previous commands)
    / (to rexecute the saved commands)
For example,
    MULTIPLOT 2 2 (to specify that the next 2 x 2 = 4 plots appear on a the same page in a 2-by-2 grid)
    PLOT Y1 X1 (to plot Y1 versus X1 in upper left)
    PLOT Y2 X2 (to plot Y2 versus X2 in upper right)
    PLOT Y3 X3 (to plot Y3 versus X3 in lower left)
    PLOT Y4 X4 (to plot Y4 versus X4 in lower right)
    LIST (to list and see previous commands--with line numbers)
    SAVE 5 4 3 2 1 (to save commands 5, 4, 3, 2, and 1--in that order)
    / (to re-generate the 2 by 2 multiplot)
    CHARACTERS X (to set plot characters to X)
    / (to again re-generate the 2 by 2 multiplot)
Note: alternatively on Linux (and MacOS) systems you can use the SET READ LINE command to utilize the history recall and command line editing in the GNU READLINE library. This requires that the READLINE library be incorporated when Dataplot is built on a particular system. This library is available on most Linux implementations.
Return to FAQ list
Where Should I Have the Dataplot Login File dplogf.tex? Question: I realize that Dataplot has a file named DPLOGF.TEX (dplogf.tex on Unix) that will automatically be executed upon entry into Dataplot. I also know that I can usefully employ DPLOGF.TEX by storing commands in this ASCII file that will override system defaults and put in place analyst preferences. How can I create this file and what directory should it go in?

The ASCII file DPLOGF.TEX may be created by any convenient editor. Dataplot first looks for this file in the current directory. If found, the search is over and the commands are executed. If not found,Dataplot will search the directory where Dataplot's auxiliary files are kept.

PC WINDOWS: If you installled Dataplot using the "setup.exe" file, the environment variable DATAPLO$ is automatically created to specify the Dataplot directory. By default, this directory is "C:\Program Files (x86)\NIST\DATAPLOT".

If you installed Dataplot in a non-standard way (i.e., not using the "setup.exe" file), you need to create the environment variable DATAPLO$ that specifies the appropriate directory (do a Google search of "creating environment variables under Windows" for instructions on how to do this). Alternatively, you can create a batch file to run Dataplot that contains the following two lines (assume Dataplot is installed in "C:\DATAPLOT")

    SET DATAPLO$ = C:\DATAPLOT\
    C:\DATAPLOT\DATAPLOT.EXE -extrawide -tile

Linux/UNIX/MacOS: Dataplot looks secondarily for dplogf.tex in your home directory (typically stored in the environment variable "HOME").

If Dataplot does not find dplogf.tex in the current directory or your home directory, it will search Dataplot's auxiliary directory. The default location for this directory is defined when Dataplot is built. You can override this location by defining the environment variable DATAPLOT_FILES. For example, if you use the bash shell, you can enter something like

    set DATAPLOT_FILES=/home/heckert/lib/dataplot/
    export DATAPLOT_FILES
If you use the c-shell, the command would be
    setenv DATAPLOT_FILES= /home/heckert/lib/dataplot/
If no dplotf.tex file is found, you will see an error message printed on the terminal indicating that Dataplot was unable to open the DPLOGF.TEX file. However, you can still continue with your Dataplot session.
How Do I Integrate Dataplot With My Own Fortran or C Programs? Question: How do I integrate Dataplot with my own Fortran/C programs?

We consider integration in two basic senses.

  1. You have a Fortran program and you would like to perform some Dataplot analysis for the output of that program. Often, this just means you would like to use Dataplot to graph the data. In other cases, you would acutally like to perform some numeric analysis as well.
  2. On the other hand, you might want to have Dataplot call your Fortran/C program to perform some analysis that is not available in Dataplot.
We will discuss these separately.

First, we discuss invoking Dataplot from within a Fortran program (the basic idea is similar for a C program). The basic steps are as follows:

  • Write a Dataplot macro to perform the desired analysis.

  • When you get to the part of the code where you want to invoke Dataplot, do the following:

    1. Write out the data that Dataplot needs to one or more ASCII files. The Dataplot macro that you write will read these files.

    2. Most Fortran compilers give you a "SYSTEM" function. This is not standard Fortran, so the exact syntax will vary depending on the specific compiler that you are using. A typical call would be something like

        CALL SYSTEM("dataplot < sample.dp > sample.out")

    3. You can use the SYSTEM call to print out any graphics files or text output files that were created by Dataplot.

  • If Dataplot creates any data that you want to incorporate back into your Fortran program, have your Dataplot macro write this to an ASCII file using the WRITE command. Then have your Fortran code read these files.
Second, we discuss invoking your own program from within Dataplot. The basic steps are as follows:
  • Have Dataplot write any data that your Fortran program needs to appropriate ASCII files (i.e., the WRITE command).

  • Create an executable file using your local compiler. Your executable should be setup to read the ASCII files created by Dataplot. In addition, you should write any data that you want Dataplot to process to an ASCII file. For the sake of discussion, say that this program is called a.out in the current Dataplot directory.

  • Dataplot has a "SYSTEM" command that can be used to execute a local operating system command. For example

      SYSTEM a.out

  • After the SYSTEM command completes, have Dataplot read any needed data that was written to ASCII files by your program.
If you want to add an external program to Dataplot's function libraries, see the EXECUTE command.
Can I Extract the Dataplot Source Code to Use in My Own Fortran or C Programs? Question: Can I extract the Dataplot source code to use in my own Fortran/C programs?

The short answer is yes. The Dataplot source code is publically available and we do not place any restrictions on its use.

However, the Dataplot code is not structured as independent libraries. This means that you will have to do a little work in order to use it with your own applications. In some cases, it is a fairly trivial process. In other cases, it may not be worthwhile.

We note a few points that you need to be aware of.

  • Dataplot funnels text output through the single routine DPWRST. You can either use this as well, write your own version of DPWRST, or convert the text output to your own system.
  • Dataplot makes use of a large number of common blocks. This is the part that may be most problematic in converting the code to your own use. In many cases, the needed changes will be straightforward. In other cases, it may be fairly difficult.
  • In many cases, Dataplot uses public domain Fortran libaries. These have typically been modified for use by Dataplot (e.g., the I/O has been modified). For that reason, I recommend downloading the original copies of these libraries for your own use.
Return to FAQ list
Date created: 06/05/2001
Last updated: 04/12/2023

Please email comments on this WWW page to alan.heckert@nist.gov.