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

Skip to content

Commit de80a64

Browse files
committed
TST: test that moving title works w/o xlabel
1 parent b47071b commit de80a64

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5389,6 +5389,16 @@ def test_titlesetpos():
53895389
assert ax.title.get_position() == pos
53905390

53915391

5392+
def test_title_xticks_top():
5393+
# Test that title stays put if we set it manually
5394+
5395+
fig, ax = plt.subplots()
5396+
ax.xaxis.set_ticks_position('top')
5397+
ax.set_title('xlabel top') # increase padding to make room for labels
5398+
fig.canvas.draw()
5399+
assert ax.title.get_position()[1] > 1.04
5400+
5401+
53925402
def test_offset_label_color():
53935403
# Tests issue 6440
53945404
fig = plt.figure()

0 commit comments

Comments
 (0)