Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | display | |
Module | plotter |
include "pgplotter.g"
pgplotter | Create a pgplotter tool in standalone GUI |
addtool | Add a tool to the Tools menu |
busy | Set or unset the busy symbol to the mouse cursor |
commandgui | Create the ``add commands'' GUI |
demo | Demo set for PGPLOT |
done | Close the pgplotter tool |
editgui | Create the ``edit commands'' GUI |
gui | Call back the plotter window |
plotxy1 | Plot X and Y vectors with auto-scaling |
plotxy2 | Plot X and Y vectors with auto-scaling using the right and upper axes. |
ploty | Plot Y vectors with auto-scaling |
ploty2 | Plot Y vectors with auto-scaling using the right Y axis |
psprint | Print out all of the plots in the display list |
psprinttofile | Print out all of the plots in the display list to the named file |
screen | Dismiss the plotter window |
setcolor | Set the color of subsequent plotting elements (e.g. lines, points, etc). |
setplottitle | Set the title of the plot |
setxaxisgrid | Turn on or off the display of the X-axis grid lines |
setxaxislabel | Set the x-axis label |
setxscale | Set the viewable X range of an already existing plot |
sety2axisgrid | Turn on or off the display of the Y-axis grid lines for the right Y axis. |
sety2scale | Set the viewable Y range of an already existing plot using the right Y axis |
setyaxisgrid | Turn on or off the display of the Y-axis grid lines |
setyaxislabel | Set the y-axis label |
setyscale | Set the viewable Y range of an already existing plot |
timey | Plot Y vectors versus time with auto-scaling |
timey2 | Plot Y vectors versus time with auto-scaling against the right and upper axes. |
title | Set the pgplotter window title |
tool | Show or hide a particular Tool |
type | Return the type of object, in this case "pgplotter". This function is necessary for the toolmanager |
userframe | Return an internal user Glish/Tk frame |
A ``pgplotter'' tool is used to manipulate line and raster plots. It is layered on top of both the Glish/PGPLOT commands and the pgplotwidget and so has a superset of those commands, in addition to its own functionality.
Plot commands can be entered both from the Glish command line, and also from the GUI. The plot can be saved to either a ``plot'' file or a PostScript file. The advantage of the former is that at a later time you can reopen the file and change or add to the plot. Once a PostScript file is written, it cannot be changed from this tool, it can only be overwritten.
The GUI consists of four graphical areas. The first is the menu bar, which has the following menus:
If you want to change a plot command, click on the command you want to change in the Drawlist, change the parameters in the input box, and then press Return. The change should be reflected immediately in the plot.
To add a new pgplot drawing command, select the desired command from the functions list and then click on Add to Drawlist. The Clipboard is also available for adding several commands simultaneously. If you want to remove a single command from the Drawlist, use Delete, and to clear the entire Drawlist use Clear.
Below the menu bar is a one line ``message'' window which can be writtin to via the message function. It is intended primarily for things like informing the user which mouse buttons to use in the plot window. If the message contains more than one line, a button will appear beside the message. Pressing it will display the entire message in a popup window.
Next down is the plot frame, where all the plotting action happens. If there are enough available colors, it is possible to do color (raster and line) plots in this window. If some other application has grabbed all the colours, then only black and white plots will be possible.
The bottom line has several items of interest. From left to right:
The pgplotter class is enabled for plugins. This means that you can write your own ``plugin'' (.gp file) code and it will automatically be available to the plotter. For instance, you could set up a GUI to read data, fit a model to it, and plot the fit and residuals. this procedure will be documented at a later time.
In general, a pgplotter is just a shell around an underlying pgplotwidget. All functions of pgplotwidget are available in the pgplotter. The only functions documented here are those that are unique to pgplotter.
- include 'pgplotter.g' - pg := pgplotter() - pg.env(0, 2*pi, -1, 1, 0, 0) - x := 2*pi*[1:100]/100; y := sin(x); - pg.line(x,y);