Skip to content

Commit

Permalink
Merge pull request matplotlib#25518 from ksunden/bar_demo_units
Browse files Browse the repository at this point in the history
DOC: Fix the bars having numeric value of cm but labeled as inches
  • Loading branch information
timhoffm authored Mar 23, 2023
2 parents 2f7f62e + 88ed2c8 commit c948e90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion galleries/examples/units/bar_unit_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
tea_std = [2*cm, 1*cm, 1*cm, 4*cm, 2*cm]

fig, ax = plt.subplots()
ax.yaxis.set_units(inch)

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

ax.legend()
ax.yaxis.set_units(inch)
ax.autoscale_view()

plt.show()

0 comments on commit c948e90

Please sign in to comment.