MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / FigureCanvasBase

Class FigureCanvasBase

lib/matplotlib/backend_bases.py:1709–2472  ·  view source on GitHub ↗

The canvas the figure renders into. Attributes ---------- figure : `~matplotlib.figure.Figure` A high-level figure instance.

Source from the content-addressed store, hash-verified

1707
1708
1709class FigureCanvasBase:
1710 """
1711 The canvas the figure renders into.
1712
1713 Attributes
1714 ----------
1715 figure : `~matplotlib.figure.Figure`
1716 A high-level figure instance.
1717 """
1718
1719 # Set to one of {"qt", "gtk3", "gtk4", "wx", "tk", "macosx"} if an
1720 # interactive framework is required, or None otherwise.
1721 required_interactive_framework = None
1722
1723 # The manager class instantiated by new_manager.
1724 # (This is defined as a classproperty because the manager class is
1725 # currently defined *after* the canvas class, but one could also assign
1726 # ``FigureCanvasBase.manager_class = FigureManagerBase``
1727 # after defining both classes.)
1728 manager_class = _api.classproperty(lambda cls: FigureManagerBase)
1729
1730 events = [
1731 'resize_event',
1732 'draw_event',
1733 'key_press_event',
1734 'key_release_event',
1735 'button_press_event',
1736 'button_release_event',
1737 'scroll_event',
1738 'motion_notify_event',
1739 'pick_event',
1740 'figure_enter_event',
1741 'figure_leave_event',
1742 'axes_enter_event',
1743 'axes_leave_event',
1744 'close_event'
1745 ]
1746
1747 fixed_dpi = None
1748
1749 filetypes = _default_filetypes
1750
1751 # global counter to assign unique ids to blit backgrounds
1752 # see _get_blit_background_id()
1753 _last_blit_background_id = 0
1754
1755 @_api.classproperty
1756 def supports_blit(cls):
1757 """If this Canvas sub-class supports blitting."""
1758 return (hasattr(cls, "copy_from_bbox")
1759 and hasattr(cls, "restore_region"))
1760
1761 def __init__(self, figure=None):
1762 from matplotlib.figure import Figure
1763 self._fix_ipython_backend2gui()
1764 self._is_idle_drawing = True
1765 self._is_saving = False
1766 if figure is None:

Callers 5

thumbnailFunction · 0.90
_set_base_canvasMethod · 0.90
test_canvas_ctorFunction · 0.90
test_canvas_changeFunction · 0.90

Calls

no outgoing calls

Tested by 3

test_canvas_ctorFunction · 0.72
test_canvas_changeFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…