Skip to content

Commit 0cfd0ff

Browse files
committed
Tweak padding on angular ticks to match previous.
1 parent 47f2399 commit 0cfd0ff

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/matplotlib/projections/polar.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ def __init__(self, axes, *args, **kwargs):
264264
0, 0,
265265
axes.figure.dpi_scale_trans)
266266

267-
def _update_padding(self, angle):
268-
padx = self._pad * np.cos(angle) / 72
269-
pady = self._pad * np.sin(angle) / 72
267+
def _update_padding(self, pad, angle):
268+
padx = pad * np.cos(angle) / 72
269+
pady = pad * np.sin(angle) / 72
270270
self._text1_translate._t = (padx, pady)
271271
self._text1_translate.invalidate()
272272
self._text2_translate._t = (-padx, -pady)
@@ -320,7 +320,12 @@ def update_position(self, loc):
320320
@martist.allow_rasterization
321321
def draw(self, renderer):
322322
axes = self.axes
323-
self._update_padding(self._loc * axes.get_theta_direction() +
323+
pad = self._pad
324+
if _is_full_circle_deg(axes.get_thetamin(), axes.get_thetamax()):
325+
# Preserve similar padding from previous releases for default size.
326+
pad *= 2.
327+
self._update_padding(pad,
328+
self._loc * axes.get_theta_direction() +
324329
axes.get_theta_offset())
325330

326331
# Add the padding shift to the label. This can't be applied to the

0 commit comments

Comments
 (0)