Skip to content

Commit 88ed2c8

Browse files
committed
DOC: Fix the bars having numeric value of cm but labeled as inches
This is admittedly more of a band-aid than a proper fix, but at least make the generated figure correct. The underlying problem is the more fundemental one of inconsistent units behavior in which some artists can be re-united after plotting (e.g. Line2D), while many others (e.g. Collections) cannot. Thus, until that is addressed (which is one of the goals of the data-prototype work), simply setting units early is as good as we can do. Closes #5051
1 parent 0b4e615 commit 88ed2c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

galleries/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)