Deprecate Axes.axesPatch, Figure.figurePatch. #8150

Merged
merged 1 commit into from Feb 26, 2017
View
@@ -20,8 +20,8 @@
figcolor = 'white'
dpi = 80
fig = plt.figure(figsize=(6, 1.1), dpi=dpi)
-fig.figurePatch.set_edgecolor(figcolor)
-fig.figurePatch.set_facecolor(figcolor)
+fig.patch.set_edgecolor(figcolor)
+fig.patch.set_facecolor(figcolor)
def add_math_background():
@@ -57,7 +57,7 @@ def add_matplotlib_text(ax):
def add_polar_bar():
ax = fig.add_axes([0.025, 0.075, 0.2, 0.85], projection='polar')
- ax.axesPatch.set_alpha(axalpha)
+ ax.patch.set_alpha(axalpha)
ax.set_axisbelow(True)
N = 7
arc = 2. * np.pi
@@ -42,7 +42,7 @@ def ax_update(self, ax):
ax.set_autoscale_on(False) # Otherwise, infinite loop
# Get the number of points from the number of pixels in the window
- dims = ax.axesPatch.get_window_extent().bounds
+ dims = ax.patch.get_window_extent().bounds
self.width = int(dims[2] + 0.5)
self.height = int(dims[2] + 0.5)
@@ -1080,11 +1080,10 @@ def cla(self):
_title.set_clip_box(None)
self._set_artist_props(_title)
- # the patch draws the background of the axes. we want this to
- # be below the other artists; the axesPatch name is
- # deprecated. We use the frame to draw the edges so we are
- # setting the edgecolor to None
- self.patch = self.axesPatch = self._gen_axes_patch()
+ # The patch draws the background of the axes. We want this to be below
+ # the other artists. We use the frame to draw the edges so we are
+ # setting the edgecolor to None.
+ self.patch = self._gen_axes_patch()
self.patch.set_figure(self.figure)
self.patch.set_facecolor(self._facecolor)
self.patch.set_edgecolor('None')
@@ -1107,6 +1106,10 @@ def cla(self):
self.patch.set_visible(patch_visible)
self.stale = True
+ @cbook.deprecated("2.1", alternative="Axes.patch")
+ def axesPatch(self):
+ return self.patch
+
def clear(self):
"""clear the axes"""
self.cla()
View
@@ -332,12 +332,9 @@ def __init__(self,
self.transFigure = BboxTransformTo(self.bbox)
- # the figurePatch name is deprecated
- self.patch = self.figurePatch = Rectangle(
+ self.patch = Rectangle(
xy=(0, 0), width=1, height=1,
- facecolor=facecolor, edgecolor=edgecolor,
- linewidth=linewidth)
-
+ facecolor=facecolor, edgecolor=edgecolor, linewidth=linewidth)
self._set_artist_props(self.patch)
self.patch.set_aa(False)
@@ -358,6 +355,10 @@ def __init__(self,
self.clf()
self._cachedRenderer = None
+ @cbook.deprecated("2.1", alternative="Figure.patch")
+ def figurePatch(self):
+ return self.patch
+
# TODO: I'd like to dynamically add the _repr_html_ method
# to the figure in the right context, but then IPython doesn't
# use it, for some reason.
@@ -118,7 +118,7 @@ def __init__(self, fig, rect=None, *args, **kwargs):
self.mouse_init()
self.set_top_view()
- self.axesPatch.set_linewidth(0)
+ self.patch.set_linewidth(0)
# Calculate the pseudo-data width and height
pseudo_bbox = self.transLimits.inverted().transform([(0, 0), (1, 1)])
self._pseudo_w, self._pseudo_h = pseudo_bbox[1] - pseudo_bbox[0]
@@ -245,7 +245,7 @@ def tunit_edges(self, vals=None, M=None):
def draw(self, renderer):
# draw the background patch
- self.axesPatch.draw(renderer)
+ self.patch.draw(renderer)
self._frameon = False
# first, set the aspect