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

Skip to content

Commit 5ffb34e

Browse files
committed
Add image comparison test.
1 parent bb7fd69 commit 5ffb34e

File tree

2 files changed

+176
-0
lines changed

2 files changed

+176
-0
lines changed
Lines changed: 166 additions & 0 deletions
Loading

lib/matplotlib/tests/test_axes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7749,6 +7749,16 @@ def test_bar_label_location_center():
77497749
assert labels[1].get_va() == 'center'
77507750

77517751

7752+
@image_comparison(['test_centered_bar_label_nonlinear.svg'])
7753+
def test_centered_bar_label_nonlinear():
7754+
_, ax = plt.subplots()
7755+
bar_container = ax.barh(['c', 'b', 'a'], [1_000, 5_000, 7_000])
7756+
ax.set_xscale('log')
7757+
ax.set_xlim(1, None)
7758+
ax.bar_label(bar_container, label_type='center')
7759+
ax.set_axis_off()
7760+
7761+
77527762
def test_bar_label_location_errorbars():
77537763
ax = plt.gca()
77547764
xs, heights = [1, 2], [3, -4]

0 commit comments

Comments
 (0)