Skip to content

Commit eab4a89

Browse files
committed
TST: do not use non-baseclass methods to get renderer in tests
There in now machinery for all of the public API that takes a renderer is input to get it from the current canvas on the root figure. Use that machinery instead.
1 parent a38f9bb commit eab4a89

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8223,10 +8223,9 @@ def color_boxes(fig, ax):
82238223
"""
82248224
fig.canvas.draw()
82258225

8226-
renderer = fig.canvas.get_renderer()
82278226
bbaxis = []
82288227
for nn, axx in enumerate([ax.xaxis, ax.yaxis]):
8229-
bb = axx.get_tightbbox(renderer)
8228+
bb = axx.get_tightbbox()
82308229
if bb:
82318230
axisr = mpatches.Rectangle(
82328231
(bb.x0, bb.y0), width=bb.width, height=bb.height,
@@ -8237,7 +8236,7 @@ def color_boxes(fig, ax):
82378236

82388237
bbspines = []
82398238
for nn, a in enumerate(['bottom', 'top', 'left', 'right']):
8240-
bb = ax.spines[a].get_window_extent(renderer)
8239+
bb = ax.spines[a].get_window_extent()
82418240
spiner = mpatches.Rectangle(
82428241
(bb.x0, bb.y0), width=bb.width, height=bb.height,
82438242
linewidth=0.7, edgecolor="green", facecolor="none", transform=None,
@@ -8253,7 +8252,7 @@ def color_boxes(fig, ax):
82538252
fig.add_artist(rect2)
82548253
bbax = bb
82558254

8256-
bb2 = ax.get_tightbbox(renderer)
8255+
bb2 = ax.get_tightbbox()
82578256
rect2 = mpatches.Rectangle(
82588257
(bb2.x0, bb2.y0), width=bb2.width, height=bb2.height,
82598258
linewidth=3, edgecolor="red", facecolor="none", transform=None,

0 commit comments

Comments
 (0)