Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d09535 commit f44b437Copy full SHA for f44b437
lib/mpl_toolkits/mplot3d/axes3d.py
@@ -2478,11 +2478,17 @@ def bar3d(self, x, y, z, dx, dy, dz, color=None,
2478
),
2479
])
2480
2481
- polys = []
2482
- for xi, yi, zi, dxi, dyi, dzi in zip(x, y, z, dx, dy, dz):
2483
- corner = np.array([xi, yi, zi])
2484
- scale = np.array([dxi, dyi, dzi])
2485
- polys.extend(corner + scale * cuboid)
+ # indexed by [bar, face, vertex, coord]
+ polys = np.empty(x.shape + cuboid.shape)
+
+ # handle each coordinate separately
+ for i, p, dp in [(0, x, dx), (1, y, dy), (2, z, dz)]:
2486
+ p = p[..., np.newaxis, np.newaxis]
2487
+ dp = dp[..., np.newaxis, np.newaxis]
2488
+ polys[..., i] = p + dp * cuboid[..., i]
2489
2490
+ # collapse the first two axes
2491
+ polys = polys.reshape((-1,) + polys.shape[2:])
2492
2493
facecolors = []
2494
if color is None:
0 commit comments