8000 DOC: restore yticklabels and invert y-axis on barh · matplotlib/matplotlib@9e7f838 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e7f838

Browse files
committed
DOC: restore yticklabels and invert y-axis on barh
1 parent 3cad4dc commit 9e7f838

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/lines_bars_and_markers/barh_demo.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616

1717
ax.barh(y_pos, performance, xerr=error, align='center',
1818
color='green', ecolor='black')
19-
ax.set_yticks(y_pos, people)
19+
ax.set_yticks(y_pos)
20+
ax.set_yticklabels(people)
21+
ax.invert_yaxis() # labels read top-to-bottom
2022
ax.set_xlabel('Performance')
2123
ax.set_title('How fast do you want to go today?')
2224

23-
plt.show()
25+
plt.show()

0 commit comments

Comments
 (0)
0