From 6015dcea4abe8b36892e0fd5b4dc47a3d18b39d7 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 23 Mar 2023 11:30:43 +0100 Subject: [PATCH] Backport PR #25518: DOC: Fix the bars having numeric value of cm but labeled as inches --- examples/units/bar_unit_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/units/bar_unit_demo.py b/examples/units/bar_unit_demo.py index b64784cc5c07..ae2fa5cd9bde 100644 --- a/examples/units/bar_unit_demo.py +++ b/examples/units/bar_unit_demo.py @@ -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 @@ -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()