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)
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. |
|
plot (self)
Plot the Mplot. |
|
select (self,
i,
j)
Make the instance's device the current device and select the given
panel. |
Class Variable Summary |
int |
nx = 1 |
int |
ny = 1 |
__init__(self,
nx,
ny,
device='/XWINDOW',
aspect=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)
|
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.
-
|
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,
j=0)
Make the instance's device the current device and select the given
panel.
-
- Parameters:
i -
which column to select (default: 0)
(type=int)
j -
which row to select (default: 0)
(type=int)
|