xgraph

From ASCEND

Jump to: navigation, search
This article is incomplete or needs expanding. Please help out by adding your comments.

For plotting with the Tcl/k GUI in ASCEND, we use a program called xgraph, which runs on Linux and similar systems, or else tkxgraph, which runs on Windows (written by David Harrison and Ben Allan).

This page describes the steps needed to get xgraph or tkxgraph running on your system.

Linux

Source code for the CMU-tailored version of xgraph are available from http://ascend.cheme.cmu.edu/ascend_unix.htm (see item 10).

Do NOT install just any version of xgraph11. There are versions available that are "bare bones" versions and that have a data file format that differs from those mentioned above.

Note John Pye believes that the xgraph available from http://www.cs.toronto.edu/~radford/xgraph.html is a working alternative to the CMU version of xgraph.

[Art] proceeded as follows to install a working version.

  • Downloaded and uncompressed xgraph from the ASCEND web pages.
  • Added the following lines at the end of their respective obvious locations to the file "Makefile.gmake".
PLATFORM=linux

and

ifeq "$(PLATFORM)" "linux"
LIBS = -L/usr/X11R6/lib -lX11 -lm
endif

and commented out the currently defined PLATFORM=??? instruction.

  • Made a new executable for xgraph by executing "make -f Makefile.gmake"
  • Moved into a directory along my PATH (e.g., to /usr/bin) and created a symbolic link to point to this xgraph: "ln -s /pathToNewlyCreatedXgraph/xgraph"

Now I needed to test if this all worked. I started up ASCEND (my script for doing this is as follows:

#!/bin/sh
#
# Usage: ascend4
#
ASCENDDIST=/home/aw0a/ascend
export ASCENDDIST
ASCENDLIBRARY=/ProgramsUnregistered/ascend4-0.9.5/ascend4/models/
export ASCENDLIBRARY
ASCENDTK=/home/aw0a/ascend/tcltk98/TK
export ASCENDTK
$ASCENDDIST/bin/ascend4


If it still does not work, return to the Script window and select Tools/System utilities. A window will open that allows you to set links to various resources. Both the "Plot program name" amd the "Plot file type" should be "xgraph". If you have not put xgraph on your PATH, then set "Plot file name" to the path for xgraph, e.g.,

/mybin/xgraph

Windows

See http://ascend.cheme.cmu.edu/ftp/pdfMisc/tkxgraph.pdf

The load module for windows contains the file /ProgramsUnregistered/ascend4-0.9.5/Tcl/bin/tkxgraph.exe. Again, follow the instructions above to run the ASCEND script separation_demos.a4s to test if plotting is working. If not, return to the Script window and select Tools/System utilities. In the window set the "Plot program name" to something like the following

C:/ProgramsUnregistered/ascend4-0.9.5/Tcl/bin/tkxgraph.exe -- -f

Be sure to use forward slashes here. Be sure you put spaces where they belong also (before -- and before -f). I set the "Plot file type" to "tkxgraph".

PtPlot

It seems that the plotting tool PtPlot (http://ptolemy.eecs.berkeley.edu/java/ptplot/) offers an xgraph-compatible mode, which means that this program can be used as a drop-in replacement for xgraph and tkxgraph on both windows and linux. See the following link for more info:

http://ptolemy.eecs.berkeley.edu/java/ptolemy.plot2.0/ptolemy/plot/