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


next up previous contents index
Next: Pgplot and Window Resizing Up: Glish/PGPLOT Previous: Introduction

Subsections


Pgplot Agent Constructor

It is very easy to create a PGPLOT agent and plot to it. For example:

    f := frame ();
    pg := pgplot (f);
    pg->env (0, 2 * pi, -1, 1, 0, 0); # draw axes, etc.
    # ... plot, etc ...

As shown in the above example, the only required argument in the constructor is a frame. The fact that the frame is required is a misfeature. It should be optional in case you only want to plot to a PostScript file.


Parameter Default Values Description
parent frame frame to embed the pgplot widget in
width 200 integer width of the pgplot widget (pixels)
height 150 integer height of the pgplot widget
region [-100,100,-100,100] float[4] [xmin,xmax,ymin,ymax] (see env
axis -2 ( i.e., none) integer axis types (see env)
nxsub 1 integer Number of panels in x (see beg)
nysub 1 integer Number of panels in x (see beg)
relief 'sunken' 'flat' 'ridge' 'raised' 'sunken' 'groove' border relief
foreground 'white' X color the foreground color
background 'black' X color the background color
borderwidth 2 dimension width of the border
padx 2 pixels internal PGPLOT padding in x
pady 2 pixels internal PGPLOT padding in y
fill 'both' 'both' 'none' 'x' 'y' how to expand when resized
mincolors 2 integer minimum number of colors to accept
maxcolors 100 integer maximum number of colors to take
cmapfail F boolean if T, fail if we cannot allocate mincolors

Colormap considerations

This section is only relevant if you are operating under a pseudo-color (``8-bit'') graphics display. On a true-color (``24-bit'') display there should never be a problem with not having enough colors.

By default, if cmapfail is F, if the minimum number of colors (mincolors) cannot be allocated then the PGPLOT widget will operate in black and white no matter what the color parameters are. If cmapfail is T, then the constructor will return a fail if mincolors cannot be satisfied. In any event, no more than maxcolors colors will be taken.

If you cannot allocate the desired minimum number of colors, you should consider installing a private colormap in an outer frame by providing a newcmap=T constructor argument to that frame. Of course this cures the problem by introducing ``colormap-flashing''.


next up previous contents index
Next: Pgplot and Window Resizing Up: Glish/PGPLOT Previous: Introduction   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