8000 Backport PR #25518: DOC: Fix the bars having numeric value of cm but … · matplotlib/matplotlib@6015dce · GitHub
[go: up one dir, main page]

Skip to content

Commit 6015dce

Browse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #25518: DOC: Fix the bars having numeric value of cm but labeled as inches
1 parent 6949898 commit 6015dce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/units/bar_unit_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
tea_std = [2*cm, 1*cm, 1*cm, 4*cm, 2*cm]
2323

2424
fig, ax = plt.subplots()
25+
ax.yaxis.set_units(inch)
2526

2627
ind = np.arange(N) # the x locations for the groups
2728
width = 0.35 # the width of the bars
@@ -36,7 +37,6 @@
3637
ax.set_xticks(ind + width / 2, labels=['G1', 'G2', 'G3', 'G4', 'G5'])
3738

3839
ax.legend()
39-
ax.yaxis.set_units(inch)
4040
ax.autoscale_view()
4141

4242
plt.show()

0 commit comments

Comments
 (0)
0