| 736 | __str__ = mtransforms._make_str_method("_center", "_viewLim", "_originLim") |
| 737 | |
| 738 | def get_points(self): |
| 739 | # docstring inherited |
| 740 | if self._invalid: |
| 741 | points = self._viewLim.get_points().copy() |
| 742 | # Scale angular limits to work with Wedge. |
| 743 | points[:, 0] *= 180 / np.pi |
| 744 | if points[0, 0] > points[1, 0]: |
| 745 | points[:, 0] = points[::-1, 0] |
| 746 | |
| 747 | # Scale radial limits based on origin radius. |
| 748 | points[:, 1] -= self._originLim.y0 |
| 749 | |
| 750 | # Scale radial limits to match axes limits. |
| 751 | rscale = 0.5 / points[1, 1] |
| 752 | points[:, 1] *= rscale |
| 753 | width = min(points[1, 1] - points[0, 1], 0.5) |
| 754 | |
| 755 | # Generate bounding box for wedge. |
| 756 | wedge = mpatches.Wedge(self._center, points[1, 1], |
| 757 | points[0, 0], points[1, 0], |
| 758 | width=width) |
| 759 | self.update_from_path(wedge.get_path()) |
| 760 | |
| 761 | # Ensure equal aspect ratio. |
| 762 | w, h = self._points[1] - self._points[0] |
| 763 | deltah = max(w - h, 0) / 2 |
| 764 | deltaw = max(h - w, 0) / 2 |
| 765 | self._points += np.array([[-deltaw, -deltah], [deltaw, deltah]]) |
| 766 | |
| 767 | self._invalid = 0 |
| 768 | |
| 769 | return self._points |
| 770 | |
| 771 | |
| 772 | class PolarAxes(Axes): |