Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 15 commits intomatplotlib:masterfromQuLogic:polar-ticks
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
15 commits
Select commitHold shift + click to select a range
73e4425
Use custom *Axis in polar plots.
QuLogicAug 4, 2017
30b4a6c
Add a custom ThetaTick for polar plots.
QuLogicAug 4, 2017
8c430e8
Add a custom RadialTick for polar plots.
QuLogicAug 4, 2017
386bb30
Apply padding to radial ticks in polar plots.
QuLogicAug 10, 2017
ba242b1
Apply padding to theta ticks in polar plots.
QuLogicAug 10, 2017
a2531ee
Add clip path when resetting radial ticks.
QuLogicAug 29, 2017
5f1ecbd
Add info about polar tick(label) changes.
QuLogicAug 29, 2017
9529875
Restore old polar tick label behaviour for full circles.
QuLogicAug 30, 2017
5b8d2df
Tweak padding on angular ticks to match previous.
QuLogicAug 30, 2017
33377ce
Enable ticks on some polar plot tests.
QuLogicAug 31, 2017
80a5f10
Cleanup polar tick changes based on review.
QuLogicAug 31, 2017
77e2532
Ensure polar ticks are always "right-side up".
QuLogicSep 25, 2017
228ee53
Add an 'auto' option to label rotation.
QuLogicSep 25, 2017
549c07f
Re-create polar tests images with new ticks.
QuLogicSep 25, 2017
15c57bd
Fix small grammatical errors.
QuLogicSep 26, 2017
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
6 changes: 6 additions & 0 deletionsdoc/users/whats_new.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,6 +62,12 @@ negative values are simply used as labels, and the real radius is shifted by
the configured minimum. This release also allows negative radii to be used for
grids and ticks, which were previously silently ignored.

Radial ticks have been modified to be parallel to the circular grid line, and
angular ticks have been modified to be parallel to the grid line. It may also
be useful to rotate tick *labels* to match the boundary. Calling
``ax.tick_params(rotation='auto')`` will enable new behavior: radial tick
labels will be parallel to the circular grid line, and angular tick labels will
be perpendicular to the grid line (i.e., parallel to the outer boundary.)


Merge JSAnimation
Expand Down
24 changes: 22 additions & 2 deletionslib/matplotlib/axis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -140,7 +140,7 @@ def __init__(self, axes, loc, label,
labelsize = rcParams['%s.labelsize' % name]
self._labelsize = labelsize

self._labelrotation =labelrotation
self._set_labelrotation(labelrotation)

if zorder is None:
if major:
Expand All@@ -167,6 +167,20 @@ def __init__(self, axes, loc, label,

self.update_position(loc)

def _set_labelrotation(self, labelrotation):
if isinstance(labelrotation, six.string_types):
mode = labelrotation
angle = 0
elif isinstance(labelrotation, (tuple, list)):
mode, angle = labelrotation
else:
mode = 'default'
angle = labelrotation
if mode not in ('auto', 'default'):
raise ValueError("Label rotation mode must be 'default' or "
"'auto', not '{}'.".format(mode))
self._labelrotation = (mode, angle)

def apply_tickdir(self, tickdir):
"""
Calculate self._pad and self._tickmarkers
Expand DownExpand Up@@ -331,8 +345,14 @@ def _apply_params(self, **kw):
self.tick2line.set(**tick_kw)
for k, v in six.iteritems(tick_kw):
setattr(self, '_' + k, v)

if 'labelrotation' in kw:
self._set_labelrotation(kw.pop('labelrotation'))
self.label1.set(rotation=self._labelrotation[1])
self.label2.set(rotation=self._labelrotation[1])

label_list = [k for k in six.iteritems(kw)
if k[0] in ['labelsize', 'labelcolor', 'labelrotation']]
if k[0] in ['labelsize', 'labelcolor']]
if label_list:
label_kw = {k[5:]: v for k, v in label_list}
self.label1.set(**label_kw)
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp