Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b527911

Browse files
committed
BUG: Fix face orientations of bar3d
Fixes #12138, which is caused by these incorrect orientations
1 parent b3c9f05 commit b527911

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,13 +2433,15 @@ def bar3d(self, x, y, z, dx, dy, dz, color=None,
24332433
maxz = np.max(z + dz)
24342434

24352435
# shape (6, 4, 3)
2436+
# All faces are oriented facing outwards - when viewed from the
2437+
# outside, their vertices are in a counterclockwise ordering.
24362438
cuboid = np.array([
24372439
# -z
24382440
(
24392441
(0, 0, 0),
2440-
(1, 0, 0),
2441-
(1, 1, 0),
24422442
(0, 1, 0),
2443+
(1, 1, 0),
2444+
(1, 0, 0),
24432445
),
24442446
# +z
24452447
(
@@ -2458,16 +2460,16 @@ def bar3d(self, x, y, z, dx, dy, dz, color=None,
24582460
# +y
24592461
(
24602462
(0, 1, 0),
2461-
(1, 1, 0),
2462-
(1, 1, 1),
24632463
(0, 1, 1),
2464+
(1, 1, 1),
2465+
(1, 1, 0),
24642466
),
24652467
# -x
24662468
(
24672469
(0, 0, 0),
2468-
(0, 1, 0),
2469-
(0, 1, 1),
24702470
(0, 0, 1),
2471+
(0, 1, 1),
2472+
(0, 1, 0),
24712473
),
24722474
# +x
24732475
(

0 commit comments

Comments
 (0)