21
21
from matplotlib .backend_bases import _has_pil
22
22
23
23
from matplotlib ._pylab_helpers import Gcf
24
- from matplotlib .cbook import is_writable_file_like , warn_deprecated
25
24
from matplotlib .figure import Figure
26
25
from matplotlib .path import Path
27
26
from matplotlib .transforms import Affine2D
@@ -196,15 +195,11 @@ class RendererWx(RendererBase):
196
195
}
197
196
198
197
def __init__ (self , bitmap , dpi ):
199
- """
200
- Initialise a wxWindows renderer instance.
201
- """
202
- warn_deprecated ('2.0' , message = "The WX backend is "
203
- "deprecated. It's untested "
204
- "and will be removed in Matplotlib 3.0. "
205
- "Use the WXAgg backend instead. "
206
- "See Matplotlib usage FAQ for more info on backends." ,
207
- alternative = 'WXAgg' )
198
+ """Initialise a wxWindows renderer instance."""
199
+ cbook .warn_deprecated (
200
+ "2.0" , name = "wx" , obj_type = "backend" , removal = "the future" ,
201
+ alternative = "wxagg" , addendum = "See the Matplotlib usage FAQ for "
202
+ "more info on backends." )
208
203
RendererBase .__init__ (self )
209
204
DEBUG_MSG ("__init__()" , 1 , self )
210
205
self .width = bitmap .GetWidth ()
@@ -225,9 +220,8 @@ def get_text_width_height_descent(self, s, prop, ismath):
225
220
get the width and height in display coords of the string s
226
221
with FontPropertry prop
227
222
"""
228
- # return 1, 1
229
223
if ismath :
230
- s = self .strip_math (s )
224
+ s = cbook .strip_math (s )
231
225
232
226
if self .gc is None :
233
227
gc = self .new_gc ()
@@ -307,7 +301,7 @@ def draw_image(self, gc, x, y, im):
307
301
308
302
def draw_text (self , gc , x , y , s , prop , angle , ismath = False , mtext = None ):
309
303
if ismath :
310
- s = self .strip_math (s )
304
+ s = cbook .strip_math (s )
311
305
DEBUG_MSG ("draw_text()" , 1 , self )
312
306
gc .select ()
313
307
self .handle_clip_rectangle (gc )
@@ -1107,7 +1101,7 @@ def _print_image(self, filename, filetype, *args, **kwargs):
1107
1101
raise RuntimeError (
1108
1102
'Could not save figure to %s\n ' %
1109
1103
(filename ))
1110
- elif is_writable_file_like (filename ):
1104
+ elif cbook . is_writable_file_like (filename ):
1111
1105
if not isinstance (image , wx .Image ):
1112
1106
image = image .ConvertToImage ()
1113
1107
if not image .SaveStream (filename , filetype ):
0 commit comments