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

Appearance settings

Commit a64db70

Browse filesBrowse files
added test for nan values with yaxis inverted
1 parent fae56a0 commit a64db70
Copy full SHA for a64db70

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7464,6 +7464,16 @@ def test_bar_label_nan_ydata():
74647464
assert labels[0].get_va() == 'bottom'
74657465

74667466

7467+
def test_bar_label_nan_ydata_inverted():
7468+
ax = plt.gca()
7469+
ax.yaxis_inverted()
7470+
bars = ax.bar([2, 3], [np.nan, 1])
7471+
labels = ax.bar_label(bars)
7472+
assert [l.get_text() for l in labels] == ['', '1']
7473+
assert labels[0].xy == (2, 0)
7474+
assert labels[0].get_va() == 'bottom'
7475+
7476+
74677477
def test_patch_bounds(): # PR 19078
74687478
fig, ax = plt.subplots()
74697479
ax.add_patch(mpatches.Wedge((0, -1), 1.05, 60, 120, 0.1))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.