backend_tkagg.py 676 B

123456789101112131415161718192021
  1. from . import _backend_tk
  2. from .backend_agg import FigureCanvasAgg
  3. from ._backend_tk import (
  4. _BackendTk, FigureCanvasTk, FigureManagerTk, NavigationToolbar2Tk)
  5. class FigureCanvasTkAgg(FigureCanvasAgg, FigureCanvasTk):
  6. def draw(self):
  7. super(FigureCanvasTkAgg, self).draw()
  8. _backend_tk.blit(self._tkphoto, self.renderer._renderer, (0, 1, 2, 3))
  9. self._master.update_idletasks()
  10. def blit(self, bbox=None):
  11. _backend_tk.blit(
  12. self._tkphoto, self.renderer._renderer, (0, 1, 2, 3), bbox=bbox)
  13. self._master.update_idletasks()
  14. @_BackendTk.export
  15. class _BackendTkAgg(_BackendTk):
  16. FigureCanvas = FigureCanvasTkAgg