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

Method draw

lib/matplotlib/inset.py:245–281  ·  view source on GitHub ↗
(self, renderer)

Source from the content-addressed store, hash-verified

243 return tuple(self._connectors)
244
245 def draw(self, renderer):
246 # docstring inherited
247 conn_same_style = []
248
249 # Figure out which connectors have the same style as the box, so should
250 # be drawn as a single path.
251 for conn in self.connectors or []:
252 if conn.get_visible():
253 drawn = False
254 for s in _shared_properties:
255 if artist.getp(self._rectangle, s) != artist.getp(conn, s):
256 # Draw this connector by itself
257 conn.draw(renderer)
258 drawn = True
259 break
260
261 if not drawn:
262 # Connector has same style as box.
263 conn_same_style.append(conn)
264
265 if conn_same_style:
266 # Since at least one connector has the same style as the rectangle, draw
267 # them as a compound path.
268 artists = [self._rectangle] + conn_same_style
269 paths = [a.get_transform().transform_path(a.get_path()) for a in artists]
270 path = Path.make_compound_path(*paths)
271
272 # Create a temporary patch to draw the path.
273 p = PathPatch(path)
274 p.update_from(self._rectangle)
275 p.set_transform(transforms.IdentityTransform())
276 p.draw(renderer)
277
278 return
279
280 # Just draw the rectangle
281 self._rectangle.draw(renderer)
282
283 @_api.deprecated(
284 '3.10',

Callers

nothing calls this directly

Calls 8

PathPatchClass · 0.90
make_compound_pathMethod · 0.80
get_visibleMethod · 0.45
transform_pathMethod · 0.45
get_transformMethod · 0.45
get_pathMethod · 0.45
update_fromMethod · 0.45
set_transformMethod · 0.45

Tested by

no test coverage detected