Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 2 additions & 3 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3071,9 +3071,8 @@ def _update_title_position(self, renderer):
top = -np.inf
for ax in axs:
bb = None
xticklabel_top = any(tick.label2.get_visible() for tick in
[ax.xaxis.majorTicks[0], ax.xaxis.minorTicks[0]])
if (xticklabel_top or ax.xaxis.get_label_position() == 'top'):
if (ax.xaxis.get_ticks_position() in ['top', 'unknown'] or
ax.xaxis.get_label_position() == 'top'):
bb = ax.xaxis.get_tightbbox(renderer)
if bb is None:
# Extent of the outline for colorbars, of the axes otherwise.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions lib/matplotlib/tests/test_polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ def test_polar_rlabel_position():
ax.tick_params(rotation='auto')


@image_comparison(['polar_title_position.png'], style='mpl20')
def test_polar_title_position():
fig = plt.figure()
ax = fig.add_subplot(projection='polar')
ax.set_title('foo')


@image_comparison(['polar_theta_wedge'], style='default')
def test_polar_theta_limits():
r = np.arange(0, 3.0, 0.01)
Expand Down
Loading