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

Skip to content

Commit f2715a1

Browse files
committed
Allow any color to be used for set_pane_color
1 parent 769c50d commit f2715a1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/mpl_toolkits/mplot3d/axis3d.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from matplotlib import (
1010
_api, artist, lines as mlines, axis as maxis, patches as mpatches,
11-
transforms as mtransforms, rcParams)
11+
transforms as mtransforms, rcParams, colors as mcolors)
1212
from . import art3d, proj3d
1313

1414

@@ -191,8 +191,18 @@ def _set_pane_pos(self, xys):
191191
self.pane.xy = xys
192192
self.stale = True
193193

194-
def set_pane_color(self, color):
195-
"""Set pane color to a RGBA tuple."""
194+
def set_pane_color(self, color, alpha=None):
195+
"""
196+
Set pane color.
197+
198+
Parameters
199+
----------
200+
color : color
201+
Color for axis pane.
202+
alpha : float, optional
203+
Alpha value for axis pane. If None, base it on *color*.
204+
"""
205+
color = mcolors.to_rgba(color, alpha)
196206
self._axinfo['color'] = color
197207
self.pane.set_edgecolor(color)
198208
self.pane.set_facecolor(color)

0 commit comments

Comments
 (0)