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

Commitd1214fa

Browse files
authored
Merge pull request#11114 from matplotlib/auto-backport-of-pr-10792
Backport PR#10792 on branch v2.2.x
2 parentsbeef8ba +4034b85 commitd1214fa

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

‎lib/matplotlib/projections/polar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ def update_position(self, loc):
635635
text_angle=user_angle
636636
ifself.label1On:
637637
iffull:
638-
ha='left'
639-
va='bottom'
638+
ha=self.label1.get_ha()
639+
va=self.label1.get_va()
640640
else:
641641
ha,va=self._determine_anchor(mode,angle,direction>0)
642642
self.label1.set_ha(ha)

‎lib/matplotlib/tests/test_axes.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,38 @@ def test_polar_coord_annotations():
456456
ax.set_ylim(-20,20)
457457

458458

459+
@image_comparison(baseline_images=['polar_alignment'],extensions=['png'])
460+
deftest_polar_alignment():
461+
'''
462+
Test that changing the vertical/horizontal alignment of a polar graph
463+
works as expected '''
464+
ranges= [(0,5), (0,5)]
465+
466+
angles=np.arange(0,360,90)
467+
468+
levels=5
469+
470+
fig=plt.figure()
471+
472+
figureSize= [0.1,0.1,0.8,0.8]
473+
474+
horizontal=fig.add_axes(figureSize,polar=True,label='horizontal')
475+
vertical=fig.add_axes(figureSize,polar=True,label='vertical')
476+
477+
axes= [horizontal,vertical]
478+
479+
horizontal.set_thetagrids(angles)
480+
481+
vertical.patch.set_visible(False)
482+
483+
foriinrange(2):
484+
grid=np.linspace(*ranges[i],num=levels)
485+
gridValues= [0,0.2,0.4,0.6,0.8,1]
486+
axes[i].set_rgrids(gridValues,angle=angles[i],
487+
horizontalalignment='left',
488+
verticalalignment='top')
489+
490+
459491
@image_comparison(baseline_images=['fill_units'],extensions=['png'],
460492
savefig_kwarg={'dpi':60})
461493
deftest_fill_units():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp