2121from matplotlib .backend_bases import _has_pil
2222
2323from matplotlib ._pylab_helpers import Gcf
24- from matplotlib .cbook import is_writable_file_like , warn_deprecated
2524from matplotlib .figure import Figure
2625from matplotlib .path import Path
2726from matplotlib .transforms import Affine2D
@@ -196,15 +195,11 @@ class RendererWx(RendererBase):
196195 }
197196
198197 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." )
208203 RendererBase .__init__ (self )
209204 DEBUG_MSG ("__init__()" , 1 , self )
210205 self .width = bitmap .GetWidth ()
@@ -225,9 +220,8 @@ def get_text_width_height_descent(self, s, prop, ismath):
225220 get the width and height in display coords of the string s
226221 with FontPropertry prop
227222 """
228- # return 1, 1
229223 if ismath :
230- s = self .strip_math (s )
224+ s = cbook .strip_math (s )
231225
232226 if self .gc is None :
233227 gc = self .new_gc ()
@@ -307,7 +301,7 @@ def draw_image(self, gc, x, y, im):
307301
308302 def draw_text (self , gc , x , y , s , prop , angle , ismath = False , mtext = None ):
309303 if ismath :
310- s = self .strip_math (s )
304+ s = cbook .strip_math (s )
311305 DEBUG_MSG ("draw_text()" , 1 , self )
312306 gc .select ()
313307 self .handle_clip_rectangle (gc )
@@ -1107,7 +1101,7 @@ def _print_image(self, filename, filetype, *args, **kwargs):
11071101 raise RuntimeError (
11081102 'Could not save figure to %s\n ' %
11091103 (filename ))
1110- elif is_writable_file_like (filename ):
1104+ elif cbook . is_writable_file_like (filename ):
11111105 if not isinstance (image , wx .Image ):
11121106 image = image .ConvertToImage ()
11131107 if not image .SaveStream (filename , filetype ):
0 commit comments