@@ -64,9 +64,9 @@ def debug_on_error(type, value, tb):
64
64
65
65
class fake_stderr :
66
66
67
- """Wx does strange things with stderr, as it makes the assumption that there
68
- is probably no console. This redirects stderr to the console, since we know
69
- that there is one!"""
67
+ """Wx does strange things with stderr, as it makes the assumption that
68
+ there is probably no console. This redirects stderr to the console, since
69
+ we know that there is one!"""
70
70
71
71
def write (self , msg ):
72
72
print ("Stderr: %s\n \r " % msg )
@@ -86,7 +86,8 @@ def write(self, msg):
86
86
87
87
from matplotlib ._pylab_helpers import Gcf
88
88
from matplotlib .artist import Artist
89
- from matplotlib .cbook import exception_to_str , is_string_like , is_writable_file_like
89
+ from matplotlib .cbook import exception_to_str , is_string_like , \
90
+ is_writable_file_like
90
91
from matplotlib .figure import Figure
91
92
from matplotlib .path import Path
92
93
from matplotlib .text import _process_text_args , Text
@@ -199,7 +200,8 @@ def __init__(self, bitmap, dpi):
199
200
DEBUG_MSG ("__init__()" , 1 , self )
200
201
if wx .VERSION_STRING < "2.8" :
201
202
raise RuntimeError (
202
- "matplotlib no longer supports wxPython < 2.8 for the Wx backends." )
203
+ "matplotlib no longer supports wxPython < 2.8 for"
204
+ "the Wx backends." )
203
205
self .width = bitmap .GetWidth ()
204
206
self .height = bitmap .GetHeight ()
205
207
self .bitmap = bitmap
@@ -275,8 +277,8 @@ def draw_path(self, gc, path, transform, rgbFace=None):
275
277
gc .select ()
276
278
self .handle_clip_rectangle (gc )
277
279
gfx_ctx = gc .gfx_ctx
278
- transform = transform + Affine2D (). scale ( 1.0 , - 1.0 ). translate ( 0.0 ,
279
- self .height )
280
+ transform = transform + \
281
+ Affine2D (). scale ( 1.0 , - 1.0 ). translate ( 0.0 , self .height )
280
282
wxpath = self .convert_path (gfx_ctx , path , transform )
281
283
if rgbFace is not None :
282
284
gfx_ctx .SetBrush (wx .Brush (gc .get_wxcolour (rgbFace )))
@@ -578,9 +580,9 @@ class FigureCanvasWx(FigureCanvasBase, wx.Panel):
578
580
The FigureCanvas contains the figure and does event handling.
579
581
580
582
In the wxPython backend, it is derived from wxPanel, and (usually) lives
581
- inside a frame instantiated by a FigureManagerWx. The parent window probably
582
- implements a wx.Sizer to control the displayed control size - but we give a
583
- hint as to our preferred minimum size.
583
+ inside a frame instantiated by a FigureManagerWx. The parent window
584
+ probably implements a wx.Sizer to control the displayed control size - but
585
+ we give a hint as to our preferred minimum size.
584
586
"""
585
587
586
588
keyvald = {
@@ -663,7 +665,9 @@ def __init__(self, parent, id, figure):
663
665
664
666
def do_nothing (* args , ** kwargs ):
665
667
warnings .warn (
666
- 'could not find a setinitialsize function for backend_wx; please report your wxpython version=%s to the matplotlib developers list' %
668
+ "could not find a setinitialsize function for backend_wx; "
669
+ "please report your wxpython version=%s "
670
+ "to the matplotlib developers list" %
667
671
backend_version )
668
672
pass
669
673
@@ -776,9 +780,10 @@ def draw(self, drawDC=None):
776
780
777
781
def new_timer (self , * args , ** kwargs ):
778
782
"""
779
- Creates a new backend-specific subclass of :class:`backend_bases.Timer`.
780
- This is useful for getting periodic events through the backend's native
781
- event loop. Implemented only for backends with GUIs.
783
+ Creates a new backend-specific subclass of
784
+ :class:`backend_bases.Timer`. This is useful for getting periodic
785
+ events through the backend's native event loop. Implemented only
786
+ for backends with GUIs.
782
787
783
788
optional arguments:
784
789
@@ -939,9 +944,10 @@ def _print_image(self, filename, filetype, *args, **kwargs):
939
944
940
945
# image is the object that we call SaveFile on.
941
946
image = self .bitmap
942
- # set the JPEG quality appropriately. Unfortunately, it is only possible
943
- # to set the quality on a wx.Image object. So if we are saving a JPEG,
944
- # convert the wx.Bitmap to a wx.Image, and set the quality.
947
+ # set the JPEG quality appropriately. Unfortunately, it is only
948
+ # possible to set the quality on a wx.Image object. So if we
949
+ # are saving a JPEG, convert the wx.Bitmap to a wx.Image,
950
+ # and set the quality.
945
951
if filetype == wx .BITMAP_TYPE_JPEG :
946
952
jpeg_quality = kwargs .get (
947
953
'quality' ,
@@ -1708,7 +1714,8 @@ def save_figure(self, *args):
1708
1714
# looks like they forgot to set the image type drop
1709
1715
# down, going with the extension.
1710
1716
warnings .warn (
1711
- 'extension %s did not match the selected image type %s; going with %s' %
1717
+ 'extension %s did not match the selected '
1718
+ 'image type %s; going with %s' %
1712
1719
(ext , format , ext ), stacklevel = 0 )
1713
1720
format = ext
1714
1721
try :
@@ -1735,7 +1742,8 @@ def dynamic_update(self):
1735
1742
self ._idle = True
1736
1743
1737
1744
def draw_rubberband (self , event , x0 , y0 , x1 , y1 ):
1738
- 'adapted from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189744'
1745
+ """adapted from
1746
+ http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189744"""
1739
1747
canvas = self .canvas
1740
1748
dc = wx .ClientDC (canvas )
1741
1749
0 commit comments