Skip to content

Commit 20b6309

Browse files
committed
DOC: Minor typos, https, and pep8
1 parent c3a6534 commit 20b6309

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

examples/event_handling/poly_editor.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
===========
55
66
This is an example to show how to build cross-GUI applications using
7-
matplotlib event handling to interact with objects on the canvas.
7+
Matplotlib event handling to interact with objects on the canvas.
88
"""
99
import numpy as np
1010
from matplotlib.lines import Line2D
@@ -33,17 +33,19 @@ class PolygonInteractor(object):
3333

3434
def __init__(self, ax, poly):
3535
if poly.figure is None:
36-
raise RuntimeError('You must first add the polygon to a figure or canvas before defining the interactor')
36+
raise RuntimeError('You must first add the polygon to a figure '
37+
'or canvas before defining the interactor')
3738
self.ax = ax
3839
canvas = poly.figure.canvas
3940
self.poly = poly
4041

4142
x, y = zip(*self.poly.xy)
42-
self.line = Line2D(x, y, marker='o', markerfacecolor='r', animated=True)
43+
self.line = Line2D(x, y,
44+
marker='o', markerfacecolor='r',
45+
animated=True)
4346
self.ax.add_line(self.line)
44-
#self._update_line(poly)
4547

46-
cid = self.poly.add_callback(self.poly_changed)
48+
self.cid = self.poly.add_callback(self.poly_changed)
4749
self._ind = None # the active vert
4850

4951
canvas.mpl_connect('draw_event', self.draw_callback)
@@ -112,7 +114,9 @@ def key_press_callback(self, event):
112114
elif event.key == 'd':
113115
ind = self.get_ind_under_point(event)
114116
if ind is not None:
115-
self.poly.xy = [tup for i, tup in enumerate(self.poly.xy) if i != ind]
117+
self.poly.xy = [tup
118+
for i, tup in enumerate(self.poly.xy)
119+
if i != ind]
116120
self.line.set_data(zip(*self.poly.xy))
117121
elif event.key == 'i':
118122
xys = self.poly.get_transform().transform(self.poly.xy)
@@ -172,7 +176,6 @@ def motion_notify_callback(self, event):
172176
ax.add_patch(poly)
173177
p = PolygonInteractor(ax, poly)
174178

175-
#ax.add_line(p.line)
176179
ax.set_title('Click and drag a point to move it')
177180
ax.set_xlim((-2, 2))
178181
ax.set_ylim((-2, 2))

examples/mplot3d/mixed_subplots.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
============================================
3-
Demonstrate the mixing of 2D and 3D subplots
4-
============================================
2+
=================================
3+
2D and 3D *Axes* in same *Figure*
4+
=================================
55
66
This example shows a how to plot a 2D and 3D plot on the same figure.
77
"""

examples/pylab_examples/bar_stacked.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
1111
"""
1212

13-
# a stacked bar plot with errorbars
1413
import numpy as np
1514
import matplotlib.pyplot as plt
1615

examples/pylab_examples/geo_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
======================
55
66
This shows 4 possible projections using subplot. Matplotlib also
7-
supports `Basemaps Toolkit <http://matplotlib.org/basemap>`_ and
7+
supports `Basemaps Toolkit <https://matplotlib.org/basemap>`_ and
88
`Cartopy <http://scitools.org.uk/cartopy>`_ for geographic projections.
99
1010
"""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy