FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix title position for polar plots by rcomer · Pull Request #29382 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .png  (1) .py  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 2 additions & 3 deletions lib/matplotlib/axes/_base.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3068,9 +3068,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.
Viewer requires iframe.
7 changes: 7 additions & 0 deletions lib/matplotlib/tests/test_polar.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL