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

Skip to content

Commit 9c2d9c3

Browse files
committed
image fix, line collection extension
svn path=/trunk/matplotlib/; revision=401
1 parent 66d51d1 commit 9c2d9c3

19 files changed

Lines changed: 268 additions & 117 deletions

.matplotlibrc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,25 @@
2727
backend : GTKAgg # the default backend
2828
numerix : Numeric # Numeric or numarray
2929
interactive : False # see http://matplotlib.sourceforge.net/interactive.html
30+
toolbar : classic # None | classic | toolbar2 (experimental)
3031

3132
### LINES
3233
# See http://matplotlib.sourceforge.net/matplotlib.lines.html for more
3334
# information on line properties. Note antialiased rendering looks
3435
# better, but can be slower. If you want fast antialiased rendering,
35-
# use the agg backend (or TkAgg, or GTKAgg)
36+
# use the Agg backend (or TkAgg, GTKAgg, WxAgg)
3637
lines.linewidth : 0.5 # line width in points
3738
lines.linestyle : - # solid line
38-
lines.color : b # blue; color format or hex string
39+
lines.color : b # blue
3940
lines.marker : None # the default marker
40-
lines.markerfacecolor : b
41-
lines.markeredgecolor : k
42-
lines.markeredgewidth : 0.5
43-
lines.markersize : 6 # markersize, in points
44-
lines.antialiased : True # render lines in antialised (no jaggies)
45-
lines.data_clipping : False # Use data clipping in addition to viewport
46-
# clipping. Useful if you plot long data
47-
# sets with only a fraction in the viewport
41+
lines.markerfacecolor : b # blue
42+
lines.markeredgecolor : k # black
43+
lines.markeredgewidth : 0.5 # the line width around the marker symbol
44+
lines.markersize : 6 # markersize, in points
45+
lines.antialiased : True # render lines in antialised (no jaggies)
46+
lines.data_clipping : False # Use data clipping in addition to viewport
47+
# clipping. Useful if you plot long data
48+
# sets with only a fraction in the viewport
4849

4950
### Patches
5051
# Patches are graphical objects that fill 2D space, like polygons or
@@ -127,8 +128,8 @@ axes.labelcolor : k # black
127128
### TICKS
128129
tick.major.size : 4 # major tick size in points
129130
tick.minor.size : 2 # minor tick size in points
130-
tick.major.pad : 4 # distance to major tick label in points
131-
tick.minor.pad : 4 # distance to the minor tick label in points
131+
tick.major.pad : 4 # distance to major tick label in points
132+
tick.minor.pad : 4 # distance to the minor tick label in points
132133
tick.color : k # color of the tick labels
133134
tick.labelsize : 10 # fontsize of the tick labels
134135

@@ -143,13 +144,12 @@ figure.dpi : 80 # figure dots per inch
143144
figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray
144145
figure.edgecolor : w # figure edgecolor; w is white
145146

146-
147147
### images
148-
image.aspect : free # free | preserve
148+
image.aspect : free # free | preserve
149149
image.interpolation : bilinear # see help(imshow) for options
150-
image.cmap : jet # gray | jet
151-
image.lut : 256 # the size of the colormap lookup table
152-
image.origin : upper # lower | upper
150+
image.cmap : jet # gray | jet
151+
image.lut : 256 # the size of the colormap lookup table
152+
image.origin : upper # lower | upper
153153

154154
### SAVING FIGURES
155155
# the default savefig params can be different for the GUI backends.

CHANGELOG

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
New entries should be added at the top
22

3+
2004-07-13 Modified line collections to handle arbitrary length
4+
segments for each line segment. - JDH
5+
6+
2004-07-13 Fixed problems with image extent and origin -
7+
set_image_extent deprecated. Use imshow(blah, blah,
8+
extent=(xmin, xmax, ymin, ymax) instead - JDH
9+
10+
2004-07-12 Added prototype for new nav bar with codifed event
11+
handling. Use mpl_connect rather than connect for
12+
matplotlib event handling. toolbar style determined by rc
13+
toolbar param. backend status: gtk: prototype, wx: in
14+
progress, tk: not started - JDH
15+
316
2004-07-11 backend_gtk.py: use builtin round() instead of redefining it.
417
- SC
518

MANIFEST

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,21 @@ examples/date_demo3.py
197197
examples/dynamic_demo.py
198198
examples/dynamic_demo_wx.py
199199
examples/dynamic_image_gtkagg.py
200+
examples/dynamic_image_wxagg.py
200201
examples/embedding_in_gtk.py
201202
examples/embedding_in_gtk2.py
202203
examples/embedding_in_tk.py
203204
examples/embedding_in_wx.py
204205
examples/embedding_in_wx2.py
206+
examples/embedding_in_wx3.py
207+
examples/embedding_in_wx4.py
205208
examples/errorbar_demo.py
206209
examples/figimage_demo.py
207210
examples/figlegend_demo.py
208211
examples/figtext.py
209212
examples/fill_demo.py
210213
examples/finance_demo.py
214+
examples/font_properties_demo.py
211215
examples/fonts_demo.py
212216
examples/fonts_demo_kw.py
213217
examples/ftface_props.py
@@ -257,6 +261,12 @@ examples/stock_demo.py
257261
examples/subplot_demo.py
258262
examples/system_monitor.py
259263
examples/table_demo.py
264+
examples/test.py
265+
examples/test2.py
266+
examples/test3.py
267+
examples/test4.py
268+
examples/test5.py
269+
examples/test6.py
260270
examples/text_handles.py
261271
examples/text_themes.py
262272
examples/to_numeric.py
@@ -267,6 +277,7 @@ examples/data/AAPL.dat
267277
examples/data/INTC.dat
268278
examples/data/ct.raw
269279
examples/data/eeg.dat
280+
examples/data/embedding_in_wx3.xrc
270281
examples/data/intc.csv
271282
examples/data/membrane.dat
272283
examples/data/msft.csv
@@ -321,20 +332,35 @@ fonts/afm/pzdr.afm
321332
fonts/ttf/COPYRIGHT.TXT
322333
fonts/ttf/README.TXT
323334
fonts/ttf/RELEASENOTES.TXT
335+
fonts/ttf/Vera.pfa
324336
fonts/ttf/Vera.ttf
337+
fonts/ttf/VeraBI.pfa
325338
fonts/ttf/VeraBI.ttf
339+
fonts/ttf/VeraBd.pfa
326340
fonts/ttf/VeraBd.ttf
341+
fonts/ttf/VeraIt.pfa
327342
fonts/ttf/VeraIt.ttf
343+
fonts/ttf/VeraMoBI.pfa
328344
fonts/ttf/VeraMoBI.ttf
345+
fonts/ttf/VeraMoBd.pfa
329346
fonts/ttf/VeraMoBd.ttf
347+
fonts/ttf/VeraMoIt.pfa
330348
fonts/ttf/VeraMoIt.ttf
349+
fonts/ttf/VeraMono.pfa
331350
fonts/ttf/VeraMono.ttf
351+
fonts/ttf/VeraSe.pfa
332352
fonts/ttf/VeraSe.ttf
353+
fonts/ttf/VeraSeBd.pfa
333354
fonts/ttf/VeraSeBd.ttf
355+
fonts/ttf/cmex10.pfa
334356
fonts/ttf/cmex10.ttf
357+
fonts/ttf/cmmi10.pfa
335358
fonts/ttf/cmmi10.ttf
359+
fonts/ttf/cmr10.pfa
336360
fonts/ttf/cmr10.ttf
361+
fonts/ttf/cmsy10.pfa
337362
fonts/ttf/cmsy10.ttf
363+
fonts/ttf/cmtt10.pfa
338364
fonts/ttf/cmtt10.ttf
339365
fonts/ttf/local.conf
340366
images/stock_close.ppm
@@ -417,3 +443,4 @@ src/ft2font.cpp
417443
src/ft2font.h
418444
src/mplutils.cpp
419445
src/mplutils.h
446+
test/test.py

TODO

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,8 @@
462462
-- add colorbar to screenshots
463463

464464
-- add jim's legend patch
465+
466+
-- DONE clear clip for agg
467+
468+
-- layer images broken
469+

examples/backend_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def drive(backend):
9090
backends = ['PS', 'GD', 'Paint', 'Agg', 'Template']
9191
#backends.extend([ 'GTK', 'WX', 'TkAgg'])
9292
backends = [ 'Agg']
93-
#backends = [ 'Agg', 'PS', 'Template']
93+
backends = [ 'Agg', 'PS', 'Template']
9494

9595
for backend in backends:
9696
print 'testing %s' % backend

examples/coords_demo.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@
1212

1313
canvas = get_current_fig_manager().canvas
1414

15-
def on_move(widget, event):
15+
def on_move(event):
1616
# get the x and y coords, flip y from top to bottom
17-
height = canvas.figure.bbox.height()
18-
x, y = event.x, height-event.y
17+
x, y = event.x, event.y
1918

2019
if ax.in_axes(x, y):
2120
# transData transforms data coords to display coords. Use the
2221
# inverse method to transform back
2322
print ax.transData.inverse_xy_tup( (x,y) )
2423

25-
def on_click(widget, event):
24+
def on_click(event):
2625
# get the x and y coords, flip y from top to bottom
27-
height = canvas.figure.bbox.height()
28-
x, y = event.x, height-event.y
26+
x, y = event.x, event.y
2927
if event.button==1:
3028
if ax.in_axes(x, y):
3129
# transData transforms data coords to display coords. Use the
@@ -34,8 +32,8 @@ def on_click(widget, event):
3432

3533

3634

37-
canvas.connect('motion_notify_event', on_move)
38-
#canvas.connect('button_press_event', on_click)
35+
canvas.mpl_connect('motion_notify_event', on_move)
36+
#canvas.mpl_connect('button_press_event', on_click)
3937

4038

4139

examples/customize_rc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
If you like to work interactively, and need to create different sets
66
of defaults for figures (eg one set of defaults for publication, one
7-
set for interactive exmplotation, you may want to define some
7+
set for interactive exploration), you may want to define some
88
functions in a custom module that set the defaults, eg
99
1010
def set_pub():
@@ -21,7 +21,7 @@ def set_pub():
2121
>>> set_pub()
2222
>>> subplot(111)
2323
>>> plot([1,2,3])
24-
>>> #savefig('myfig')
24+
>>> savefig('myfig')
2525
>>> rcdefaults() # restore the defaults
2626
2727
"""
@@ -37,9 +37,9 @@ def set_pub():
3737

3838
# using aliases for color, linestyle and linewith; gray, solid, thick
3939
rc('grid', c=0.5, ls='-', lw=5)
40-
41-
subplot(312)
4240
rc('lines', lw=2, color='g')
41+
subplot(312)
42+
4343
plot([1,2,3])
4444
grid(True)
4545

examples/embedding_in_wx3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
ERR_TOL = 1e-5 # floating point slop for peak-detection
3434

3535

36-
matplotlib.rc('image', origin='upper')
36+
matplotlib.rc('image', origin='lower')
3737

3838
class PlotPanel(wxPanel):
3939

examples/finance_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
ax.xaxis.set_major_formatter(weekFormatter)
3434
#ax.xaxis.set_minor_formatter(dayFormatter)
3535

36-
#plot_day_summary(ax, quotes, ticksize=3, converter=converter)
37-
candlestick(ax, quotes, width=0.6, converter=converter)
36+
plot_day_summary2(ax, quotes, ticksize=3, converter=converter)
37+
#candlestick(ax, quotes, width=0.6, converter=converter)
3838
set( gca().get_xticklabels(), 'rotation', 45, 'horizontalalignment', 'right')
3939

4040
show()

examples/image_demo2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
A *= 1.0/max(A)
88
A.shape = w, h
99

10-
im = imshow(A, cmap=cm.jet, origin='upper')
11-
#im.set_aspect('preserve')
10+
extent = (0, 25, 0, 25)
11+
im = imshow(A, cmap=cm.jet, origin='upper', extent=extent)
1212

1313
# plot some data with the image; currently broken with aspect preserve
14-
gca().set_image_extent(0, 25, 0, 25)
14+
1515
markers = [(15.9, 14.5), (16.8, 15)]
1616
x,y = zip(*markers)
1717
plot(x, y, 'o')

0 commit comments

Comments
 (0)