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

Class _Layout


A class that handles the page layout of the graph. Instead of using pgsubp, which only allows equal splitting of the page, we're going to make a custom version that allows for different sized panels. It keeps track of the width/height of each cell and uses pgsvp to do the same effect as pgpage() or pgpanl().
Method Summary
  __init__(self)
  add_border(self, bx1, bx2, by1, by2)
Adjust all the coordinates of all the panels to add border space around the entire page (border sizes are measured in normalized device coordinates).
  add_panel(self, llc, urc)
Add a panel to the layout.
  pgpage(self)
Select the next panel, or do an actual pgpage if we're on the last panel.
  pgqvp(self, i)
drop-in replacement for pgqvp.
  pgsvp(self, vx1, vx2, vy1, vy2)
Set the viewport inside the panel.
  select(self, i)
Select current panel.
  which_vp(self, vx, vy)
Given a normalized device coordinate (vx,vy), return which viewport, if any, corresponds to this position.

Method Details

add_border(self, bx1=0, bx2=0, by1=0, by2=0)

Adjust all the coordinates of all the panels to add border space around the entire page (border sizes are measured in normalized device coordinates). Successive calls should have a cumulative effect.

add_panel(self, llc, urc)

Add a panel to the layout. Right now the user and over-lay panels... do we want this? The only checking done is to make sure that the panel is entirely on the device.

pgpage(self)

Select the next panel, or do an actual pgpage if we're on the last panel.

pgqvp(self, i=None)

drop-in replacement for pgqvp.

pgsvp(self, vx1, vx2, vy1, vy2)

Set the viewport inside the panel. Normally, the user would do this via pgsubp and then expect the pgsvp coordinates to be normalized inside that panel, so vx1,vx2,vy1 and vy2 are all normalized, but relative to the viewport.

select(self, i)

Select current panel. Kind of like pgpanl.

which_vp(self, vx, vy)

Given a normalized device coordinate (vx,vy), return which viewport, if any, corresponds to this position. If none, returns -1. Assume that there is no overlap of cells.

Generated by Epydoc 2.1 on Tue Sep 25 12:14:22 2007 http://epydoc.sf.net