Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f728fe

Browse files
authored
Merge pull request #10134 from anntzer/cleanup
Minor style cleanups.
2 parents 884060a + af78bbd commit 7f728fe

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

lib/matplotlib/backends/backend_gtk3cairo.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,21 @@ class FigureCanvasGTK3Cairo(backend_gtk3.FigureCanvasGTK3,
2525
backend_cairo.FigureCanvasCairo):
2626

2727
def _renderer_init(self):
28-
"""use cairo renderer"""
28+
"""Use cairo renderer."""
2929
self._renderer = RendererGTK3Cairo(self.figure.dpi)
3030

3131
def _render_figure(self, width, height):
3232
self._renderer.set_width_height(width, height)
3333
self.figure.draw(self._renderer)
3434

3535
def on_draw_event(self, widget, ctx):
36-
""" GtkDrawable draw event, like expose_event in GTK 2.X
37-
"""
36+
"""GtkDrawable draw event."""
3837
toolbar = self.toolbar
3938
if toolbar:
4039
toolbar.set_cursor(cursors.WAIT)
4140
self._renderer.set_context(ctx)
4241
allocation = self.get_allocation()
43-
x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height
44-
self._render_figure(w, h)
42+
self._render_figure(allocation.width, allocation.height)
4543
if toolbar:
4644
toolbar.set_cursor(toolbar._lastCursor)
4745
return False # finish event propagation?

lib/matplotlib/transforms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,7 @@ def __init__(self, bbox, x0=None, y0=None, x1=None, y1=None, **kwargs):
11191119
self._points = None
11201120
fp = [x0, y0, x1, y1]
11211121
mask = [val is None for val in fp]
1122-
self._locked_points = np.ma.array(fp, np.float_,
1123-
mask=mask).reshape((2, 2))
1122+
self._locked_points = np.ma.array(fp, float, mask=mask).reshape((2, 2))
11241123

11251124
def __str__(self):
11261125
return ("{}(\n"

pytest.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pep8ignore =
2828
matplotlib/backends/backend_gdk.py E202 E203 E211 E221 E225 E231 E261 E302 E303 E402 E501 E702 E711
2929
matplotlib/backends/backend_gtk.py E201 E202 E203 E211 E221 E222 E225 E231 E251 E261 E262 E301 E302 E303 E401 E402 E501 E701 E702 E703
3030
matplotlib/backends/backend_gtk3.py E201 E202 E203 E211 E221 E222 E225 E231 E251 E261 E262 E301 E302 E401 E402 E501 E701
31-
matplotlib/backends/backend_gtk3cairo.py E211 E302 E501
3231
matplotlib/backends/backend_gtkagg.py E211 E225 E231 E261 E302 E501 E701
3332
matplotlib/backends/backend_gtkcairo.py E211 E225 E231 E402 E701
3433
matplotlib/backends/backend_macosx.py E222 E225 E231 E261 E501 E701 E711

0 commit comments

Comments
 (0)