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

Skip to content

Commit 18fafb0

Browse files
committed
modified test_title_location_roundtrip to test default location using rcparams
1 parent 1c1fe64 commit 18fafb0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/matplotlib/tests/test_axes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5301,13 +5301,16 @@ def test_title_pad():
53015301

53025302
def test_title_location_roundtrip():
53035303
fig, ax = plt.subplots()
5304+
# set default title location
5305+
plt.rcParams['axes.titlelocation'] = 'center'
5306+
53045307
ax.set_title('aardvark')
53055308
ax.set_title('left', loc='left')
53065309
ax.set_title('right', loc='right')
53075310

53085311
assert 'left' == ax.get_title(loc='left')
53095312
assert 'right' == ax.get_title(loc='right')
5310-
assert 'aardvark' == ax.get_title()
5313+
assert 'aardvark' == ax.get_title(loc='center')
53115314

53125315
with pytest.raises(ValueError):
53135316
ax.get_title(loc='foo')

0 commit comments

Comments
 (0)