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

Method draw

lib/matplotlib/contour.py:1285–1304  ·  view source on GitHub ↗
(self, renderer)

Source from the content-addressed store, hash-verified

1283
1284 @artist.allow_rasterization
1285 def draw(self, renderer):
1286 paths = self._paths
1287 n_paths = len(paths)
1288 if not self.filled or all(hatch is None for hatch in self.hatches):
1289 super().draw(renderer)
1290 return
1291 # In presence of hatching, draw contours one at a time.
1292 edgecolors = self.get_edgecolors()
1293 if edgecolors.size == 0:
1294 edgecolors = ("none",)
1295 for idx in range(n_paths):
1296 with self._cm_set(
1297 paths=[paths[idx]],
1298 hatch=self.hatches[idx % len(self.hatches)],
1299 array=[self.get_array()[idx]],
1300 linewidths=[self.get_linewidths()[idx % len(self.get_linewidths())]],
1301 linestyles=[self.get_linestyles()[idx % len(self.get_linestyles())]],
1302 edgecolors=edgecolors[idx % len(edgecolors)],
1303 ):
1304 super().draw(renderer)
1305
1306
1307@_docstring.interpd

Callers 1

Calls 3

_cm_setMethod · 0.80
get_arrayMethod · 0.80
get_linewidthsMethod · 0.80

Tested by

no test coverage detected