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 SED Pages
Dataplot Vol 1 Vol 2

PSVIEW

Name:
    PSVIEW
Type:
    Support Command
Purpose:
    View the most recent plot in a Postscript viewer.
Description:
    DEVICE 3 (in file DPPL2F.DAT, the name may vary on some systems) output is closed and re-opened at the beginning of a plot command, so only the most recent plot is in the graphics file.

    This command will view this Postscript file using a Postscript viewer. This command is currently supported for Windows and Unix/Linux systems.

    For both Windows and Unix/Linux systems, the default viewer is ghostview. To specify a different viewer, enter the command

      SET POSTSCRIPT VIEWER <viewer>

    On Unix/Linux systems, <viewer> is case sensitive.

    This command is useful when you want to view the Postscript version of the plot without leaving the Dataplot session. The Postscript version of the plot is typically of higher quality than the screen version of the plot.

    The October, 2016 version of Dataplot made the following updates to this command.

    1. You can now view the contents of the DEVICE 2 output (see Syntax 2 below).

    2. You can view an arbitrary Postscript file (see Syntax 3 below).
Syntax 1:
    PSVIEW

Syntax 2:
    PSVIEW DEVICE 2

    This syntax displays the plots in the DEVICE 2 file (i.e., the dppl1f.dat file).

Syntax 3:
    PSVIEW <file-name>

    This syntax displays the plots in an arbitrary Postscript file. Note that Dataplot does no checking for file existence or whether or not the file is a Postscript file. The invoked Postscript viewer will do this checking.

Examples:
    SET POSTSCRIPT VIEWER evince
    PSVIEW

    SET POSTSCRIPT VIEWER "C:\Program Files\GHOSTGUM\GSVIEW32.EXE"
    PSVIEW

    PSVIEW DEVICE 2

    PSVIEW PLOTS.PS

Note:
    By default, the PSVIEW DEVICE 2 command will close the plot file before invoking the Postscript viewer. This is so that the last plot in the file is complete. However, this can be problematic if you want to generate additional plots. Specifically, you need to enter a DEVICE 2 POSTSCRIPT command to resume generating plots to this file. However, this new DEVICE 2 command will erase the files that previously existed in the file.

    There are a several possible solutions to this.

    You can request that the plot file not be close by entering the command

      SET PSVIEW FILE CLOSE OFF

    This will suppress closing the file. The disadvantage of this is that the last plot in the file may not be complete. A warning will be printed that the last file may not be complete. However, the advantage is that you can continue generating plots to the current plot file.

    Alternatively, you can do something like

      PSVIEW DEVICE 2
      SET IPL1NA PLOT_NEW.PS
      DEVICE 2 POSTSCRIPT

    The SET IPL1NA command allows you to specify the name of the plot file (this should come before the DEVICE 2 POSTSCRIPT command). The advantage of this approach is that the last plot will be complete. The disadvantage is that you will create multiple plot files.

Note:
    Although this command was created with Postscript graphics files in mind, you may be able to use it with other graphics formats. For example, if you use DEVICE 2 SVG to create SVG format files, you can use the SET POSTSCRIPT VIEWER command to specify GIMP or some other software program that can view SVG files.
Default:
    For Linux, the default viewer is "ghostview". For Windows, the default viewer is "C:\Program Files\GHOSTGUM\GSVIEW\GSVIEW32.EXE".
Synonyms:
    None
Related Commands:
    PP = Print the most recent plot.
    SET IPL1NA = Specify the name of the the plot file for DEVICE 2.
Applications:
    Interactive Usage
Implementation Date:
    2011/09
    2016/10: Support for PSVIEW DEVICE 2
    2016/10: Support for arbitrary Postscript files
Program 1:
     
    .  Generate a plot and use the "evince" program (Linux) to view the
    .  Postscript version of the graph.
    .
    SET POSTSCRIPT VIEWER evince
    PLOT X**2 FOR X = 1 1 9
    PSVIEW
        
Program 2:
     
    device 2 postscript
    .
    char X
    line blank
    y1label Y
    x1label X
    title automatic
    title offset 2
    .
    plot x for x = 1 1 9
    plot x**2 for x = 1 1 9
    plot x**3 for x = 1 1 9
    .
    set psview file close off
    psview device 2
    plot x**4 for x = 1 1 9
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 09/06/2011
Last updated: 10/25/2016

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