(self, renderer)
| 2539 | |
| 2540 | @artist.allow_rasterization |
| 2541 | def draw(self, renderer): |
| 2542 | if not self.get_visible(): |
| 2543 | return |
| 2544 | renderer.open_group(self.__class__.__name__, self.get_gid()) |
| 2545 | transform = self.get_transform() |
| 2546 | offset_trf = self.get_offset_transform() |
| 2547 | offsets = self.get_offsets() |
| 2548 | |
| 2549 | if self.have_units(): |
| 2550 | xs = self.convert_xunits(offsets[:, 0]) |
| 2551 | ys = self.convert_yunits(offsets[:, 1]) |
| 2552 | offsets = np.column_stack([xs, ys]) |
| 2553 | |
| 2554 | self.update_scalarmappable() |
| 2555 | |
| 2556 | if not transform.is_affine: |
| 2557 | coordinates = self._coordinates.reshape((-1, 2)) |
| 2558 | coordinates = transform.transform(coordinates) |
| 2559 | coordinates = coordinates.reshape(self._coordinates.shape) |
| 2560 | transform = transforms.IdentityTransform() |
| 2561 | else: |
| 2562 | coordinates = self._coordinates |
| 2563 | |
| 2564 | if not offset_trf.is_affine: |
| 2565 | offsets = offset_trf.transform_non_affine(offsets) |
| 2566 | offset_trf = offset_trf.get_affine() |
| 2567 | |
| 2568 | gc = renderer.new_gc() |
| 2569 | gc.set_snap(self.get_snap()) |
| 2570 | self._set_gc_clip(gc) |
| 2571 | gc.set_linewidth(self.get_linewidth()[0]) |
| 2572 | |
| 2573 | if self._shading == 'gouraud': |
| 2574 | triangles, colors = self._convert_mesh_to_triangles(coordinates) |
| 2575 | renderer.draw_gouraud_triangles( |
| 2576 | gc, triangles, colors, transform.frozen()) |
| 2577 | else: |
| 2578 | renderer.draw_quad_mesh( |
| 2579 | gc, transform.frozen(), |
| 2580 | coordinates.shape[1] - 1, coordinates.shape[0] - 1, |
| 2581 | coordinates, offsets, offset_trf, |
| 2582 | # Backends expect flattened rgba arrays (n*m, 4) for fc and ec |
| 2583 | self.get_facecolor().reshape((-1, 4)), |
| 2584 | self._antialiased, self.get_edgecolors().reshape((-1, 4))) |
| 2585 | gc.restore() |
| 2586 | renderer.close_group(self.__class__.__name__) |
| 2587 | self.stale = False |
| 2588 | |
| 2589 | def get_cursor_data(self, event): |
| 2590 | contained, info = self.contains(event) |
nothing calls this directly
no test coverage detected