Skip to content

Commit e0953ac

Browse files
committed
added some new widgets
svn path=/trunk/matplotlib/; revision=1566
1 parent d4f808d commit e0953ac

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

examples/widgets/cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
ax.set_ylim(-2,2)
1515

1616
# set useblit = True on gtkagg for enhanced performance
17-
cursor = Cursor(ax, useblit=False, color='red', linewidth=2 )
17+
cursor = Cursor(ax, useblit=True, color='red', linewidth=2 )
1818

1919
pylab.show()

examples/widgets/span_selector.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
"""
2+
The HorizontalSpanSelector is a mouse widget to select a xmin/xmax
3+
range. When you left click drag in the axes, a rectangle shows the
4+
selected region. When you release, the rectangle disappears and a
5+
callback is called with min/max.
6+
"""
17
import pylab
28
from matplotlib.widgets import HorizontalSpanSelector
39

410
fig = pylab.figure(figsize=(8,6))
5-
ax = fig.add_axes([0.075, 0.25, 0.9, 0.725], axisbg='#FFFFCC')
6-
#ax = fig.add_subplot(111, axisbg='#FFFFCC')
7-
canvas = ax.figure.canvas
11+
ax = fig.add_subplot(111, axisbg='#FFFFCC')
812

913
x,y = 4*(pylab.rand(2,100)-.5)
1014
ax.plot(x,y,'o')
1115
ax.set_xlim(-2,2)
1216
ax.set_ylim(-2,2)
13-
title('Press left mouse button and drag to test')
17+
ax.set_title('Press left mouse button and drag to test')
1418

1519

1620
def onselect(xmin, xmax):

0 commit comments

Comments
 (0)