Previous topic


Next topic


This Page


A wxPython backend for Agg. This uses the GUI widgets written by Jeremy O’Donoghue ( and the Agg backend by John Hunter (

Copyright (C) 2003-5 Jeremy O’Donoghue, John Hunter, Illinois Institute of Technology

License: This work is licensed under the matplotlib license( PSF compatible). A copy should be included with this source code.

class matplotlib.backends.backend_wxagg.FigureCanvasWxAgg(parent, id, figure)

Bases: matplotlib.backends.backend_agg.FigureCanvasAgg, matplotlib.backends.backend_wx.FigureCanvasWx

The FigureCanvas contains the figure and does event handling.

In the wxPython backend, it is derived from wxPanel, and (usually) lives inside a frame instantiated by a FigureManagerWx. The parent window probably implements a wxSizer to control the displayed control size - but we give a hint as to our preferred minimum size.

Initialise a FigureWx instance.

  • Initialise the FigureCanvasBase and wxPanel parents.
  • Set event handlers for: EVT_SIZE (Resize event) EVT_PAINT (Paint event)

Transfer the region of the agg buffer defined by bbox to the display. If bbox is None, the entire buffer is transferred.


Render the figure using agg.

filetypes = {'pgf': 'LaTeX PGF Figure', 'svgz': 'Scalable Vector Graphics', 'tiff': 'Tagged Image File Format', 'jpg': 'Joint Photographic Experts Group', 'raw': 'Raw RGBA bitmap', 'jpeg': 'Joint Photographic Experts Group', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'emf': 'Enhanced Metafile', 'svg': 'Scalable Vector Graphics', 'eps': 'Encapsulated Postscript', 'rgba': 'Raw RGBA bitmap', 'pdf': 'Portable Document Format', 'tif': 'Tagged Image File Format'}
print_figure(filename, *args, **kwargs)
class matplotlib.backends.backend_wxagg.FigureFrameWxAgg(num, fig)

Bases: matplotlib.backends.backend_wx.FigureFrameWx

class matplotlib.backends.backend_wxagg.NavigationToolbar2WxAgg(canvas)

Bases: matplotlib.backends.backend_wx.NavigationToolbar2Wx

get_canvas(frame, fig)
matplotlib.backends.backend_wxagg.new_figure_manager(num, *args, **kwargs)

Create a new figure manager instance

matplotlib.backends.backend_wxagg.new_figure_manager_given_figure(num, figure)

Create a new figure manager instance for the given figure.