X Tutup
Skip to content

Commit fe5ca06

Browse files
rcomermeeseeksmachine
authored andcommitted
Backport PR #30969: DOC: Simplify barh() example
1 parent 3c78c27 commit fe5ca06

File tree

1 file changed

+1
-3
lines changed
  • galleries/examples/lines_bars_and_markers

1 file changed

+1
-3
lines changed

galleries/examples/lines_bars_and_markers/barh.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515

1616
# Example data
1717
people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim')
18-
y_pos = np.arange(len(people))
1918
performance = 3 + 10 * np.random.rand(len(people))
2019
error = np.random.rand(len(people))
2120

22-
ax.barh(y_pos, performance, xerr=error, align='center')
23-
ax.set_yticks(y_pos, labels=people)
21+
ax.barh(people, performance, xerr=error, align='center')
2422
ax.invert_yaxis() # labels read top-to-bottom
2523
ax.set_xlabel('Performance')
2624
ax.set_title('How fast do you want to go today?')

0 commit comments

Comments
 (0)
X Tutup