[ overview : containers : components : style : config : functions ]
number means it can be either an integer or a float.
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.
The axis labels for the bottom and left of the frame.
If 1 use log scaling, otherwise linear.
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®):
The label, log, and range attributes are the same as the ones above. For instance, when you set p.xlog you're actually setting p.x1.log. The .label_offset and .label_style attributes let you control the placement and style of the axis label.
Grid lines are parallel to and coincident with the ticks.
This controls the direction the ticks and subticks are drawn in. If +1 they point toward the ticklabels and if -1 they point away from the ticklabels.
If .ticks is set to None they will be automagically generated. If set to an integer n, n equally spaced ticks will be drawn. You can provide your own values by setting .ticks to a sequence.
Similar to .ticks*, except when .subticks is set to an integer it sets the number of subticks drawn between ticks, not the total number of subticks. If .draw_subticks is set to None subticks will be drawn only if ticks are drawn.
Ticklabels are the labels marking the values of the ticks. You can provide your own labels by setting .ticklabels to a list of strings.
The spine is the line perpendicular to the ticks.
If .draw_axis is 0 the spine, ticks, and subticks are not drawn; otherwise it has no effect. If .draw_nothing is 1 nothing is drawn; otherwise it has no effect.
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"
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)
If set to 1 every cell will have the same limits. Otherwise they are only forced to be the same across rows and down columns.
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).
Plot behaves the same as FramedPlot, except no axes, axis labels, or titles are drawn.
Attributes: (same as FramedPlot, minus the title/label options)
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.
These methods and attributes are common to all containers.
[ home ] [ last modified Oct 12 2001 ]