BIGGLES 1.6.6

reference guide : containers


[ overview : containers : components : style : config : functions ]

conventions

number means it can be either an integer or a float.

containers

FramedPlot ()

This object represents a framed plot, where the axes surround the plotting region, instead of intersecting it. Here's an example. You build a plot by adding components, using:

p.add( component... )

where p is a FramedPlot object. Components are rendered in the order they're added.

Basic Attributes:

These should be sufficient for casual use, but often you'll want greater control over the frame.

Each side of the frame is an independent axis object: p.x1 (bottom), p.y1 (left), p.x2 (top), and p.y2 (right). The axis attributes below apply to each of these objects. So for example, to label the right side of the frame, you would say:

p.y2.label = "something"

Axis Attributes (in glorious RandomOrder®):

So let's say you wanted to color all the ticks red. You could write:

p.x1.ticks_style["color"] = "red"
p.x2.ticks_style["color"] = "red"
p.y1.ticks_style["color"] = "red"
p.y2.ticks_style["color"] = "red"

but it's tedious, and hazardous for your hands. FramedPlot provides a mechanism for manipulating groups of axes, through the use of the following pseudo-attributes:

.frame		==>	.x1, .x2, .y1, .y2
.frame1		==>	.x1, .y1
.frame2		==>	.x2, .y2
.x		==>	.x1, .x2
.y		==>	.y1, .y2

which lets you write

p.frame.ticks_style["color"] = "red"

instead.

FramedArray ( nrows, ncols )

Use this container if you want to plot an array of similar plots. Here's an example. To add a component to a specific cell, use

a[i,j].add( component... )

where a is a FramedArray object, i is the row number, and j is the column number. You can also add a component to all the cells at once using:

a.add( component... )

Attributes: (in addition to the basic FramedPlot ones)

HammerAitoffPlot ( l0=0, b0=0, rot=0 )

This plot implements Hammer-Aitoff coordinates, which are an equal-area projection of the sphere into the plane, commonly used in astrophysics. The spherical coordinates l and b are used where l runs from -pi to pi and b from -pi/2 to pi/2. The equator is b=0, and b = +/-pi/2 are the north/south poles. If you want to use this to plot maps of the globe, then l and b are east longitude and north latitude. Here's an example. You build a plot by adding components, using:

p.add( component... )

where p is a HammerAitoffPlot object. Components are rendered in the order they're added. You can specify the coordinates of the plot center using (l0,b0) and a rotation about that point (rot).

Attributes:

Plot ()

Plot behaves the same as FramedPlot, except no axes, axis labels, or titles are drawn.

Attributes: (same as FramedPlot, minus the title/label options)

Table ( nrows, ncols )

This container allows you to arrange other containers in a grid. Here's an example. To add a container to a specific cell, use

t[i,j] = container

where t is the Table object, i is the row number, and j is the column number. Rows and columns are numbered starting from 0, with t[0,0] being the upperleft corner cell.

Attributes:

container methods

These methods and attributes are common to all containers.

.aspect_ratio = None | number
Force the aspect ratio (height divided by width) to be a particular value. If None the container fills the available space.
.page_margin = number
Extra padding applied when rendering the head container (ie, the container from which .show(), .write_XXX(), etc was called).
.title = None | string
Draw a plot-centered supertitle.
.title_offset = number
The distance between the title and the container's contents.
.title_style = map
Want a red title? Try p.title_style["color"] = "red".
.show ()
Plot the object in an X window.
.psprint ( printcmd=None )
Print the plot as PostScript using printcmd. If None, use default value ("lpr").
.write_eps ( filename )
Save plot as an Encapsulated PostScript (EPS) file. If filename is "-" output is sent to stdout.
.write_img ( [type,] width, height, filename )
Save plot as an image. Valid types are "png", "svg", and "gif". Note that the GIF images produced do not use (patented) LZW compression. If filename is "-" output is sent to stdout. If type is omitted the last three letters of filename are used.

  SourceForge Logo   [ home ] [ last modified Oct 12 2001 ]