Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0cfd0ff

Browse filesBrowse files
committed
Tweak padding on angular ticks to match previous.
1 parent 47f2399 commit 0cfd0ff
Copy full SHA for 0cfd0ff

File tree

Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed

‎lib/matplotlib/projections/polar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/projections/polar.py
+9-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.