Package matplotlib :: Module backend_bases :: Class FigureCanvasBase
[show private | hide private]
[frames | no frames]

Class FigureCanvasBase


The canvas the figure renders into.

Public attribute

  figure - A Figure instance

Method Summary
  __init__(self, figure)
  blit(self, bbox)
blit the canvas in bbox (default entire canvas)
  button_press_event(self, x, y, button, guiEvent)
Backend derived classes should call this function on any mouse button press.
  button_release_event(self, x, y, button, guiEvent)
Backend derived classes should call this function on any mouse button release.
  draw(self, *args, **kwargs)
Render the figure
  draw_cursor(self, event)
Draw a cursor in the event.axes if inaxes is not None.
  draw_event(self, renderer)
  draw_idle(self, *args, **kwargs)
draw only if idle; defaults to draw but backends can overrride
  get_width_height(self)
return the figure width and height in points or pixels (depending on the backend), truncated to integers
  key_press_event(self, key, guiEvent)
  key_release_event(self, key, guiEvent)
  motion_notify_event(self, x, y, guiEvent)
Backend derived classes should call this function on any motion-notify-event.
  mpl_connect(self, s, func)
Connect event with string s to func.
  mpl_disconnect(self, cid)
Connect s to func.
  print_figure(self, filename, dpi, facecolor, edgecolor, orientation)
Render the figure to hardcopy.
  switch_backends(self, FigureCanvasClass)
instantiate an instance of FigureCanvasClass

Class Variable Summary
tuple events = ('key_press_event', 'key_release_event', 'butto...

Method Details

blit(self, bbox=None)

blit the canvas in bbox (default entire canvas)

button_press_event(self, x, y, button, guiEvent=None)

Backend derived classes should call this function on any mouse button press. x,y are the canvas coords: 0,0 is lower, left. button and key are as defined in MouseEvent

button_release_event(self, x, y, button, guiEvent=None)

Backend derived classes should call this function on any mouse button release. x,y are the canvas coords: 0,0 is lower, left. button and key are as defined in MouseEvent

draw(self, *args, **kwargs)

Render the figure

draw_cursor(self, event)

Draw a cursor in the event.axes if inaxes is not None. Use native GUI drawing for efficiency if possible

draw_idle(self, *args, **kwargs)

draw only if idle; defaults to draw but backends can overrride

get_width_height(self)

return the figure width and height in points or pixels (depending on the backend), truncated to integers

motion_notify_event(self, x, y, guiEvent=None)

Backend derived classes should call this function on any motion-notify-event. x,y are the canvas coords: 0,0 is lower, left. button and key are as defined in MouseEvent

mpl_connect(self, s, func)

Connect event with string s to func.  The signature of func is

  def func(event)

where event is a MplEvent.  The following events are recognized

 'draw_event'
 'key_press_event'
 'key_release_event'         
 'button_press_event'
 'button_release_event'
 'motion_notify_event'

 For the three events above, if the mouse is over the axes,
 the variable event.inaxes will be set to the axes it is over,
 and additionally, the variables event.xdata and event.ydata
 will be defined.  This is the mouse location in data coords.
 See backend_bases.MplEvent.

return value is a connection id that can be used with
mpl_disconnect

mpl_disconnect(self, cid)

Connect s to func. return an id that can be used with disconnect Method should return None

print_figure(self, filename, dpi=300, facecolor='w', edgecolor='w', orientation='portrait')

Render the figure to hardcopy. Set the figure patch face and edge colors. This is useful because some of the GUIs have a gray figure face color background and you'll probably want to override this on hardcopy.

filename - can also be a file object on image backends orientation - only currently applies to PostScript printing.

switch_backends(self, FigureCanvasClass)

instantiate an instance of FigureCanvasClass

This is used for backend switching, eg, to instantiate a FigureCanvasPS from a FigureCanvasGTK. Note, deep copying is not done, so any changes to one of the instances (eg, setting figure size or line props), will be reflected in the other

Class Variable Details

events

Type:
tuple
Value:
('key_press_event',
 'key_release_event',
 'button_press_event',
 'button_release_event',
 'motion_notify_event')                                                

Generated by Epydoc 2.1 on Mon Aug 28 13:47:49 2006 http://epydoc.sf.net