Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitceec49f

Browse files
committed
PEP8
1 parentc96629f commitceec49f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

‎lib/matplotlib/_pylab_helpers.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
frommatplotlibimportis_interactive
1313

14+
1415
deferror_msg(msg):
1516
print(msg,file=sys.stderr)
1617

@@ -39,7 +40,7 @@ class Gcf(object):
3940
@classmethod
4041
defadd_figure_manager(cls,manager):
4142
cls.figs[manager.num]=manager
42-
try:# TODO remove once all backends converted to use the new manager.
43+
try:# TODO remove once all backends converted to use the new manager.
4344
manager.mpl_connect('window_destroy_event',cls.destroy_cbk)
4445
except:
4546
pass

‎lib/matplotlib/backend_managers.py‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010

1111
fromsysimportgetrefcountasgrc
1212

13+
1314
classFigureManagerEvent(object):
1415
def__init__(self,s,fm):
1516
self.name=s
1617
self.figure_manager=fm
1718

19+
1820
classFigureManager(cbook.EventEmitter):
1921
def__init__(self,canvas,num):
2022
cbook.EventEmitter.__init__(self)
@@ -36,16 +38,18 @@ def __init__(self, canvas, num):
3638

3739
self.toolbar=self._get_toolbar(canvas)
3840
ifself.toolbarisnotNone:
39-
h+=self.window.add_element_to_window(self.toolbar,False,False,0)
41+
h+=self.window.add_element_to_window(self.toolbar,
42+
False,False,0)
4043

41-
self.window.set_default_size(w,h)
44+
self.window.set_default_size(w,h)
4245

4346
ifis_interactive():
4447
self.window.show()
4548

4649
defnotify_axes_change(fig):
4750
'this will be called whenever the current axes is changed'
48-
ifself.toolbarisnotNone:self.toolbar.update()
51+
ifself.toolbarisnotNone:
52+
self.toolbar.update()
4953
self.canvas.figure.add_axobserver(notify_axes_change)
5054

5155
self.canvas.grab_focus()
@@ -68,7 +72,7 @@ def destroy(self, *args):
6872
self.canvas.destroy()
6973
ifself.toolbar:
7074
self.toolbar.destroy()
71-
75+
7276
self.mainloop.__del__()
7377

7478
defshow(self):
@@ -79,7 +83,7 @@ def full_screen_toggle(self):
7983
self.window.set_fullscreen(self._full_screen_flag)
8084

8185
defresize(self,w,h):
82-
self.window.resize(w,h)
86+
self.window.resize(w,h)
8387

8488
defget_window_title(self):
8589
"""
@@ -110,6 +114,7 @@ def _get_toolbar(self, canvas):
110114
toolbar=None
111115
returntoolbar
112116

117+
113118
defnew_figure_manager(num,*args,**kwargs):
114119
"""
115120
Create a new figure manager instance
@@ -119,7 +124,7 @@ def new_figure_manager(num, *args, **kwargs):
119124
FigureClass=kwargs.pop('FigureClass',Figure)
120125
thisFig=FigureClass(*args,**kwargs)
121126
manager=new_figure_manager_given_figure(num,thisFig)
122-
else:# TODO remove once Gcf removed from backends.
127+
else:# TODO remove once Gcf removed from backends.
123128
manager=old_new_figure_manager(num,*args,**kwargs)
124129
manager.mainloop=show
125130
returnmanager

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp