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

Skip to content

Commit a3a652f

Browse files
UmarJQuLogic
authored andcommitted
Fix bar3d bug with matching color string and array x lengths
1 parent 8b9f61d commit a3a652f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2507,13 +2507,15 @@ def bar3d(self, x, y, z, dx, dy, dz, color=None,
25072507
if color is None:
25082508
color = [self._get_patches_for_fill.get_next_color()]
25092509

2510+
color = list(mcolors.to_rgba_array(color))
2511+
25102512
if len(color) == len(x):
25112513
# bar colors specified, need to expand to number of faces
25122514
for c in color:
25132515
facecolors.extend([c] * 6)
25142516
else:
25152517
# a single color specified, or face colors specified explicitly
2516-
facecolors = list(mcolors.to_rgba_array(color))
2518+
facecolors = color
25172519
if len(facecolors) < len(x):
25182520
facecolors *= (6 * len(x))
25192521

0 commit comments

Comments
 (0)