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

Skip to content

Commit d4f808d

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

16 files changed

Lines changed: 294 additions & 378 deletions

CHANGELOG

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
New entries should be added at the top
22

3+
2005-07-26 Added new widgets Cursor and HorizontalSpanSelector to
4+
matplotlib.widgets. See examples/widgets/cursor.py and
5+
examples/widgets/span_selector.py - JDH
6+
7+
2005-07-26 added draw event to mpl event hierarchy -- triggered on
8+
figure.draw
9+
310
2005-07-26 backend_gtk.py: allow 'f' key to toggle window fullscreen mode
411

512
2005-07-26 backend_svg.py: write "<.../>" elements all on one line and remove
@@ -22,7 +29,7 @@ New entries should be added at the top
2229
clear() to draw_drawable() - SC
2330

2431
2005-07-23 backend_gtk.py: removed pygtk.require()
25-
matplotlib/__init__.py: delete 'FROZEN' and 'MPLError' which are
32+
matplotlib/__init__.py: delete 'FROZEN' and 'McPLError' which are
2633
no longer used - SC
2734

2835
2005-07-22 backend_gdk.py: removed pygtk.require() - SC

examples/errorbar_demo.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
figure(1)
1212
#errorbar(t, s, e, fmt='o') # vertical symmetric
1313
#errorbar(t, s, None, f, fmt='o') # horizontal symmetric
14-
#errorbar(t, s, e, f, fmt='o') # both symmetric
15-
errorbar(t, s, [e,g], [f,h], fmt='--o') # both asymmetric
14+
errorbar(t, s, e, f, fmt='o') # both symmetric
15+
#errorbar(t, s, [e,g], [f,h], fmt='--o') # both asymmetric
1616
#errorbar(t, s, [e,g], f, fmt='o', ecolor='g') # both mixed
1717
#errorbar(t, s, e, [f,h], fmt='o') # both mixed
1818
#errorbar(t, s, [e,g], fmt='o') # vertical asymmetric
@@ -22,6 +22,10 @@
2222
ylabel('Height (m)')
2323
title('Mean and standard error as a function of distance')
2424

25+
figure(2)
26+
ax = subplot(111)
27+
ax.set_yscale('log')
28+
errorbar(t, s+2, e, f, fmt='o') # both symmetric
2529

2630
#savefig('errorbar_demo')
2731
show()

examples/widgets/cursor.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from matplotlib.widgets import Cursor
2+
import pylab
3+
4+
5+
6+
fig = pylab.figure(figsize=(8,6))
7+
ax = fig.add_axes([0.075, 0.25, 0.9, 0.725], axisbg='#FFFFCC')
8+
#ax = fig.add_subplot(111, axisbg='#FFFFCC')
9+
canvas = ax.figure.canvas
10+
11+
x,y = 4*(pylab.rand(2,100)-.5)
12+
ax.plot(x,y,'o')
13+
ax.set_xlim(-2,2)
14+
ax.set_ylim(-2,2)
15+
16+
# set useblit = True on gtkagg for enhanced performance
17+
cursor = Cursor(ax, useblit=False, color='red', linewidth=2 )
18+
19+
pylab.show()

examples/widgets/span_selector.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pylab
2+
from matplotlib.widgets import HorizontalSpanSelector
3+
4+
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
8+
9+
x,y = 4*(pylab.rand(2,100)-.5)
10+
ax.plot(x,y,'o')
11+
ax.set_xlim(-2,2)
12+
ax.set_ylim(-2,2)
13+
title('Press left mouse button and drag to test')
14+
15+
16+
def onselect(xmin, xmax):
17+
print xmin, xmax
18+
19+
# set useblit True on gtkagg for enhanced performance
20+
span = HorizontalSpanSelector(ax, onselect, useblit=False,
21+
rectprops=dict(alpha=0.5, facecolor='red') )
22+
23+
pylab.show()

fonts/BaKoMa-CM.Fonts

Lines changed: 0 additions & 310 deletions
This file was deleted.

0 commit comments

Comments
 (0)