Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: pgplotter - Constructor Up: plotter - Module Previous: pgplotwidget.done - Function


pgplotter - Tool



Package display
Module plotter


Postscript file available

stand alone pgplotter tool

include "pgplotter.g"

Constructors
pgplotter Create a pgplotter tool in standalone GUI
Functions
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



Description

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:

File
From the file menu you can do the following:
Open pgplot file
This menu item will present you with a file chooser from which you can open a new plot file. If the file already exists the existing plot commands will be displayed on the screen.
Save pgplot file
This will save the plot file to disk. The name of the plot file is shown in the lower left corner of the GUI. It will overwrite any commands that are already in the plot file.
Save to postscript file
This will save the plot file to disk in postscript format.
Print
Send a file to the printer. It is possible to send the plot directly to ghistview for a preview, also.
Dismiss
Exit the pgplotter GUI, but leave the tool alive.
Done
Exit and destroy the pgplotter tool.
Tools
This menu includes two items at present. Additional tools can be added by the user via the addtool function. That is, it is intended that users and sites might customize (e.g., add an analysis facility) by adding an item to the tools menu via the plugins facility. The standard tools which are available are:
Cursor
This tool can be used to change the cursor to crosshair style, which can facilitate reading data values from the plot.
Colormap
If the plot has installed a colormap with the ctab function, you may manipulate the colormap with this tool. From the raised menu button you can choose the style of colormap you like, and then in the plot surface ``drag'' the cursor (left-button down, and move it without releasing it) until you like the colormap. Vertical movement of the cursor changes the ``contrast'' of the cursor (how tightly bunched the colors are), and horizontal movement changes the ``brightness'' (the pixel value where the colors are displayed). That is, in the ctab command, vertical motion controls the contra parameter, and horizontal motion controls the bright parameter. It is useful to have a color wedge to see the effects of the cursor motion. One may be inserted with the wedg command.
Edit
The Edit menu is used to add new commands to the plot, or to change commands which have already been sent to the plotter. It has only one menu item:
Edit
This command lets you change or add plot commands. For example, you might want to change a line thickness, or change the number of panels displayed per page, or change the axes to logarithmic.

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.

Help
Several options are available including directing your web browser to appropriate help sections, asking a question, and reporting a bug.

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:

1.
The name of the plot file. If the plot has unsaved changes, then the name of the plot file will be ``raised'', and you can press the button to save it.
2.
The Clear button erases the screen and removes all commands from the draw history. It does not, however, empty the plot file on disk (the file name will raise after clear is pressed - if you then save the file to disk the plot will effectively be gone).
3.
The central pair of numbers in a ``groove'' gives the current mouse position in plot coordinates. If there are several panels on the page the coordinates are relative to the last panel plotted, which may not be what you expect!
4.
If the dismiss button is pressed, the GUI and its contents will go away. You will be given a chance to save unsaved changes first. This is equivalent to executing the done function.

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.



Example
- 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);



See Also
1.
Glish/PGPLOT
2.
pgplotwidget
3.
displaylist
4.
plotter




next up previous contents index
Next: pgplotter - Constructor Up: plotter - Module Previous: pgplotwidget.done - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15