Skip to content

Commit c555810

Browse files
author
Phil Elson
committed
Spurious import, tidied subplot call.
1 parent 74c55a6 commit c555810

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

examples/event_handling/lasso_demo.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77
usable as is). There will be some refinement of the API.
88
"""
99
from matplotlib.widgets import Lasso
10-
import matplotlib.mlab
1110
from matplotlib.path import Path
1211
from matplotlib.colors import colorConverter
1312
from matplotlib.collections import RegularPolyCollection
1413

15-
from matplotlib.pyplot import figure, show
14+
import matplotlib.pyplot as plt
1615
from numpy import nonzero
1716
from numpy.random import rand
1817

19-
class Datum:
18+
class Datum(object):
2019
colorin = colorConverter.to_rgba('red')
2120
colorout = colorConverter.to_rgba('blue')
2221
def __init__(self, x, y, include=False):
@@ -26,7 +25,7 @@ def __init__(self, x, y, include=False):
2625
else: self.color = self.colorout
2726

2827

29-
class LassoManager:
28+
class LassoManager(object):
3029
def __init__(self, ax, data):
3130
self.axes = ax
3231
self.canvas = ax.figure.canvas
@@ -71,8 +70,7 @@ def onpress(self, event):
7170

7271
data = [Datum(*xy) for xy in rand(100, 2)]
7372

74-
fig = figure()
75-
ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
73+
ax = plt.axes(xlim=(0,1), ylim=(0,1), autoscale_on=False)
7674
lman = LassoManager(ax, data)
7775

78-
show()
76+
plt.show()

0 commit comments

Comments
 (0)