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

Method draw

lib/matplotlib/backends/backend_tkcairo.py:11–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10class FigureCanvasTkCairo(FigureCanvasCairo, FigureCanvasTk):
11 def draw(self):
12 width = int(self.figure.bbox.width)
13 height = int(self.figure.bbox.height)
14 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
15 self._renderer.set_context(cairo.Context(surface))
16 self._renderer.dpi = self.figure.dpi
17 self.figure.draw(self._renderer)
18 buf = np.reshape(surface.get_data(), (height, width, 4))
19 _backend_tk.blit(
20 self._tkphoto, buf,
21 (2, 1, 0, 3) if sys.byteorder == "little" else (1, 2, 3, 0))
22
23
24@_BackendTk.export

Callers

nothing calls this directly

Calls 3

set_contextMethod · 0.80
get_dataMethod · 0.45
blitMethod · 0.45

Tested by

no test coverage detected