@@ -56,9 +56,7 @@ def DEBUG_MSG(string, lvl=3, o=None):
56
56
57
57
58
58
def error_msg_wx (msg , parent = None ):
59
- """
60
- Signal an error condition -- in a GUI, popup a error dialog
61
- """
59
+ """Signal an error condition with a popup error dialog."""
62
60
dialog = wx .MessageDialog (parent = parent ,
63
61
message = msg ,
64
62
caption = 'Matplotlib backend_wx error' ,
@@ -240,7 +238,6 @@ def draw_image(self, gc, x, y, im):
240
238
h = self .height
241
239
rows , cols = im .shape [:2 ]
242
240
bitmap = wx .Bitmap .FromBufferRGBA (cols , rows , im .tostring ())
243
- gc = self .get_gc ()
244
241
gc .select ()
245
242
gc .gfx_ctx .DrawBitmap (bitmap , int (l ), int (self .height - b ),
246
243
int (w ), int (- h ))
@@ -282,6 +279,7 @@ def new_gc(self):
282
279
self .gc .unselect ()
283
280
return self .gc
284
281
282
+ @cbook .deprecated ("3.3" , alternative = ".gc" )
285
283
def get_gc (self ):
286
284
"""
287
285
Fetch the locally cached gc.
@@ -417,7 +415,7 @@ def set_joinstyle(self, js):
417
415
self .unselect ()
418
416
419
417
def get_wxcolour (self , color ):
420
- """Convert the given RGB(A) color to a wx.Colour."""
418
+ """Convert a RGB(A) color to a wx.Colour."""
421
419
_log .debug ("%s - get_wx_color()" , type (self ))
422
420
if len (color ) == 3 :
423
421
r , g , b = color
@@ -914,14 +912,6 @@ def _print_image(self, filename, filetype, *args, **kwargs):
914
912
self .Refresh ()
915
913
916
914
917
- ########################################################################
918
- #
919
- # The following functions and classes are for pylab compatibility
920
- # mode (matplotlib.pylab) and implement figure managers, etc...
921
- #
922
- ########################################################################
923
-
924
-
925
915
class FigureFrameWx (wx .Frame ):
926
916
def __init__ (self , num , fig ):
927
917
# On non-Windows platform, explicitly set the position - fix
@@ -1047,7 +1037,6 @@ class FigureManagerWx(FigureManagerBase):
1047
1037
a FigureCanvasWx(wx.Panel) instance
1048
1038
window : wxFrame
1049
1039
a wxFrame instance - wxpython.org/Phoenix/docs/html/Frame.html
1050
-
1051
1040
"""
1052
1041
1053
1042
def __init__ (self , canvas , num , frame ):
@@ -1060,26 +1049,30 @@ def __init__(self, canvas, num, frame):
1060
1049
self .toolbar = frame .GetToolBar ()
1061
1050
1062
1051
def show (self ):
1052
+ # docstring inherited
1063
1053
self .frame .Show ()
1064
1054
self .canvas .draw ()
1065
1055
if mpl .rcParams ['figure.raise_window' ]:
1066
1056
self .frame .Raise ()
1067
1057
1068
1058
def destroy (self , * args ):
1059
+ # docstring inherited
1069
1060
_log .debug ("%s - destroy()" , type (self ))
1070
1061
self .frame .Close ()
1071
1062
wxapp = wx .GetApp ()
1072
1063
if wxapp :
1073
1064
wxapp .Yield ()
1074
1065
1075
1066
def get_window_title (self ):
1067
+ # docstring inherited
1076
1068
return self .window .GetTitle ()
1077
1069
1078
1070
def set_window_title (self , title ):
1071
+ # docstring inherited
1079
1072
self .window .SetTitle (title )
1080
1073
1081
1074
def resize (self , width , height ):
1082
- """Set the canvas size in pixels."""
1075
+ # docstring inherited
1083
1076
self .canvas .SetInitialSize (wx .Size (width , height ))
1084
1077
self .window .GetSizer ().Fit (self .window )
1085
1078
0 commit comments