Module pygplot :: Class MPlot
[show private | hide private]
[frames | no frames]

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")    # create a 2 x 2  multi-plot
>>> M.add(plot1)     # plot1, plot2, plot3 and plot4 are Plot 
>>> M.add(plot2)     #  instances
>>> 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                                                                     
NoneType _id = None                                                                  
int _own_dev = 0                                                                     

Method Details

__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)

Class Variable Details

nx

Type:
int
Value:
1                                                                     

ny

Type:
int
Value:
1                                                                     

_id

Type:
NoneType
Value:
None                                                                  

_own_dev

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Thu Feb 17 15:17:27 2005 http://epydoc.sf.net