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

Commit8721632

Browse files
authored
Merge pull request#29416 from meeseeksmachine/auto-backport-of-pr-29382-on-v3.10.x
Backport PR#29382 on branch v3.10.x (Fix title position for polar plots)
2 parents103b6b6 +f9e3c74 commit8721632

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

‎lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,9 +3071,8 @@ def _update_title_position(self, renderer):
30713071
top=-np.inf
30723072
foraxinaxs:
30733073
bb=None
3074-
xticklabel_top=any(tick.label2.get_visible()fortickin
3075-
[ax.xaxis.majorTicks[0],ax.xaxis.minorTicks[0]])
3076-
if (xticklabel_toporax.xaxis.get_label_position()=='top'):
3074+
if (ax.xaxis.get_ticks_position()in ['top','unknown']or
3075+
ax.xaxis.get_label_position()=='top'):
30773076
bb=ax.xaxis.get_tightbbox(renderer)
30783077
ifbbisNone:
30793078
# Extent of the outline for colorbars, of the axes otherwise.

‎lib/matplotlib/tests/test_polar.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ def test_polar_rlabel_position():
220220
ax.tick_params(rotation='auto')
221221

222222

223+
@image_comparison(['polar_title_position.png'],style='mpl20')
224+
deftest_polar_title_position():
225+
fig=plt.figure()
226+
ax=fig.add_subplot(projection='polar')
227+
ax.set_title('foo')
228+
229+
223230
@image_comparison(['polar_theta_wedge'],style='default')
224231
deftest_polar_theta_limits():
225232
r=np.arange(0,3.0,0.01)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp