X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,8 @@ def add_patch(self, p):
if p.get_clip_path() is None:
p.set_clip_path(self.patch)
self._update_patch_limits(p)
if self.name != 'rectilinear':
p.get_path()._interpolation_steps = max(p.get_path()._interpolation_steps, 100)
self.patches.append(p)
p._remove_method = lambda h: self.patches.remove(h)
return p
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions lib/matplotlib/tests/test_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,17 @@ def test_multi_color_hatch():
with mstyle.context({'hatch.color': 'C{}'.format(i)}):
r = Rectangle((i-.8/2, 5), .8, 1, hatch='//', fc='none')
ax.add_patch(r)


@image_comparison(baseline_images=['polar_proj'], extensions=['png'])
def test_adding_rectangle_patch_with_polar_projection():
fig = plt.figure()
ax = fig.add_subplot(111, projection='polar')

# add quadrant as example
ax.add_patch(
mpatches.Rectangle(
(0, 1), width=np.pi * 0.5, height=0.5
)
)
ax.set_rmax(2)
X Tutup