Skip to content

Polar tick improvements #9068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Sep 26, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Tweak padding on angular ticks to match previous.
  • Loading branch information
QuLogic committed Sep 25, 2017
commit 5b8d2df03aa595272cd717d583e7b836d24d3650
12 changes: 8 additions & 4 deletions lib/matplotlib/projections/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ def _apply_params(self, **kw):
if not trans.contains_branch(self._text2_translate):
self.label2.set_transform(trans + self._text2_translate)

def _update_padding(self, angle):
padx = self._pad * np.cos(angle) / 72
pady = self._pad * np.sin(angle) / 72
def _update_padding(self, pad, angle):
padx = pad * np.cos(angle) / 72
pady = pad * np.sin(angle) / 72
self._text1_translate._t = (padx, pady)
self._text1_translate.invalidate()
self._text2_translate._t = (-padx, -pady)
Expand Down Expand Up @@ -329,7 +329,11 @@ def update_position(self, loc):
if self.label2On:
self.label2.set_rotation(angle)

self._update_padding(self._loc * axes.get_theta_direction() +
# This extra padding helps preserve the look from previous releases but
# is also needed because labels are anchored to their center.
pad = self._pad + 7
self._update_padding(pad,
self._loc * axes.get_theta_direction() +
axes.get_theta_offset())


Expand Down