Customizing xdatplot (X resources)
The default behavior of xdatplot can be extensively modified by the X
resource mechanism.
Where xdatplot finds X resources
To customize xdatplot, you change resource values from their defaults.
There are two main ways to change resources:
- Put the new resource values in a file called XDatplot in your
home directory. xdatplot reads this file every time it starts up.
- Put the resource values in a file called .Xdefaults in your home
directory. This file is read once when you log in. Make sure that
any specifications in this file begin with "xdatplot" or "XDatplot",
since otherwise they will apply to every application you run.
Application resources
Ones you may find useful
- fileConvert:
- Tells how to convert foreign formats. See file formats.
- printLimit: 65535
- If you try to print (or export as postscript, or as MIF) a plot
with more than this number of points, xdatplot will ask for
confirmation. This is to prevent you from accidentally locking up
xdatplot and filling your disk with enormous printouts. If you like
living dangerously, you can set it to 0: then plots of any size will be
printed without asking.
- printCommand: "print_big"
- The command used to print plots. print_big is a little shell
script that allows big files to be printed. You get it wherever you
got xdatplot.
- helpViewer: "mosaic"
- The program that should be run to view the help files. You can
change this if mosaic has a different name on your system (for
instance Mosaic or xmosaic).
- helpWait: 10
- mosaic takes some time to start up and be ready to accept
instructions from xdatplot. This resource is the time in seconds
xdatplot will hang after starting help.
- helpURL: "http://eatworms.swmed.edu/Software/xdatplot_help"
- The URL that mosaic should contact to get the help. The default
is to contact my WWW server, which has the advantage that you don't
need to install the help files on your machine. However, fetching the
help over the internet may be slower than you like, and of course
won't work at all on machines without an internet connection. In this
case, you can fetch the helpfiles (xdatplot_help.tar.gz), install them
somewhere on your machine, and set this resource to point to them.
- tUnits: sec
- tMultiplier: "NaN"
- tGain: 1.0
- vUnits: V
- vMultiplier: "NaN"
- vGain: 1.0
- These are the settings in the Units
dialog. "NaN" (not a number) for the multiplier means that the
multiplier should be read from the data file.
- tWidth: 5.0
- vHeight: "NaN"
- These determine the size of the region initially plotted when a
new data file is read in. "NaN", not a number, means plot the full
extent.
- tTics: 3
- tTicLength: 5
- vTics: 3
- vTicLength: 5
- topMargin: 30
- bottomMargin: 30
- rightMargin: 10
- leftMargin: 60
- plotFont: "fixed"
- plotHeadingFont: "9x15bold"
- markSize: 20
- markThickness: 3
- CURSORColor: "red"
- These resources affect the appearance of the plot: its placement
within the main window, the fonts used for labeling, the number and
size of tic marks on the axes. Dimensions are in pixels.
- peakHeight: 1.0
- troughDepth: 1.0
- peakHalfWidth: 0.015
- troughHalfWidth: 0.015
- These are the initial values of the thresholds in the peaks dialog.
- autoscaleAlways: True
- Controls the initial setting of the autofit toggle in the control panel.
- markColor: blue
- markColor2: medium sea green
- markColor3: saddle brown
- markColor4: yellow
- color2Marks: pt
- color3Marks: 0123456789
- color4Marks:
- The resources control the colors in which marks are displayed in
the plot window. (All printouts and Exports, alas, are black and
white.) For instance, with the default settings above, p and t marks
will be painted in color 2 (medium sea green), digit marks will be
painted in color 3 (saddle brown), and any other marks will be blue.
Ones you might want to understand
- saveList: *dataFile *tUnits *tMultiplier *tGain *vUnits
*vMultiplier *vGain *control*commentText.value
*peakHeight *troughDepth *peakHalfWidth
*troughHalfWidth
*filterChain *markList
- This lists the resources to be saved in xdp files.
- filterChain:
- This lists all the currently active filters, with their parameters.
- markCommentFormat2: "t = %g, V = %g"
- markCommentFormat3: "t = %g, V = %g, area = %g, height = %g"
- These formats are used to set the comments on marks. Format2 (i.e.,
the one for two numbers) is the most used: the first %g is replaced
with the time of the mark, and the second with its voltage. Format3
is used during peak searches. The third
%g is replaced with the area of the peak, and the fourth with its
height. (Yeah, I know, it really ought to be called Format4. It's
historical.)
- markList:, XtRMarkList, ""
- This is the list of all current marks.
Most useful in xdp files. Can get very big.
Technical things you probably don't really want to know about
These are used internally, and probably should not be set in resource
files. Some of them (most importantly dataFile) are used in xdp files.
- dataFile -- name of the current datafile.
- xdpFile -- name of the current xdp
file, if there is one.
- uncompress -- "built-in" file conversions. Works like fileConvert.
- cursorExists -- True if the cursor is set.
- cursorRegionExists -- True if a region is defined.
- bufferSize
- time
- debug
- tempFileName
- plotFilter
- plotGC
- axesGC
- plotFontInfo
- plotHeadingFontInfo
- helpPid
- helpTmp
Widget resources
Widget resources are fundamental to the operation of xdatplot, as of
most Xwindows programs. There are literally thousands of them, and
they can be used to completely modify the look and behavior of an
application. Only a few of the most useful are described here. Those
hardier Xperts who want to dig deep in the xdatplot Widget hierarchy
can look at XDatplot.ad,
the application defaults file.
- XDatplot.geometry: +1-1
- peaksShell.geometry: +1+1
- filterShell.geometry: -50+1
- unitsShell.geometry:
- These resources determine where the main window and the dialog
boxes will appear on your screen.
- plot.background: white
- plot.foreground: black
- plot.width: 800
- plot.height: 400
- These set the initial size and colors of the plot window.
- hptFilter.htTauField.value: 0.01
- hpfFilter.hpFrequencyField.value: 10
- lptFilter.lpTauField.value: 0.0002
- lpfFilter.lpFrequencyField.value: 1000
- mmFilter.mmNField.value: 20
- scFilter.scFactorField.value: -1
- pkFilter.pkStartField.value: 0
- pkFilter.pkNField.value: 2
- These resources set the default values of the parameters for the
different types of filters.
- marksFilter*textString: edinout
- This is the
initial guess for a marks filter.
System defaults files
If you are a system manager, you may want to set xdatplot defaults
convenient for all your users. You can do this in a system
app-defaults file called XDatplot in /usr/lib/X11/app-defaults or (on
Sun platforms) /usr/openwin/lib/app-defaults. However, there is one
pitfall. xdatplot has fallback resources compiled in, to be used when
there is no system defaults file. If there is a
system defaults file, none of the fallback resources
are used. (Not my fault: that's the way the Xt library is written.)
So if you naively install a 2-line XDatplot to change the default
units, for instance, you will break xdatplot.
The solution is actually simple: get the complete app-defaults file XDatplot.ad
and install it. Now you can edit it to make small changes.
Leon Avery (leon@eatworms.swmed.edu)