backend_tkagg.py 592 B

1234567891011121314151617181920
  1. from . import _backend_tk
  2. from .backend_agg import FigureCanvasAgg
  3. from ._backend_tk import _BackendTk, FigureCanvasTk
  4. from ._backend_tk import ( # noqa: F401 # pylint: disable=W0611
  5. FigureManagerTk, NavigationToolbar2Tk)
  6. class FigureCanvasTkAgg(FigureCanvasAgg, FigureCanvasTk):
  7. def draw(self):
  8. super().draw()
  9. self.blit()
  10. def blit(self, bbox=None):
  11. _backend_tk.blit(self._tkphoto, self.renderer.buffer_rgba(),
  12. (0, 1, 2, 3), bbox=bbox)
  13. @_BackendTk.export
  14. class _BackendTkAgg(_BackendTk):
  15. FigureCanvas = FigureCanvasTkAgg