Class MPlot
Class used to create a multi-panel plot with separate bounding boxes.
This is in the traditional sense, where a page is split into (n x m)
panels and each panel has a full plot: box, axes, tick lables, axis
labels, titles, etc. Required parameters are the number of columns and
rows. The user then adds Plot instances which will be ploted in the
sub-panels in order.
Example:
>>> M = MPlot(2,2,device="test.ps/PS")
>>> M.add(plot1)
>>> M.add(plot2)
>>> M.add(plot3)
>>> M.add(plot4)
>>> M.plot()
>>> M.close()
Method Summary |
|
__init__ (self,
nx,
ny,
device,
aspect,
llcs,
urcs)
Initialization routine for the MPlot class. |
|
add (self,
plot)
Add a Plot instance to the MPlot. |
|
close (self)
Close the pgplot device corresponding to the MPlot. |
|
interact (self,
bindings,
mode)
This is similar to Plot's interact, but is more of an overseer: it
figures out which panel the event is supposed to happen in, then calls
that Plot's binding do the the work. |
|
plot (self)
Plot the Mplot. |
|
replot(self)
|
|
select (self,
i)
Make the instance's device the current device and select the given
panel. |
__init__(self,
nx=1,
ny=1,
device='/XSERVE',
aspect=None,
llcs=None,
urcs=None)
(Constructor)
Initialization routine for the MPlot class.
-
- Parameters:
nx -
number of columns
(type=int)
ny -
number of rows
(type=int)
device -
Pgplot device to use (default: 1st available device)
(type=string)
aspect -
The aspect ratio (height/width) (default: device
dependent).
(type=float)
llcs -
The lower-left corners of the sub-plots.
(type=list)
urcs -
the upper-right corners of the sub-plots.
(type=list)
|
add(self,
plot)
Add a Plot instance to the MPlot. The instances are plotted in the
order they are added, filling each row and then switching to the
next.
-
|
close(self)
Close the pgplot device corresponding to the MPlot.
-
|
interact(self,
bindings=None,
mode=7)
This is similar to Plot's interact, but is more of an overseer: it
figures out which panel the event is supposed to happen in, then calls
that Plot's binding do the the work.
-
|
plot(self)
Plot the Mplot. Each sub-panel is plotted by calling that instance's
plot() method after calling pgpage() to advance to the next panel.
-
|
select(self,
i=0)
Make the instance's device the current device and select the given
panel.
-
- Parameters:
i -
which panel to select (default: 0)
(type=int)
|