SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(2)
2
3
(1)
4
(5)
5
(2)
6
(3)
7
(8)
8
(1)
9
10
11
12
(2)
13
(1)
14
(2)
15
16
(3)
17
(11)
18
(5)
19
(5)
20
(2)
21
(2)
22
(6)
23
(1)
24
25
(5)
26
27
(3)
28
(14)
29
(6)
30
31






Showing results of 90

1 2 3 4 > >> (Page 1 of 4)
From: <ds...@us...> - 2009年05月29日 21:46:20
Revision: 7165
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7165&view=rev
Author: dsdale
Date: 2009年05月29日 21:45:55 +0000 (2009年5月29日)
Log Message:
-----------
improve the animation_blit_qt4 example
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/examples/animation/animation_blit_qt4.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2009年05月29日 18:24:46 UTC (rev 7164)
+++ trunk/matplotlib/CHANGELOG	2009年05月29日 21:45:55 UTC (rev 7165)
@@ -1,3 +1,7 @@
+2009年05月29日 Improved the animation_blit_qt4 example, which was a mix 
+ of the object-oriented and pylab interfaces. It is now
+ strictly object-oriented - DSD
+
 2009年05月28日 Fix axes_grid toolkit to work with spine patch by ADS. - JJL
 
 2009年05月28日 Applied fbianco's patch to handle scroll wheel events in
Modified: trunk/matplotlib/examples/animation/animation_blit_qt4.py
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_qt4.py	2009年05月29日 18:24:46 UTC (rev 7164)
+++ trunk/matplotlib/examples/animation/animation_blit_qt4.py	2009年05月29日 21:45:55 UTC (rev 7165)
@@ -1,68 +1,75 @@
 # For detailed comments on animation and the techniqes used here, see
 # the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
 
-import os, sys
-import matplotlib
-matplotlib.use('Qt4Agg') # qt4 example
+import os
+import sys
 
+#import matplotlib
+#matplotlib.use('Qt4Agg')
+from matplotlib.figure import Figure
+from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
+
 from PyQt4 import QtCore, QtGui
 
 ITERS = 1000
 
-import pylab as p
-import numpy as npy
+import numpy as np
 import time
 
-class BlitQT(QtCore.QObject):
+class BlitQT(FigureCanvas):
+
 def __init__(self):
- self.ax = p.subplot(111)
- self.canvas = self.ax.figure.canvas
+ FigureCanvas.__init__(self, Figure())
 
- # By making this a child of the canvas we make sure that it is
- # destroyed first and avoids a possible exception when the user clicks
- # on the window's close box.
- QtCore.QObject.__init__(self, self.canvas)
+ self.ax = self.figure.add_subplot(111)
+ self.ax.grid()
+ self.draw()
 
+ self.old_size = self.ax.bbox.width, self.ax.bbox.height
+ self.ax_background = self.copy_from_bbox(self.ax.bbox)
 self.cnt = 0
 
- # create the initial line
- self.x = npy.arange(0,2*npy.pi,0.01)
- self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2)
+ self.x = np.arange(0,2*np.pi,0.01)
+ self.sin_line, = self.ax.plot(self.x, np.sin(self.x), animated=True)
+ self.cos_line, = self.ax.plot(self.x, np.cos(self.x), animated=True)
+ self.draw()
 
- self.background = None
- self.old_size = 0, 0
+ self.tstart = time.time()
+ self.startTimer(10)
 
 def timerEvent(self, evt):
- # See if the size has changed since last time round.
 current_size = self.ax.bbox.width, self.ax.bbox.height
-
 if self.old_size != current_size:
 self.old_size = current_size
- self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+ self.ax.clear()
+ self.ax.grid()
+ self.draw()
+ self.ax_background = self.copy_from_bbox(self.ax.bbox)
 
- # restore the clean slate background
- self.canvas.restore_region(self.background)
+ self.restore_region(self.ax_background, bbox=self.ax.bbox)
+
 # update the data
- self.line.set_ydata(npy.sin(self.x+self.cnt/10.0))
+ self.sin_line.set_ydata(np.sin(self.x+self.cnt/10.0))
+ self.cos_line.set_ydata(np.cos(self.x+self.cnt/10.0))
 # just draw the animated artist
- self.ax.draw_artist(self.line)
+ self.ax.draw_artist(self.sin_line)
+ self.ax.draw_artist(self.cos_line)
 # just redraw the axes rectangle
- self.canvas.blit(self.ax.bbox)
+ self.blit(self.ax.bbox)
 
+ if self.cnt == 0:
+ # TODO: this shouldn't be necessary, but if it is excluded the
+ # canvas outside the axes is not initially painted.
+ self.draw()
 if self.cnt==ITERS:
 # print the timing info and quit
 print 'FPS:' , ITERS/(time.time()-self.tstart)
 sys.exit()
-
 else:
 self.cnt += 1
 
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
+app = QtGui.QApplication(sys.argv)
+widget = BlitQT()
+widget.show()
 
-app = BlitQT()
-# for profiling
-app.tstart = time.time()
-app.startTimer(0)
-
-p.show()
+sys.exit(app.exec_())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2009年05月29日 18:24:55
Revision: 7164
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7164&view=rev
Author: efiring
Date: 2009年05月29日 18:24:46 +0000 (2009年5月29日)
Log Message:
-----------
Make rcsetup validate_color handle non-string input
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/rcsetup.py
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py	2009年05月29日 15:59:47 UTC (rev 7163)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py	2009年05月29日 18:24:46 UTC (rev 7164)
@@ -177,8 +177,11 @@
 
 def validate_color(s):
 'return a valid color arg'
- if s.lower() == 'none':
- return 'None'
+ try:
+ if s.lower() == 'none':
+ return 'None'
+ except AttributeError:
+ pass
 if is_color_like(s):
 return s
 stmp = '#' + s
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年05月29日 15:59:48
Revision: 7163
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7163&view=rev
Author: jdh2358
Date: 2009年05月29日 15:59:47 +0000 (2009年5月29日)
Log Message:
-----------
fixed a buglet in legend when len(handles)==1 and ncol=2
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py	2009年05月29日 03:52:32 UTC (rev 7162)
+++ trunk/matplotlib/lib/matplotlib/legend.py	2009年05月29日 15:59:47 UTC (rev 7163)
@@ -110,7 +110,7 @@
 mode=None, # mode for horizontal distribution of columns. None, "expand"
 
 fancybox=None, # True use a fancy box, false use a rounded box, none use rc
- shadow = None, 
+ shadow = None,
 title = None, # set a title for the legend
 bbox_to_anchor = None, # bbox that the legend will be anchored.
 bbox_transform = None, # transform for the bbox
@@ -139,7 +139,7 @@
 borderaxespad the pad between the axes and legend border
 columnspacing the spacing between columns
 title the legend title
- bbox_to_anchor the bbox that the legend will be anchored. 
+ bbox_to_anchor the bbox that the legend will be anchored.
 bbox_transform the transform for the bbox. transAxes if None.
 ================ ==================================================================
 
@@ -204,6 +204,9 @@
 
 del localdict
 
+ handles = list(handles)
+ if len(handles)<2:
+ ncol = 1
 self._ncol = ncol
 
 if self.numpoints <= 0:
@@ -258,7 +261,7 @@
 self._loc = loc
 self._mode = mode
 self.set_bbox_to_anchor(bbox_to_anchor, bbox_transform)
- 
+
 # We use FancyBboxPatch to draw a legend frame. The location
 # and size of the box will be updated during the drawing time.
 self.legendPatch = FancyBboxPatch(
@@ -578,13 +581,13 @@
 
 sep = self.columnspacing*fontsize
 
- self._legend_handle_box = HPacker(pad=0, 
+ self._legend_handle_box = HPacker(pad=0,
 sep=sep, align="baseline",
 mode=mode,
 children=columnbox)
 
 self._legend_title_box = TextArea("")
- 
+
 self._legend_box = VPacker(pad=self.borderpad*fontsize,
 sep=self.labelspacing*fontsize,
 align="center",
@@ -722,9 +725,9 @@
 
 self._bbox_to_anchor = TransformedBbox(self._bbox_to_anchor,
 transform)
- 
- 
 
+
+
 def _get_anchored_bbox(self, loc, bbox, parentbbox, renderer):
 """
 Place the *bbox* inside the *parentbbox* according to a given
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <lee...@us...> - 2009年05月29日 03:52:40
Revision: 7162
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7162&view=rev
Author: leejjoon
Date: 2009年05月29日 03:52:32 +0000 (2009年5月29日)
Log Message:
-----------
Fix axes_grid toolkit to work with the spine patch
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py
 trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2009年05月29日 02:33:06 UTC (rev 7161)
+++ trunk/matplotlib/CHANGELOG	2009年05月29日 03:52:32 UTC (rev 7162)
@@ -1,4 +1,6 @@
-2009年05月28日 Applied fbianco's patch to handle scroll wheel events in 
+2009年05月28日 Fix axes_grid toolkit to work with spine patch by ADS. - JJL
+
+2009年05月28日 Applied fbianco's patch to handle scroll wheel events in
 the qt4 backend - DSD
 
 2009年05月26日 Add support for "axis spines" to have arbitrary location. -ADS
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py	2009年05月29日 02:33:06 UTC (rev 7161)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py	2009年05月29日 03:52:32 UTC (rev 7162)
@@ -1249,12 +1249,16 @@
 b = not self._axisline_on
 if b:
 self._axisline_on = True
- self.frame.set_visible(False)
+ #self.frame.set_visible(False)
+ for s in self.spines.values():
+ s.artist.set_visible(False)
 self.xaxis.set_visible(False)
 self.yaxis.set_visible(False)
 else:
 self._axisline_on = False
- self.frame.set_visible(True)
+ #self.frame.set_visible(True)
+ for s in self.spines.values():
+ s.artist.set_visible(True)
 self.xaxis.set_visible(True)
 self.yaxis.set_visible(True)
 
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py	2009年05月29日 02:33:06 UTC (rev 7161)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py	2009年05月29日 03:52:32 UTC (rev 7162)
@@ -48,14 +48,15 @@
 
 class ParasiteAxesAuxTrans(ParasiteAxes):
 
- def __init__(self, parent_axes, aux_transform, viewlim_mode=None):
+ def __init__(self, parent_axes, aux_transform, viewlim_mode=None,
+ **kwargs):
 
 self.transAux = aux_transform
 
 #self._viewlim_mode = viewlim_mode
 self.set_viewlim_mode(viewlim_mode)
 
- super(ParasiteAxesAuxTrans, self).__init__(parent_axes)
+ super(ParasiteAxesAuxTrans, self).__init__(parent_axes, **kwargs)
 
 def _set_lim_and_transforms(self):
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年05月29日 03:43:58
Revision: 7161
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7161&view=rev
Author: jdh2358
Date: 2009年05月29日 02:33:06 +0000 (2009年5月29日)
Log Message:
-----------
add toolkits plot dirs to website
Modified Paths:
--------------
 trunk/matplotlib/doc/sphinxext/gen_gallery.py
 trunk/matplotlib/doc/sphinxext/gen_rst.py
Modified: trunk/matplotlib/doc/sphinxext/gen_gallery.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/gen_gallery.py	2009年05月29日 02:08:15 UTC (rev 7160)
+++ trunk/matplotlib/doc/sphinxext/gen_gallery.py	2009年05月29日 02:33:06 UTC (rev 7161)
@@ -38,7 +38,7 @@
 print
 print "generating gallery: ",
 data = []
- for subdir in ('api', 'pylab_examples', 'widgets', 'mplot3d'):
+ for subdir in ('api', 'pylab_examples', 'mplot3d', 'widgets', 'axes_grid' ):
 origdir = os.path.join('build', rootdir, subdir)
 thumbdir = os.path.join(outdir, rootdir, subdir, 'thumbnails')
 if not os.path.exists(thumbdir):
Modified: trunk/matplotlib/doc/sphinxext/gen_rst.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/gen_rst.py	2009年05月29日 02:08:15 UTC (rev 7160)
+++ trunk/matplotlib/doc/sphinxext/gen_rst.py	2009年05月29日 02:33:06 UTC (rev 7161)
@@ -128,7 +128,10 @@
 
 do_plot = (subdir in ('api',
 'pylab_examples',
- 'units') and
+ 'units',
+ 'mplot3d',
+ 'axes_grid',
+ ) and
 not noplot_regex.search(contents))
 
 if do_plot:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年05月29日 02:30:57
Revision: 7160
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7160&view=rev
Author: jdh2358
Date: 2009年05月29日 02:08:15 +0000 (2009年5月29日)
Log Message:
-----------
added spine autodocs
Modified Paths:
--------------
 trunk/matplotlib/doc/api/index.rst
 trunk/matplotlib/examples/pylab_examples/axhspan_demo.py
Added Paths:
-----------
 trunk/matplotlib/doc/api/spine_api.rst
Modified: trunk/matplotlib/doc/api/index.rst
===================================================================
--- trunk/matplotlib/doc/api/index.rst	2009年05月28日 18:02:49 UTC (rev 7159)
+++ trunk/matplotlib/doc/api/index.rst	2009年05月29日 02:08:15 UTC (rev 7160)
@@ -30,5 +30,6 @@
 mlab_api.rst
 path_api.rst
 pyplot_api.rst
+ spine_api.rst
 ticker_api.rst
 index_backend_api.rst
Added: trunk/matplotlib/doc/api/spine_api.rst
===================================================================
--- trunk/matplotlib/doc/api/spine_api.rst	 (rev 0)
+++ trunk/matplotlib/doc/api/spine_api.rst	2009年05月29日 02:08:15 UTC (rev 7160)
@@ -0,0 +1,12 @@
+*****************
+matplotlib spine
+*****************
+
+
+:mod:`matplotlib.spine`
+======================
+
+.. automodule:: matplotlib.spine
+ :members:
+ :undoc-members:
+ :show-inheritance:
Modified: trunk/matplotlib/examples/pylab_examples/axhspan_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/axhspan_demo.py	2009年05月28日 18:02:49 UTC (rev 7159)
+++ trunk/matplotlib/examples/pylab_examples/axhspan_demo.py	2009年05月29日 02:08:15 UTC (rev 7160)
@@ -11,7 +11,7 @@
 # draw a default hline at y=1 that spans the xrange
 l = plt.axhline(y=1)
 
-# draw a default vline at x=1 that spans the xrange
+# draw a default vline at x=1 that spans the yrange
 l = plt.axvline(x=1)
 
 # draw a thick blue vline at x=0 that spans the the upper quadrant of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <sa...@us...> - 2009年05月28日 18:02:54
Revision: 7159
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7159&view=rev
Author: sameerd
Date: 2009年05月28日 18:02:49 +0000 (2009年5月28日)
Log Message:
-----------
Updated the record array helper functions to create an empty record array where necessary
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py	2009年05月28日 17:50:38 UTC (rev 7158)
+++ trunk/matplotlib/lib/matplotlib/mlab.py	2009年05月28日 18:02:49 UTC (rev 7159)
@@ -2047,18 +2047,6 @@
 except TypeError: return False
 else: return b
 
-def rec_view(rec):
- """
- Return a view of an ndarray as a recarray
-
- .. seealso::
-
- http://projects.scipy.org/pipermail/numpy-discussion/2008-August/036429.html
- Motivation for this function
- """
- return rec.view(np.recarray)
- #return rec.view(dtype=(np.record, rec.dtype), type=np.recarray)
-
 def rec_append_field(rec, name, arr, dtype=None):
 """
 Return a new record array with field name populated with data from
@@ -2094,12 +2082,12 @@
 raise ValueError, "dtypes must be None, a single dtype or a list"
 
 newdtype = np.dtype(rec.dtype.descr + zip(names, dtypes))
- newrec = np.empty(rec.shape, dtype=newdtype)
+ newrec = np.recarray(rec.shape, dtype=newdtype)
 for field in rec.dtype.fields:
 newrec[field] = rec[field]
 for name, arr in zip(names, arrs):
 newrec[name] = arr
- return rec_view(newrec)
+ return newrec
 
 
 def rec_drop_fields(rec, names):
@@ -2113,11 +2101,11 @@
 newdtype = np.dtype([(name, rec.dtype[name]) for name in rec.dtype.names
 if name not in names])
 
- newrec = np.empty(Nr, dtype=newdtype)
+ newrec = np.recarray(rec.shape, dtype=newdtype)
 for field in newdtype.names:
 newrec[field] = rec[field]
 
- return rec_view(newrec)
+ return newrec
 
 
 
@@ -2279,7 +2267,7 @@
 r2desc = [(mapped_r2field(desc[0]), desc[1]) for desc in r2.dtype.descr if desc[0] not in key]
 newdtype = np.dtype(keydesc + r1desc + r2desc)
 
- newrec = np.empty(common_len + left_len + right_len, dtype=newdtype)
+ newrec = np.recarray((common_len + left_len + right_len,), dtype=newdtype)
 
 if defaults is not None:
 for thiskey in defaults:
@@ -2314,7 +2302,7 @@
 
 newrec.sort(order=key)
 
- return rec_view(newrec)
+ return newrec
 
 
 def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <cm...@us...> - 2009年05月28日 17:50:47
Revision: 7158
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7158&view=rev
Author: cmoad
Date: 2009年05月28日 17:50:38 +0000 (2009年5月28日)
Log Message:
-----------
cleaned up a few typos
Modified Paths:
--------------
 trunk/matplotlib/release/win32/Makefile
Modified: trunk/matplotlib/release/win32/Makefile
===================================================================
--- trunk/matplotlib/release/win32/Makefile	2009年05月28日 16:49:17 UTC (rev 7157)
+++ trunk/matplotlib/release/win32/Makefile	2009年05月28日 17:50:38 UTC (rev 7158)
@@ -22,9 +22,9 @@
 
 LDFLAGS = -L${SRCDIR}/zlib-${ZLIBVERSION}
 LDFLAGS += -L${SRCDIR}/libpng-${PNGVERSION}
-LDFLAGS += -L${SRCDIR}/freetype-${FREETYPEVERSION}s
+LDFLAGS += -L${SRCDIR}/freetype-${FREETYPEVERSION}
 
-PY_INCLUDE = "${WINSRCDIR}\\zlib-${ZLIBVERSION};${WINSRCDIR}/libpng-${PNGVERSION};${WINSRCDIR}/freetype-${FREETYPEVERSION}/include;${WINSRCDIR}/tcl${TCLTKVERSION}/generic;${WINSRCDIR}/tcl${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/generic;${WINSRCDIR}/tk${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/xlib"
+PY_INCLUDE = "${WINSRCDIR}/zlib-${ZLIBVERSION};${WINSRCDIR}/libpng-${PNGVERSION};${WINSRCDIR}/freetype-${FREETYPEVERSION}/include;${WINSRCDIR}/tcl${TCLTKVERSION}/generic;${WINSRCDIR}/tcl${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/generic;${WINSRCDIR}/tk${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/xlib"
 
 PY_LINKER = "${WINSRCDIR}/zlib-${ZLIBVERSION};${WINSRCDIR}/libpng-${PNGVERSION};${WINSRCDIR}/freetype-${FREETYPEVERSION}"
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年05月28日 17:20:58
Revision: 7152
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7152&view=rev
Author: jdh2358
Date: 2009年05月28日 14:02:08 +0000 (2009年5月28日)
Log Message:
-----------
update readme w/ sdist instructions
Modified Paths:
--------------
 trunk/matplotlib/release/win32/README.txt
Modified: trunk/matplotlib/release/win32/README.txt
===================================================================
--- trunk/matplotlib/release/win32/README.txt	2009年05月28日 13:45:36 UTC (rev 7151)
+++ trunk/matplotlib/release/win32/README.txt	2009年05月28日 14:02:08 UTC (rev 7152)
@@ -40,14 +40,20 @@
 * First fetch all the dependencies::
 
 make fetch_deps
- 
+
 * build the dependencies::
 
 make dependencies
 
-* copy over the latest mpl *.tar.gz tarball to this directory, update
- the MPLVERSION in the Makefile::
- 
+* copy over the latest mpl *.tar.gz tarball to this directory. You
+ can create the source distribution file with ::
+
+ > /c/Python26/python sdist --formats=gztar
+
+ and then copy the dist/matplotlib.VERSION.tar.gz file into the
+ directory alongside the Makefile. Update the MPLVERSION in the
+ Makefile::
+
 * build the wininst binary and egg::
 
 make installers
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2009年05月28日 16:49:26
Revision: 7157
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7157&view=rev
Author: mdboom
Date: 2009年05月28日 16:49:17 +0000 (2009年5月28日)
Log Message:
-----------
Handle overrightarrow and overleftarrow in mathtext like accents.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py	2009年05月28日 16:30:12 UTC (rev 7156)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py	2009年05月28日 16:49:17 UTC (rev 7157)
@@ -2445,7 +2445,9 @@
 r"'" : r'\combiningacuteaccent',
 r'~' : r'\combiningtilde',
 r'.' : r'\combiningdotabove',
- r'^' : r'\circumflexaccent'
+ r'^' : r'\circumflexaccent',
+ r'overrightarrow' : r'\rightarrow',
+ r'overleftarrow' : r'\leftarrow'
 }
 
 _wide_accents = set(r"widehat widetilde".split())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7156
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7156&view=rev
Author: jdh2358
Date: 2009年05月28日 16:30:12 +0000 (2009年5月28日)
Log Message:
-----------
update to doc sidebar
Modified Paths:
--------------
 trunk/matplotlib/doc/_templates/indexsidebar.html
Modified: trunk/matplotlib/doc/_templates/indexsidebar.html
===================================================================
--- trunk/matplotlib/doc/_templates/indexsidebar.html	2009年05月28日 16:11:16 UTC (rev 7155)
+++ trunk/matplotlib/doc/_templates/indexsidebar.html	2009年05月28日 16:30:12 UTC (rev 7156)
@@ -1,10 +1,20 @@
-<h3>Download</h3>
-<p>Current version: <b>{{ version }}</b></p>
+<h3>News</h3>
 
-<p>Nominate matplotlib for a community choice award!
+<p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a>
+to support matplotlib development.</p>
+
+<p>Nominate matplotlib for a community choice award by clicking the
+image below -- suggested category "Best Project for Academia" for
+software which "helps you hit the books, analyze global trends, or
+just understand the world a little bit better than you did before":
 <a href="http://sourceforge.net/images/cca/cca_nominate.png" border="0"/></a>
 </p>
 
+
+<h3>Download</h3>
+<p>Current version: <b>{{ version }}</b></p>
+
+
 <p>Download matplotlib from the
 sourceforge <a href="http://sourceforge.net/projects/matplotlib">project</a>
 page (but first take a look at the <a href="{{
@@ -16,8 +26,6 @@
 and mapping toolkit
 <a href="http://matplotlib.sf.net/basemap/doc/html">basemap</a>.</p>
 
-<p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a>
-to support matplotlib development.</p>
 
 <h3>Need help?</h3>
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ds...@us...> - 2009年05月28日 16:11:21
Revision: 7155
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7155&view=rev
Author: dsdale
Date: 2009年05月28日 16:11:16 +0000 (2009年5月28日)
Log Message:
-----------
handle scroll wheel events in Qt4 backend
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2009年05月28日 15:59:12 UTC (rev 7154)
+++ trunk/matplotlib/CHANGELOG	2009年05月28日 16:11:16 UTC (rev 7155)
@@ -1,3 +1,6 @@
+2009年05月28日 Applied fbianco's patch to handle scroll wheel events in 
+ the qt4 backend - DSD
+
 2009年05月26日 Add support for "axis spines" to have arbitrary location. -ADS
 
 2009年05月20日 Add an empty matplotlibrc to the tests/ directory so that running
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py	2009年05月28日 15:59:12 UTC (rev 7154)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py	2009年05月28日 16:11:16 UTC (rev 7155)
@@ -136,6 +136,16 @@
 FigureCanvasBase.button_release_event( self, x, y, button )
 if DEBUG: print 'button released'
 
+ def wheelEvent( self, event ):
+ x = event.x()
+ # flipy so y=0 is bottom of canvas
+ y = self.figure.bbox.height - event.y()
+ # from QWheelEvent::delta doc
+ steps = event.delta()/120
+ if (event.orientation() == Qt.Qt.Vertical):
+ FigureCanvasBase.scroll_event( self, x, y, steps)
+ if DEBUG: print 'scroll event : delta = %i, steps = %i ' % (event.delta(),steps)
+
 def keyPressEvent( self, event ):
 key = self._get_key( event )
 FigureCanvasBase.key_press_event( self, key )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <he...@us...> - 2009年05月28日 15:59:18
Revision: 7154
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7154&view=rev
Author: heeres
Date: 2009年05月28日 15:59:12 +0000 (2009年5月28日)
Log Message:
-----------
mplot3d: add examples, fix NaN bug
Modified Paths:
--------------
 trunk/matplotlib/lib/mpl_toolkits/mplot3d/__init__.py
 trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
Added Paths:
-----------
 trunk/matplotlib/examples/mplot3d/contour.py
 trunk/matplotlib/examples/mplot3d/contourf.py
 trunk/matplotlib/examples/mplot3d/polys.py
 trunk/matplotlib/examples/mplot3d/scatter.py
 trunk/matplotlib/examples/mplot3d/surface.py
 trunk/matplotlib/examples/mplot3d/wire.py
Added: trunk/matplotlib/examples/mplot3d/contour.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/contour.py	 (rev 0)
+++ trunk/matplotlib/examples/mplot3d/contour.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -0,0 +1,12 @@
+from mpl_toolkits.mplot3d import axes3d
+import pylab
+import random
+
+fig = pylab.figure()
+ax = axes3d.Axes3D(fig)
+X, Y, Z = axes3d.get_test_data(0.05)
+cset = ax.contour3D(X, Y, Z)
+ax.clabel(cset, fontsize=9, inline=1)
+
+pylab.show()
+
Added: trunk/matplotlib/examples/mplot3d/contourf.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/contourf.py	 (rev 0)
+++ trunk/matplotlib/examples/mplot3d/contourf.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -0,0 +1,12 @@
+from mpl_toolkits.mplot3d import axes3d
+import pylab
+import random
+
+fig = pylab.figure()
+ax = axes3d.Axes3D(fig)
+X, Y, Z = axes3d.get_test_data(0.05)
+cset = ax.contourf3D(X, Y, Z)
+ax.clabel(cset, fontsize=9, inline=1)
+
+pylab.show()
+
Added: trunk/matplotlib/examples/mplot3d/polys.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/polys.py	 (rev 0)
+++ trunk/matplotlib/examples/mplot3d/polys.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -0,0 +1,31 @@
+from mpl_toolkits.mplot3d import Axes3D
+from matplotlib.collections import PolyCollection
+from matplotlib.colors import colorConverter
+import pylab
+import random
+import numpy as np
+
+fig = pylab.figure()
+ax = Axes3D(fig)
+
+cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.6)
+
+xs = np.arange(0, 10, 0.4)
+verts = []
+zs = [0.0, 1.0, 2.0, 3.0]
+for z in zs:
+ ys = [random.random() for x in xs]
+ ys[0], ys[-1] = 0, 0
+ verts.append(zip(xs, ys))
+
+poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
+ cc('y')])
+poly.set_alpha(0.7)
+ax.add_collection(poly, zs=zs, dir='y')
+
+ax.set_xlim(0, 10)
+ax.set_ylim(-1, 4)
+ax.set_zlim(0, 1)
+
+pylab.show()
+
Added: trunk/matplotlib/examples/mplot3d/scatter.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/scatter.py	 (rev 0)
+++ trunk/matplotlib/examples/mplot3d/scatter.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -0,0 +1,21 @@
+from mpl_toolkits.mplot3d import Axes3D
+import pylab
+import random
+
+fig = pylab.figure()
+ax = Axes3D(fig)
+n = 100
+for c, zl, zh in [('r', -50, -25), ('b', -30, -5)]:
+ xs, ys, zs = zip(*
+ [(random.randrange(23, 32),
+ random.randrange(100),
+ random.randrange(zl, zh)
+ ) for i in range(n)])
+ ax.scatter3D(xs, ys, zs, c=c)
+
+ax.set_xlabel('X Label')
+ax.set_ylabel('Y Label')
+ax.set_zlabel('Z Label')
+
+pylab.show()
+
Added: trunk/matplotlib/examples/mplot3d/surface.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/surface.py	 (rev 0)
+++ trunk/matplotlib/examples/mplot3d/surface.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -0,0 +1,16 @@
+from mpl_toolkits.mplot3d import Axes3D
+import pylab
+import random
+import numpy as np
+
+fig = pylab.figure()
+ax = Axes3D(fig)
+X = np.arange(-5, 5, 0.5)
+Y = np.arange(-5, 5, 0.5)
+X, Y = np.meshgrid(X, Y)
+R = np.sqrt(X**2 + Y**2)
+Z = np.sin(R)
+ax.plot_surface(X, Y, Z, rstride=1, cstride=1, color='forestgreen')
+
+pylab.show()
+
Added: trunk/matplotlib/examples/mplot3d/wire.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/wire.py	 (rev 0)
+++ trunk/matplotlib/examples/mplot3d/wire.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -0,0 +1,12 @@
+from mpl_toolkits.mplot3d import axes3d
+import pylab
+import random
+import numpy as np
+
+fig = pylab.figure()
+ax = axes3d.Axes3D(fig)
+X, Y, Z = axes3d.get_test_data(0.05)
+ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
+
+pylab.show()
+
Modified: trunk/matplotlib/lib/mpl_toolkits/mplot3d/__init__.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/mplot3d/__init__.py	2009年05月28日 14:49:14 UTC (rev 7153)
+++ trunk/matplotlib/lib/mpl_toolkits/mplot3d/__init__.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -0,0 +1 @@
+from axes3d import Axes3D
Modified: trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py	2009年05月28日 14:49:14 UTC (rev 7153)
+++ trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py	2009年05月28日 15:59:12 UTC (rev 7154)
@@ -539,6 +539,9 @@
 rstride = kwargs.pop('rstride', 10)
 cstride = kwargs.pop('cstride', 10)
 
+ color = kwargs.pop('color', 'b')
+ color = np.array(colorConverter.to_rgba(color))
+
 polys = []
 boxes = []
 for rs in np.arange(0,rows-1,rstride):
@@ -567,8 +570,10 @@
 shade.append(np.dot(n,[-1,-1,0.5]))
 lines.append((box[0],n+box[0]))
 
- color = np.array([0,0,1,1])
- norm = Normalize(min(shade),max(shade))
+ shade = np.array(shade)
+ mask = ~np.isnan(shade)
+ norm = Normalize(min(shade[mask]), max(shade[mask]))
+
 colors = [color * (0.5+norm(v)*0.5) for v in shade]
 for c in colors: c[3] = 1
 polyc = art3d.Poly3DCollection(polys, facecolors=colors, *args, **kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年05月28日 14:49:16
Revision: 7153
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7153&view=rev
Author: jdh2358
Date: 2009年05月28日 14:49:14 +0000 (2009年5月28日)
Log Message:
-----------
update readme w/ test instructions
Modified Paths:
--------------
 trunk/matplotlib/release/win32/README.txt
Modified: trunk/matplotlib/release/win32/README.txt
===================================================================
--- trunk/matplotlib/release/win32/README.txt	2009年05月28日 14:02:08 UTC (rev 7152)
+++ trunk/matplotlib/release/win32/README.txt	2009年05月28日 14:49:14 UTC (rev 7153)
@@ -10,6 +10,7 @@
 	(tested with MinGW-5.1.4.exe)
 	http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780
 
+
 * Install "MSYS Base System"::
 
 	(tested with MSYS-1.0.10.exe)
@@ -21,6 +22,27 @@
 	http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=233332
 	NOTE: Uncompress and copy the "wget.exe" file to "C:\MingW\bin\"
 
+
+* Test your installation. After installing the above, open MSYS and
+ check your install by doing::
+
+ > gcc --version
+ > g++ --version
+
+ If you don't have g++, try running the mingw exe installer again,
+ and you will be prompted for additional compilers to install.
+ Select c++ and you are off to the races.
+
+ Make sure setuptools are installed::
+
+ > /c/python26/python
+ >>> import setuptools
+
+ If not, grab the latest ez_setup.py and install it::
+
+ > wget http://peak.telecommunity.com/dist/ez_setup.py
+ > /c/python26/python ez_setup.py
+
 Dir Contents
 -------------
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年05月28日 14:05:27
Revision: 7151
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7151&view=rev
Author: jdh2358
Date: 2009年05月28日 13:45:36 +0000 (2009年5月28日)
Log Message:
-----------
remove trailing spaces before comments
Modified Paths:
--------------
 trunk/matplotlib/release/win32/Makefile
Modified: trunk/matplotlib/release/win32/Makefile
===================================================================
--- trunk/matplotlib/release/win32/Makefile	2009年05月28日 11:54:35 UTC (rev 7150)
+++ trunk/matplotlib/release/win32/Makefile	2009年05月28日 13:45:36 UTC (rev 7151)
@@ -1,11 +1,11 @@
 PYTHON = C:/Python26/python.exe
-SRCDIR = ${PWD} # autoconf needs this path
-WINSRCDIR = `${PWD}/data/mingw_path.sh ${PWD}` # distutils needs windows paths
+SRCDIR = ${PWD}# autoconf needs this path
+WINSRCDIR = `${PWD}/data/mingw_path.sh ${PWD}`# distutils needs windows paths
 ZLIBVERSION = 1.2.3
 PNGVERSION = 1.2.33
 FREETYPEVERSION = 2.3.7
-#TCLTKVERSION = 8.4.19 # Before Python 2.6
-TCLTKVERSION = 8.5.7 # Python 2.6
+#TCLTKVERSION = 8.4.19# Before Python 2.6
+TCLTKVERSION = 8.5.7# Python 2.6
 MPLVERSION = 0.98.6svn
 
 ## You shouldn't need to configure past this point
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2009年05月28日 11:54:41
Revision: 7150
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7150&view=rev
Author: mdboom
Date: 2009年05月28日 11:54:35 +0000 (2009年5月28日)
Log Message:
-----------
Fix some compiler warnings
Modified Paths:
--------------
 trunk/matplotlib/agg24/include/agg_conv_curve.h
 trunk/matplotlib/src/_png.cpp
Modified: trunk/matplotlib/agg24/include/agg_conv_curve.h
===================================================================
--- trunk/matplotlib/agg24/include/agg_conv_curve.h	2009年05月28日 11:54:18 UTC (rev 7149)
+++ trunk/matplotlib/agg24/include/agg_conv_curve.h	2009年05月28日 11:54:35 UTC (rev 7150)
@@ -2,8 +2,8 @@
 // Anti-Grain Geometry - Version 2.4
 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
 //
-// Permission to copy, use, modify, sell and distribute this software 
-// is granted provided this copyright notice appears in all copies. 
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
 // This software is provided "as is" without express or implied
 // warranty, and with no claim as to its suitability for any purpose.
 //
@@ -28,31 +28,31 @@
 
 
 //---------------------------------------------------------------conv_curve
- // Curve converter class. Any path storage can have Bezier curves defined 
- // by their control points. There're two types of curves supported: curve3 
+ // Curve converter class. Any path storage can have Bezier curves defined
+ // by their control points. There're two types of curves supported: curve3
 // and curve4. Curve3 is a conic Bezier curve with 2 endpoints and 1 control
 // point. Curve4 has 2 control points (4 points in total) and can be used
- // to interpolate more complicated curves. Curve4, unlike curve3 can be used 
- // to approximate arcs, both circular and elliptical. Curves are approximated 
- // with straight lines and one of the approaches is just to store the whole 
- // sequence of vertices that approximate our curve. It takes additional 
- // memory, and at the same time the consecutive vertices can be calculated 
- // on demand. 
+ // to interpolate more complicated curves. Curve4, unlike curve3 can be used
+ // to approximate arcs, both circular and elliptical. Curves are approximated
+ // with straight lines and one of the approaches is just to store the whole
+ // sequence of vertices that approximate our curve. It takes additional
+ // memory, and at the same time the consecutive vertices can be calculated
+ // on demand.
 //
 // Initially, path storages are not suppose to keep all the vertices of the
 // curves (although, nothing prevents us from doing so). Instead, path_storage
 // keeps only vertices, needed to calculate a curve on demand. Those vertices
- // are marked with special commands. So, if the path_storage contains curves 
- // (which are not real curves yet), and we render this storage directly, 
- // all we will see is only 2 or 3 straight line segments (for curve3 and 
- // curve4 respectively). If we need to see real curves drawn we need to 
- // include this class into the conversion pipeline. 
+ // are marked with special commands. So, if the path_storage contains curves
+ // (which are not real curves yet), and we render this storage directly,
+ // all we will see is only 2 or 3 straight line segments (for curve3 and
+ // curve4 respectively). If we need to see real curves drawn we need to
+ // include this class into the conversion pipeline.
 //
- // Class conv_curve recognizes commands path_cmd_curve3 and path_cmd_curve4 
- // and converts these vertices into a move_to/line_to sequence. 
+ // Class conv_curve recognizes commands path_cmd_curve3 and path_cmd_curve4
+ // and converts these vertices into a move_to/line_to sequence.
 //-----------------------------------------------------------------------
- template<class VertexSource, 
- class Curve3=curve3, 
+ template<class VertexSource,
+ class Curve3=curve3,
 class Curve4=curve4> class conv_curve
 {
 public:
@@ -64,51 +64,51 @@
 m_source(&source), m_last_x(0.0), m_last_y(0.0) {}
 void attach(VertexSource& source) { m_source = &source; }
 
- void approximation_method(curve_approximation_method_e v) 
- { 
+ void approximation_method(curve_approximation_method_e v)
+ {
 m_curve3.approximation_method(v);
 m_curve4.approximation_method(v);
 }
 
- curve_approximation_method_e approximation_method() const 
- { 
+ curve_approximation_method_e approximation_method() const
+ {
 return m_curve4.approximation_method();
 }
 
- void approximation_scale(double s) 
- { 
- m_curve3.approximation_scale(s); 
- m_curve4.approximation_scale(s); 
+ void approximation_scale(double s)
+ {
+ m_curve3.approximation_scale(s);
+ m_curve4.approximation_scale(s);
 }
 
- double approximation_scale() const 
- { 
- return m_curve4.approximation_scale(); 
+ double approximation_scale() const
+ {
+ return m_curve4.approximation_scale();
 }
 
- void angle_tolerance(double v) 
- { 
- m_curve3.angle_tolerance(v); 
- m_curve4.angle_tolerance(v); 
+ void angle_tolerance(double v)
+ {
+ m_curve3.angle_tolerance(v);
+ m_curve4.angle_tolerance(v);
 }
 
- double angle_tolerance() const 
- { 
- return m_curve4.angle_tolerance(); 
+ double angle_tolerance() const
+ {
+ return m_curve4.angle_tolerance();
 }
 
- void cusp_limit(double v) 
- { 
- m_curve3.cusp_limit(v); 
- m_curve4.cusp_limit(v); 
+ void cusp_limit(double v)
+ {
+ m_curve3.cusp_limit(v);
+ m_curve4.cusp_limit(v);
 }
 
- double cusp_limit() const 
- { 
- return m_curve4.cusp_limit(); 
+ double cusp_limit() const
+ {
+ return m_curve4.cusp_limit();
 }
 
- void rewind(unsigned path_id); 
+ void rewind(unsigned path_id);
 unsigned vertex(double* x, double* y);
 
 private:
@@ -154,10 +154,10 @@
 return path_cmd_line_to;
 }
 
- double ct2_x;
- double ct2_y;
- double end_x;
- double end_y;
+ double ct2_x = 0.0;
+ double ct2_y = 0.0;
+ double end_x = 0.0;
+ double end_y = 0.0;
 
 unsigned cmd = m_source->vertex(x, y);
 switch(cmd)
@@ -165,8 +165,8 @@
 case path_cmd_curve3:
 m_source->vertex(&end_x, &end_y);
 
- m_curve3.init(m_last_x, m_last_y, 
- *x, *y, 
+ m_curve3.init(m_last_x, m_last_y,
+ *x, *y,
 end_x, end_y);
 
 m_curve3.vertex(x, y); // First call returns path_cmd_move_to
@@ -178,9 +178,9 @@
 m_source->vertex(&ct2_x, &ct2_y);
 m_source->vertex(&end_x, &end_y);
 
- m_curve4.init(m_last_x, m_last_y, 
- *x, *y, 
- ct2_x, ct2_y, 
+ m_curve4.init(m_last_x, m_last_y,
+ *x, *y,
+ ct2_x, ct2_y,
 end_x, end_y);
 
 m_curve4.vertex(x, y); // First call returns path_cmd_move_to
Modified: trunk/matplotlib/src/_png.cpp
===================================================================
--- trunk/matplotlib/src/_png.cpp	2009年05月28日 11:54:18 UTC (rev 7149)
+++ trunk/matplotlib/src/_png.cpp	2009年05月28日 11:54:35 UTC (rev 7150)
@@ -272,11 +272,11 @@
 	 size_t offset = y*A->strides[0] + x*A->strides[1];
 	 if (bit_depth == 16) {
 	 png_uint_16* ptr = &reinterpret_cast<png_uint_16*> (row)[x * dimensions[2]];
-		for (png_uint_32 p = 0; p < dimensions[2]; p++)
+ for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++)
 	 *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value;
 	 } else {
 	 png_byte* ptr = &(row[x * dimensions[2]]);
-	 for (png_uint_32 p = 0; p < dimensions[2]; p++)
+	 for (png_uint_32 p = 0; p < (png_uint_32)dimensions[2]; p++)
 		{
 	 *(float*)(A->data + offset + p*A->strides[2]) = (float)(ptr[p]) / max_value;
 	 }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2009年05月28日 11:54:24
Revision: 7149
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7149&view=rev
Author: mdboom
Date: 2009年05月28日 11:54:18 +0000 (2009年5月28日)
Log Message:
-----------
Fix documentation of path.simplify to reflect reality
Modified Paths:
--------------
 trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template	2009年05月28日 04:02:17 UTC (rev 7148)
+++ trunk/matplotlib/matplotlibrc.template	2009年05月28日 11:54:18 UTC (rev 7149)
@@ -289,8 +289,9 @@
 # A value of 20000 is probably a good
 # starting point.
 ### SAVING FIGURES
-#path.simplify : False # When True, simplify paths in vector backends, such as
- # PDF, PS and SVG
+#path.simplify : False # When True, simplify paths by removing "invisible" 
+ # points to reduce file size and increase rendering
+ # speed
 #path.simplify_threshold : 0.1 # The threshold of similarity below which
 # vertices will be removed in the simplification
 # process
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <cm...@us...> - 2009年05月28日 04:02:24
Revision: 7148
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7148&view=rev
Author: cmoad
Date: 2009年05月28日 04:02:17 +0000 (2009年5月28日)
Log Message:
-----------
added win32 release README
Modified Paths:
--------------
 trunk/matplotlib/release/osx/README.txt
Added Paths:
-----------
 trunk/matplotlib/release/win32/README.txt
Modified: trunk/matplotlib/release/osx/README.txt
===================================================================
--- trunk/matplotlib/release/osx/README.txt	2009年05月28日 03:48:15 UTC (rev 7147)
+++ trunk/matplotlib/release/osx/README.txt	2009年05月28日 04:02:17 UTC (rev 7148)
@@ -1,6 +1,6 @@
 Building binary releases of OS X
 
-Included here is everything to build a binay package installer for OS
+Included here is everything to build a binary package installer for OS
 X
 
 Dir Contents
Added: trunk/matplotlib/release/win32/README.txt
===================================================================
--- trunk/matplotlib/release/win32/README.txt	 (rev 0)
+++ trunk/matplotlib/release/win32/README.txt	2009年05月28日 04:02:17 UTC (rev 7148)
@@ -0,0 +1,55 @@
+Building binary releases of WIN32
+
+Included here is everything to build a binary package installer for WIN32 using MinGW
+
+MinGW Requirements
+-------------
+
+* Install MinGW using the "Automated MinGW Installer"::
+
+	(tested with MinGW-5.1.4.exe)
+	http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780
+
+* Install "MSYS Base System"::
+
+	(tested with MSYS-1.0.10.exe)
+	http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963
+
+* Install wget from "mingwPORT"::
+
+	(tested with wget-1.9.1-mingwPORT.tar.bz2)
+	http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=233332
+	NOTE: Uncompress and copy the "wget.exe" file to "C:\MingW\bin\"
+
+Dir Contents
+-------------
+
+* :file:`data` - some config files and patches needed for the build
+
+* :file:`Makefile` - all the build commands
+
+How to build
+--------------
+
+* Edit the variables as needed in :file:`Makefile`
+
+* Open a msys shell from::
+
+	All Programs -> MinGW -> MSYS -> msys
+
+* First fetch all the dependencies::
+
+ make fetch_deps
+ 
+* build the dependencies::
+
+ make dependencies
+
+* copy over the latest mpl *.tar.gz tarball to this directory, update
+ the MPLVERSION in the Makefile::
+ 
+* build the wininst binary and egg::
+
+ make installers
+
+	The wininst and egg binaries will reside in :file:`matplotlib-VERSION/dist`
Property changes on: trunk/matplotlib/release/win32/README.txt
___________________________________________________________________
Added: svn:mime-type
 + text/plain
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <cm...@us...> - 2009年05月28日 03:48:20
Revision: 7147
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7147&view=rev
Author: cmoad
Date: 2009年05月28日 03:48:15 +0000 (2009年5月28日)
Log Message:
-----------
finished win32 release scripts
Modified Paths:
--------------
 trunk/matplotlib/release/win32/Makefile
 trunk/matplotlib/release/win32/data/setup.cfg
Added Paths:
-----------
 trunk/matplotlib/release/win32/data/mingw_path.sh
 trunk/matplotlib/release/win32/data/setupwin.py
 trunk/matplotlib/release/win32/data/setupwinegg.py
Modified: trunk/matplotlib/release/win32/Makefile
===================================================================
--- trunk/matplotlib/release/win32/Makefile	2009年05月28日 03:24:27 UTC (rev 7146)
+++ trunk/matplotlib/release/win32/Makefile	2009年05月28日 03:48:15 UTC (rev 7147)
@@ -1,26 +1,47 @@
-PYTHON=C:/Python26/python.exe
-SRCDIR=${PWD}
-ZLIBVERSION=1.2.3
-PNGVERSION=1.2.33
-FREETYPEVERSION=2.3.7
-MPLVERSION=0.98.5.3
+PYTHON = C:/Python26/python.exe
+SRCDIR = ${PWD} # autoconf needs this path
+WINSRCDIR = `${PWD}/data/mingw_path.sh ${PWD}` # distutils needs windows paths
+ZLIBVERSION = 1.2.3
+PNGVERSION = 1.2.33
+FREETYPEVERSION = 2.3.7
+#TCLTKVERSION = 8.4.19 # Before Python 2.6
+TCLTKVERSION = 8.5.7 # Python 2.6
+MPLVERSION = 0.98.6svn
 
 ## You shouldn't need to configure past this point
 
-CFLAGS="-Os -I${SRCDIR}/zlib-${ZLIBVERSION} -I${SRCDIR}/libpng-${PNGVERSION} -I${SRCDIR}/freetype-${FREETYPEVERSION}/include"
+CFLAGS = -Os
+CFLAGS += -I${SRCDIR}/zlib-${ZLIBVERSION}
+CFLAGS += -I${SRCDIR}/libpng-${PNGVERSION}
+CFLAGS += -I${SRCDIR}/freetype-${FREETYPEVERSION}/include
+CFLAGS += -I${SRCDIR}/tcl${TCLTKVERSION}-src/generic
+CFLAGS += -I${SRCDIR}/tcl${TCLTKVERSION}-src/win
+CFLAGS += -I${SRCDIR}/tk${TCLTKVERSION}-src/generic
+CFLAGS += -I${SRCDIR}/tk${TCLTKVERSION}-src/win
+CFLAGS += -I${SRCDIR}/tk${TCLTKVERSION}-src/X11
 
-LDFLAGS="-L${SRCDIR}/zlib-${ZLIBVERSION} -L${SRCDIR}/libpng-${PNGVERSION} -L${SRCDIR}/freetype-${FREETYPEVERSION}"
+LDFLAGS = -L${SRCDIR}/zlib-${ZLIBVERSION}
+LDFLAGS += -L${SRCDIR}/libpng-${PNGVERSION}
+LDFLAGS += -L${SRCDIR}/freetype-${FREETYPEVERSION}s
 
+PY_INCLUDE = "${WINSRCDIR}\\zlib-${ZLIBVERSION};${WINSRCDIR}/libpng-${PNGVERSION};${WINSRCDIR}/freetype-${FREETYPEVERSION}/include;${WINSRCDIR}/tcl${TCLTKVERSION}/generic;${WINSRCDIR}/tcl${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/generic;${WINSRCDIR}/tk${TCLTKVERSION}/win;${WINSRCDIR}/tk${TCLTKVERSION}/xlib"
+
+PY_LINKER = "${WINSRCDIR}/zlib-${ZLIBVERSION};${WINSRCDIR}/libpng-${PNGVERSION};${WINSRCDIR}/freetype-${FREETYPEVERSION}"
+
 clean:
 	rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \
 	freetype-${FREETYPEVERSION}.tar.bz2 \
+	tcl${TCLTKVERSION}-src.tar.gz tk${TCLTKVERSION}-src.tar.gz \
 	zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} \
+	tcl${TCLTKVERSION} tk${TCLTKVERSION} \
 	matplotlib-${MPLVERSION} *~
 
 fetch_deps:
 	wget http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz
 	wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2
 	wget http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2
+	wget http://prdownloads.sourceforge.net/tcl/tcl${TCLTKVERSION}-src.tar.gz
+	wget http://prdownloads.sourceforge.net/tcl/tk${TCLTKVERSION}-src.tar.gz
 
 zlib:
 	rm -rf zlib-${ZLIBVERSION}
@@ -33,8 +54,8 @@
 	rm -rf libpng-${PNGVERSION}
 	tar xvfj libpng-${PNGVERSION}.tar.bz2
 	cd libpng-${PNGVERSION} &&\
-	export CFLAGS=${CFLAGS} &&\
-	export LDFLAGS=${LDFLAGS} &&\
+	export CFLAGS="${CFLAGS}" &&\
+	export LDFLAGS="${LDFLAGS}" &&\
 	./configure --disable-shared &&\
 	make -j3 &&\
 	cp .libs/libpng.a .
@@ -48,15 +69,21 @@
 	mingw32-make -j3 &&\
 	cp objs/libfreetype.a .
 
-dependencies: png freetype
+tcltk:
+	rm -rf tcl${TCLTKVERSION}
+	rm -rf tk${TCLTKVERSION}
+	tar xvfz tcl${TCLTKVERSION}-src.tar.gz
+	tar xvfz tk${TCLTKVERSION}-src.tar.gz
 
+dependencies: png freetype tcltk
+
 installers:
 	rm -rf matplotlib-${MPLVERSION}
 	tar xvzf matplotlib-${MPLVERSION}.tar.gz
 	cd matplotlib-${MPLVERSION} &&\
 	rm -rf build &&\
-	cp ../data/setup.cfg . &&\
-	${PYTHON} setup.py build -c mingw32 bdist_wininst &&\
-	${PYTHON} setupegg.py build -c mingw32 bdist_egg
+	cp ../data/setup*.* . &&\
+	${PYTHON} setupwin.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_wininst &&\
+	${PYTHON} setupwinegg.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_egg
 
 all: fetch_deps dependencies installers
Added: trunk/matplotlib/release/win32/data/mingw_path.sh
===================================================================
--- trunk/matplotlib/release/win32/data/mingw_path.sh	 (rev 0)
+++ trunk/matplotlib/release/win32/data/mingw_path.sh	2009年05月28日 03:48:15 UTC (rev 7147)
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# This script will convert a UNIX path to a Win32 native path
+UPATH=1ドル
+if test "$UPATH" = ""; then
+ echo EMPTY
+ exit 1
+fi
+#echo "INPUT IS \"$UPATH\"" >&2
+if [ -d "$UPATH" ]
+then
+ cd "$UPATH"
+ WPATH=`pwd -W`
+else
+ # cd up to parent directories until we find
+ # one that exists. Loop ends at "/".
+ dpart=`dirname "$UPATH"`
+ #echo "dpart starts as \"$dpart\"" >&2
+ while [ ! -d "$dpart" ]
+ do
+ dpart=`dirname "$dpart"`
+ #echo "dpart is \"$dpart\"" >&2
+ done
+ #echo "dpart ends as \"$dpart\"" >&2
+
+ if [ "$dpart" != "." ]
+ then
+ dstart=`expr length "$dpart"`
+ # If the last character in dpart is not "/",
+ # then advance dstart by one index. This
+ # avoids two dir seperators in the result.
+ last=`expr length "$dpart"`
+ last=`expr $last - 1`
+ last=${dpart:$last:1}
+ #echo "last is \"$last\"" >&2
+ if [ "$last" != "/" ]
+ then
+ dstart=`expr $dstart + 1`
+ fi
+ dend=`expr length "$UPATH"`
+ dlen=`expr $dend - $dstart`
+ #echo "UPATH is \"$UPATH\"" >&2
+ #echo "dstart is $dstart, dend is $dend, dlen is $dlen" >&2
+ bpart=${UPATH:$dstart:$dend}
+ dpart=`cd "$dpart" ; pwd -W`
+ #echo "dpart \"$dpart\"" >&2
+ #echo "bpart \"$bpart\"" >&2
+ else
+ dpart=`pwd -W`
+ bpart=$UPATH
+ fi
+ WPATH=${dpart}/${bpart}
+fi
+#echo "OUTPUT IS \"$WPATH\"" >&2
+echo $WPATH
+exit 0
+
Modified: trunk/matplotlib/release/win32/data/setup.cfg
===================================================================
--- trunk/matplotlib/release/win32/data/setup.cfg	2009年05月28日 03:24:27 UTC (rev 7146)
+++ trunk/matplotlib/release/win32/data/setup.cfg	2009年05月28日 03:48:15 UTC (rev 7147)
@@ -1,79 +1,79 @@
-# Rename this file to setup.cfg to modify matplotlib's
-# build options.
-
-[egg_info]
-tag_svn_revision = 1
-
-[status]
-# To suppress display of the dependencies and their versions
-# at the top of the build log, uncomment the following line:
-#suppress = True
-#
-# Uncomment to insert lots of diagnostic prints in extension code
-#verbose = True
-
-[provide_packages]
-# By default, matplotlib checks for a few dependencies and
-# installs them if missing. This feature can be turned off
-# by uncommenting the following lines. Acceptible values are:
-# True: install, overwrite an existing installation
-# False: do not install
-# auto: install only if the package is unavailable. This
-# is the default behavior
-#
-## Date/timezone support:
-pytz = True
-dateutil = True
-
-
-[gui_support]
-# Matplotlib supports multiple GUI toolkits, including Cocoa,
-# GTK, Fltk, MacOSX, Qt, Qt4, Tk, and WX. Support for many of
-# these toolkits requires AGG, the Anti-Grain Geometry library,
-# which is provided by matplotlib and built by default.
-#
-# Some backends are written in pure Python, and others require
-# extension code to be compiled. By default, matplotlib checks
-# for these GUI toolkits during installation and, if present,
-# compiles the required extensions to support the toolkit. GTK
-# support requires the GTK runtime environment and PyGTK. Wx
-# support requires wxWidgets and wxPython. Tk support requires
-# Tk and Tkinter. The other GUI toolkits do not require any
-# extension code, and can be used as long as the libraries are
-# installed on your system.
-#
-# You can uncomment any the following lines if you know you do
-# not want to use the GUI toolkit. Acceptible values are:
-# True: build the extension. Exits with a warning if the
-# required dependencies are not available
-# False: do not build the extension
-# auto: build if the required dependencies are available,
-# otherwise skip silently. This is the default
-# behavior
-#
-gtk = False
-gtkagg = False
-tkagg = True
-wxagg = False
-macosx = False
-
-[rc_options]
-# User-configurable options
-#
-# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, GTKCairo,
-# FltkAgg, MacOSX, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg.
-#
-# The Agg, Ps, Pdf and SVG backends do not require external
-# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, TkAgg or WXAgg
-# if you have disabled the relevent extension modules. Agg will be used
-# by default.
-#
-backend = TkAgg
-#
-# The numerix module was historically used to provide
-# compatibility between the Numeric, numarray, and NumPy array
-# packages. Now that NumPy has emerge as the universal array
-# package for python, numerix is not really necessary and is
-# maintained to provide backward compatibility. Do not change
-# this unless you have a compelling reason to do so.
-#numerix = numpy
+# Rename this file to setup.cfg to modify matplotlib's
+# build options.
+
+[egg_info]
+tag_svn_revision = 0
+
+[status]
+# To suppress display of the dependencies and their versions
+# at the top of the build log, uncomment the following line:
+#suppress = True
+#
+# Uncomment to insert lots of diagnostic prints in extension code
+#verbose = True
+
+[provide_packages]
+# By default, matplotlib checks for a few dependencies and
+# installs them if missing. This feature can be turned off
+# by uncommenting the following lines. Acceptible values are:
+# True: install, overwrite an existing installation
+# False: do not install
+# auto: install only if the package is unavailable. This
+# is the default behavior
+#
+## Date/timezone support:
+pytz = True
+dateutil = True
+
+
+[gui_support]
+# Matplotlib supports multiple GUI toolkits, including Cocoa,
+# GTK, Fltk, MacOSX, Qt, Qt4, Tk, and WX. Support for many of
+# these toolkits requires AGG, the Anti-Grain Geometry library,
+# which is provided by matplotlib and built by default.
+#
+# Some backends are written in pure Python, and others require
+# extension code to be compiled. By default, matplotlib checks
+# for these GUI toolkits during installation and, if present,
+# compiles the required extensions to support the toolkit. GTK
+# support requires the GTK runtime environment and PyGTK. Wx
+# support requires wxWidgets and wxPython. Tk support requires
+# Tk and Tkinter. The other GUI toolkits do not require any
+# extension code, and can be used as long as the libraries are
+# installed on your system.
+#
+# You can uncomment any the following lines if you know you do
+# not want to use the GUI toolkit. Acceptible values are:
+# True: build the extension. Exits with a warning if the
+# required dependencies are not available
+# False: do not build the extension
+# auto: build if the required dependencies are available,
+# otherwise skip silently. This is the default
+# behavior
+#
+gtk = False
+gtkagg = False
+tkagg = True
+wxagg = False
+macosx = False
+
+[rc_options]
+# User-configurable options
+#
+# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, GTKCairo,
+# FltkAgg, MacOSX, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg.
+#
+# The Agg, Ps, Pdf and SVG backends do not require external
+# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, TkAgg or WXAgg
+# if you have disabled the relevent extension modules. Agg will be used
+# by default.
+#
+backend = TkAgg
+#
+# The numerix module was historically used to provide
+# compatibility between the Numeric, numarray, and NumPy array
+# packages. Now that NumPy has emerge as the universal array
+# package for python, numerix is not really necessary and is
+# maintained to provide backward compatibility. Do not change
+# this unless you have a compelling reason to do so.
+#numerix = numpy
Added: trunk/matplotlib/release/win32/data/setupwin.py
===================================================================
--- trunk/matplotlib/release/win32/data/setupwin.py	 (rev 0)
+++ trunk/matplotlib/release/win32/data/setupwin.py	2009年05月28日 03:48:15 UTC (rev 7147)
@@ -0,0 +1,17 @@
+from distutils import cygwinccompiler
+
+try:
+	# Python 2.6
+	# Replace the msvcr func to return an empty list
+	cygwinccompiler.get_msvcr
+	cygwinccompiler.get_msvcr = lambda: []
+
+except AttributeError:
+	# Before Python 2.6
+	# Wrap the init func to clear to dll libs
+	def new_init(self, **kwargs):
+		cygwinccompiler.CygwinCCompiler.__init__(self, **kwargs)
+		self.dll_libraries = []
+	cygwinccompiler.CygwinCCompiler.__init__ = new_init
+
+execfile('setup.py')
Added: trunk/matplotlib/release/win32/data/setupwinegg.py
===================================================================
--- trunk/matplotlib/release/win32/data/setupwinegg.py	 (rev 0)
+++ trunk/matplotlib/release/win32/data/setupwinegg.py	2009年05月28日 03:48:15 UTC (rev 7147)
@@ -0,0 +1,20 @@
+from distutils import cygwinccompiler
+
+try:
+	# Python 2.6
+	# Replace the msvcr func to return an empty list
+	cygwinccompiler.get_msvcr
+	cygwinccompiler.get_msvcr = lambda: []
+
+except AttributeError:
+	# Before Python 2.6
+	# Wrap the init func to clear to dll libs
+	def new_init(self, **kwargs):
+		cygwinccompiler.CygwinCCompiler.__init__(self, **kwargs)
+		self.dll_libraries = []
+	cygwinccompiler.CygwinCCompiler.__init__ = new_init
+
+from setuptools import setup
+execfile('setup.py',
+ {'additional_params' :
+ {'namespace_packages' : ['mpl_toolkits']}})
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <cm...@us...> - 2009年05月28日 03:24:32
Revision: 7146
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7146&view=rev
Author: cmoad
Date: 2009年05月28日 03:24:27 +0000 (2009年5月28日)
Log Message:
-----------
removed gw32 link flag that's not needed for mingw anymore
Modified Paths:
--------------
 trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py	2009年05月27日 16:25:33 UTC (rev 7145)
+++ trunk/matplotlib/setupext.py	2009年05月28日 03:24:27 UTC (rev 7146)
@@ -542,10 +542,7 @@
 else:
 add_base_flags(module)
 module.libraries.append('z')
-
- if sys.platform == 'win32' and win32_compiler == 'mingw32':
- module.libraries.append('gw32c')
-
+ 
 # put this last for library link order
 module.libraries.extend(std_libs)
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <as...@us...> - 2009年05月27日 16:25:39
Revision: 7145
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7145&view=rev
Author: astraw
Date: 2009年05月27日 16:25:33 +0000 (2009年5月27日)
Log Message:
-----------
make default argument to Axes.get_xaxis_transform() not raise error
I made this a separate commit from the previous one because it may be
useful to see the errors that arise if get_xaxis_transform() or
get_yaxis_transform() are called with no arguments. This would allow
one to figure out which code paths are calling these methods and fix
them if needed rather than silently partially succeeding.
Modified Paths:
--------------
 trunk/matplotlib/examples/api/custom_projection_example.py
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/projections/geo.py
 trunk/matplotlib/lib/matplotlib/projections/polar.py
Modified: trunk/matplotlib/examples/api/custom_projection_example.py
===================================================================
--- trunk/matplotlib/examples/api/custom_projection_example.py	2009年05月27日 16:25:15 UTC (rev 7144)
+++ trunk/matplotlib/examples/api/custom_projection_example.py	2009年05月27日 16:25:33 UTC (rev 7145)
@@ -173,7 +173,7 @@
 yaxis_text_base + \
 Affine2D().translate(8.0, 0.0)
 
- def get_xaxis_transform(self,which=None):
+ def get_xaxis_transform(self,which='grid'):
 """
 Override this method to provide a transformation for the
 x-axis grid and ticks.
@@ -199,7 +199,7 @@
 """
 return self._xaxis_text2_transform, 'top', 'center'
 
- def get_yaxis_transform(self,which=None):
+ def get_yaxis_transform(self,which='grid'):
 """
 Override this method to provide a transformation for the
 y-axis grid and ticks.
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2009年05月27日 16:25:15 UTC (rev 7144)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2009年05月27日 16:25:33 UTC (rev 7145)
@@ -641,7 +641,7 @@
 self._yaxis_transform = mtransforms.blended_transform_factory(
 self.transAxes, self.transData)
 
- def get_xaxis_transform(self,which=None):
+ def get_xaxis_transform(self,which='grid'):
 """
 Get the transformation used for drawing x-axis labels, ticks
 and gridlines. The x-direction is in data coordinates and the
@@ -712,7 +712,7 @@
 self.figure.dpi_scale_trans),
 "bottom", "center")
 
- def get_yaxis_transform(self,which=None):
+ def get_yaxis_transform(self,which='grid'):
 """
 Get the transformation used for drawing y-axis labels, ticks
 and gridlines. The x-direction is in axis coordinates and the
Modified: trunk/matplotlib/lib/matplotlib/projections/geo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/geo.py	2009年05月27日 16:25:15 UTC (rev 7144)
+++ trunk/matplotlib/lib/matplotlib/projections/geo.py	2009年05月27日 16:25:33 UTC (rev 7145)
@@ -121,7 +121,7 @@
 .scale(0.5 / xscale, 0.5 / yscale) \
 .translate(0.5, 0.5)
 
- def get_xaxis_transform(self,which=None):
+ def get_xaxis_transform(self,which='grid'):
 assert which in ['tick1','tick2','grid']
 return self._xaxis_transform
 
@@ -131,7 +131,7 @@
 def get_xaxis_text2_transform(self, pad):
 return self._xaxis_text2_transform, 'top', 'center'
 
- def get_yaxis_transform(self,which=None):
+ def get_yaxis_transform(self,which='grid'):
 assert which in ['tick1','tick2','grid']
 return self._yaxis_transform
 
Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py	2009年05月27日 16:25:15 UTC (rev 7144)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py	2009年05月27日 16:25:33 UTC (rev 7145)
@@ -270,7 +270,7 @@
 self._yaxis_transform
 )
 
- def get_xaxis_transform(self,which=None):
+ def get_xaxis_transform(self,which='grid'):
 assert which in ['tick1','tick2','grid']
 return self._xaxis_transform
 
@@ -280,7 +280,7 @@
 def get_xaxis_text2_transform(self, pad):
 return self._xaxis_text2_transform, 'center', 'center'
 
- def get_yaxis_transform(self,which=None):
+ def get_yaxis_transform(self,which='grid'):
 assert which in ['tick1','tick2','grid']
 return self._yaxis_transform
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <as...@us...> - 2009年05月27日 16:25:21
Revision: 7144
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7144&view=rev
Author: astraw
Date: 2009年05月27日 16:25:15 +0000 (2009年5月27日)
Log Message:
-----------
Arbitrary spine placement
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/doc/api/api_changes.rst
 trunk/matplotlib/doc/users/whats_new.rst
 trunk/matplotlib/examples/api/custom_projection_example.py
 trunk/matplotlib/examples/tests/backend_driver.py
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/axis.py
 trunk/matplotlib/lib/matplotlib/projections/geo.py
 trunk/matplotlib/lib/matplotlib/projections/polar.py
Added Paths:
-----------
 trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py
 trunk/matplotlib/lib/matplotlib/spines.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/CHANGELOG	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -1,3 +1,5 @@
+2009年05月26日 Add support for "axis spines" to have arbitrary location. -ADS
+
 2009年05月20日 Add an empty matplotlibrc to the tests/ directory so that running
 tests will use the default set of rcparams rather than the user's
 config. - RMM
Modified: trunk/matplotlib/doc/api/api_changes.rst
===================================================================
--- trunk/matplotlib/doc/api/api_changes.rst	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/doc/api/api_changes.rst	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -20,6 +20,13 @@
 Changes beyond 0.98.x
 =====================
 
+* Axes instanaces no longer have a "frame" attribute. Instead, use the
+ new "spines" attribute. Spines is a dictionary where the keys are
+ the names of the spines (e.g. 'left','right' and so on) and the
+ values are the artists that draw the spines. For normal
+ (rectilinear) axes, these artists are Line2D instances. For other
+ axes (such as polar axes), these artists may be Patch instances.
+
 * Polar plots no longer accept a resolution kwarg. Instead, each Path
 must specify its own number of interpolation steps. This is
 unlikely to be a user-visible change -- if interpolation of data is
Modified: trunk/matplotlib/doc/users/whats_new.rst
===================================================================
--- trunk/matplotlib/doc/users/whats_new.rst	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/doc/users/whats_new.rst	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -4,6 +4,18 @@
 What's new in matplotlib
 ***************************
 
+.. _whats-new-svn:
+
+What new in svn
+===============
+
+Axis spine placement
+--------------------
+
+Andrew Straw has added the ability to place "axis spines" -- the lines
+that denote the data limits -- in various arbitrary locations. See
+:class:`matplotlib.spines.Spine`.
+
 .. _whats-new-0-98-4:
 
 What new in 0.98.4
Modified: trunk/matplotlib/examples/api/custom_projection_example.py
===================================================================
--- trunk/matplotlib/examples/api/custom_projection_example.py	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/examples/api/custom_projection_example.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -6,6 +6,8 @@
 from matplotlib.transforms import Affine2D, Affine2DBase, Bbox, \
 BboxTransformTo, IdentityTransform, Transform, TransformWrapper
 from matplotlib.projections import register_projection
+import matplotlib.spines as mspines
+import matplotlib.axis as maxis
 
 import numpy as np
 
@@ -32,6 +34,14 @@
 self.set_aspect(0.5, adjustable='box', anchor='C')
 self.cla()
 
+ def _init_axis(self):
+ self.xaxis = maxis.XAxis(self)
+ self.yaxis = maxis.YAxis(self)
+ # Do not register xaxis or yaxis with spines -- as done in
+ # Axes._init_axis() -- until HammerAxes.xaxis.cla() works.
+ # self.spines['hammer'].register_axis(self.yaxis)
+ self._update_transScale()
+
 def cla(self):
 """
 Override to set up some reasonable defaults.
@@ -163,11 +173,12 @@
 yaxis_text_base + \
 Affine2D().translate(8.0, 0.0)
 
- def get_xaxis_transform(self):
+ def get_xaxis_transform(self,which=None):
 """
 Override this method to provide a transformation for the
 x-axis grid and ticks.
 """
+ assert which in ['tick1','tick2','grid']
 return self._xaxis_transform
 
 def get_xaxis_text1_transform(self, pixelPad):
@@ -188,11 +199,12 @@
 """
 return self._xaxis_text2_transform, 'top', 'center'
 
- def get_yaxis_transform(self):
+ def get_yaxis_transform(self,which=None):
 """
 Override this method to provide a transformation for the
 y-axis grid and ticks.
 """
+ assert which in ['tick1','tick2','grid']
 return self._yaxis_transform
 
 def get_yaxis_text1_transform(self, pixelPad):
@@ -224,6 +236,9 @@
 """
 return Circle((0.5, 0.5), 0.5)
 
+ def _gen_axes_spines(self):
+ return {'hammer':mspines.Spine(self,'hammer',Circle((0.5, 0.5), 0.5))}
+
 # Prevent the user from applying scales to one or both of the
 # axes. In this particular case, scaling the axes wouldn't make
 # sense, so we don't allow it.
Added: trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py	 (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -0,0 +1,116 @@
+import matplotlib.pyplot as plt
+import numpy as np
+from matplotlib.pyplot import show
+
+fig = plt.figure()
+x = np.linspace(0,2*np.pi,100)
+y = 2*np.sin(x)
+ax = fig.add_subplot(1,2,1)
+ax.set_title('dropped spines')
+ax.plot(x,y)
+for loc, spine in ax.spines.iteritems():
+ if loc in ['left','bottom']:
+ spine.set_position(('outward',10)) # outward by 10 points
+ elif loc in ['right','top']:
+ spine.set_color('none') # don't draw spine
+ else:
+ raise ValueError('unknown spine location: %s'%loc)
+
+# turn off ticks where there is no spine
+ax.xaxis.set_ticks_position('bottom')
+ax.yaxis.set_ticks_position('left')
+
+ax = fig.add_subplot(1,2,2,sharex=ax)
+ax.plot(x,y)
+ax.set_title('normal spines')
+
+# ----------------------------------------------------
+
+fig = plt.figure()
+x = np.linspace(-np.pi,np.pi,100)
+y = 2*np.sin(x)
+
+ax = fig.add_subplot(2,2,1)
+ax.set_title('centered spines')
+ax.plot(x,y)
+ax.spines['left'].set_position('center')
+ax.spines['right'].set_color('none')
+ax.spines['bottom'].set_position('center')
+ax.spines['top'].set_color('none')
+ax.xaxis.set_ticks_position('bottom')
+ax.yaxis.set_ticks_position('left')
+
+ax = fig.add_subplot(2,2,2)
+ax.set_title('zeroed spines')
+ax.plot(x,y)
+ax.spines['left'].set_position('zero')
+ax.spines['right'].set_color('none')
+ax.spines['bottom'].set_position('zero')
+ax.spines['top'].set_color('none')
+ax.xaxis.set_ticks_position('bottom')
+ax.yaxis.set_ticks_position('left')
+
+ax = fig.add_subplot(2,2,3)
+ax.set_title('spines at axes (0.6, 0.1)')
+ax.plot(x,y)
+ax.spines['left'].set_position(('axes',0.6))
+ax.spines['right'].set_color('none')
+ax.spines['bottom'].set_position(('axes',0.1))
+ax.spines['top'].set_color('none')
+ax.xaxis.set_ticks_position('bottom')
+ax.yaxis.set_ticks_position('left')
+
+ax = fig.add_subplot(2,2,4)
+ax.set_title('spines at data (1,2)')
+ax.plot(x,y)
+ax.spines['left'].set_position(('data',1))
+ax.spines['right'].set_color('none')
+ax.spines['bottom'].set_position(('data',2))
+ax.spines['top'].set_color('none')
+ax.xaxis.set_ticks_position('bottom')
+ax.yaxis.set_ticks_position('left')
+
+# ----------------------------------------------------
+
+def adjust_spines(ax,spines):
+ for loc, spine in ax.spines.iteritems():
+ if loc in spines:
+ spine.set_position(('outward',10)) # outward by 10 points
+ else:
+ spine.set_color('none') # don't draw spine
+
+ # turn off ticks where there is no spine
+ if 'left' in spines:
+ ax.yaxis.set_ticks_position('left')
+ else:
+ # no yaxis ticks
+ ax.yaxis.set_ticks([])
+
+ if 'bottom' in spines:
+ ax.xaxis.set_ticks_position('bottom')
+ else:
+ # no xaxis ticks
+ ax.xaxis.set_ticks([])
+
+fig = plt.figure()
+
+x = np.linspace(0,2*np.pi,100)
+y = 2*np.sin(x)
+
+ax = fig.add_subplot(2,2,1)
+ax.plot(x,y)
+adjust_spines(ax,['left'])
+
+ax = fig.add_subplot(2,2,2)
+ax.plot(x,y)
+adjust_spines(ax,[])
+
+ax = fig.add_subplot(2,2,3)
+ax.plot(x,y)
+adjust_spines(ax,['left','bottom'])
+
+ax = fig.add_subplot(2,2,4)
+ax.plot(x,y)
+adjust_spines(ax,['bottom'])
+
+show()
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/examples/tests/backend_driver.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -173,6 +173,7 @@
 'simple_plot.py',
 'simplification_clipping_test.py',
 'specgram_demo.py',
+ 'spine_placement_demo.py',
 'spy_demos.py',
 'stem_plot.py',
 'step_demo.py',
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -21,6 +21,7 @@
 import matplotlib.lines as mlines
 import matplotlib.mlab as mlab
 import matplotlib.patches as mpatches
+import matplotlib.spines as mspines
 import matplotlib.quiver as mquiver
 import matplotlib.scale as mscale
 import matplotlib.table as mtable
@@ -526,6 +527,8 @@
 
 self.set_axes_locator(kwargs.get("axes_locator", None))
 
+ self.spines = self._gen_axes_spines()
+
 # this call may differ for non-sep axes, eg polar
 self._init_axis()
 
@@ -576,7 +579,11 @@
 def _init_axis(self):
 "move this out of __init__ because non-separable axes don't use it"
 self.xaxis = maxis.XAxis(self)
+ self.spines['bottom'].register_axis(self.xaxis)
+ self.spines['top'].register_axis(self.xaxis)
 self.yaxis = maxis.YAxis(self)
+ self.spines['left'].register_axis(self.yaxis)
+ self.spines['right'].register_axis(self.yaxis)
 self._update_transScale()
 
 def set_figure(self, fig):
@@ -634,7 +641,7 @@
 self._yaxis_transform = mtransforms.blended_transform_factory(
 self.transAxes, self.transData)
 
- def get_xaxis_transform(self):
+ def get_xaxis_transform(self,which=None):
 """
 Get the transformation used for drawing x-axis labels, ticks
 and gridlines. The x-direction is in data coordinates and the
@@ -646,7 +653,16 @@
 overridden by new kinds of projections that may need to
 place axis elements in different locations.
 """
- return self._xaxis_transform
+ if which=='grid':
+ return self._xaxis_transform
+ elif which=='tick1':
+ # for cartesian projection, this is bottom spine
+ return self.spines['bottom'].get_spine_transform()
+ elif which=='tick2':
+ # for cartesian projection, this is top spine
+ return self.spines['top'].get_spine_transform()
+ else:
+ raise ValueError('unknown value for which')
 
 def get_xaxis_text1_transform(self, pad_points):
 """
@@ -667,7 +683,7 @@
 overridden by new kinds of projections that may need to
 place axis elements in different locations.
 """
- return (self._xaxis_transform +
+ return (self.get_xaxis_transform(which='tick1') +
 mtransforms.ScaledTranslation(0, -1 * pad_points / 72.0,
 self.figure.dpi_scale_trans),
 "top", "center")
@@ -691,12 +707,12 @@
 overridden by new kinds of projections that may need to
 place axis elements in different locations.
 """
- return (self._xaxis_transform +
+ return (self.get_xaxis_transform(which='tick2') +
 mtransforms.ScaledTranslation(0, pad_points / 72.0,
 self.figure.dpi_scale_trans),
 "bottom", "center")
 
- def get_yaxis_transform(self):
+ def get_yaxis_transform(self,which=None):
 """
 Get the transformation used for drawing y-axis labels, ticks
 and gridlines. The x-direction is in axis coordinates and the
@@ -708,7 +724,16 @@
 overridden by new kinds of projections that may need to
 place axis elements in different locations.
 """
- return self._yaxis_transform
+ if which=='grid':
+ return self._yaxis_transform
+ elif which=='tick1':
+ # for cartesian projection, this is bottom spine
+ return self.spines['left'].get_spine_transform()
+ elif which=='tick2':
+ # for cartesian projection, this is top spine
+ return self.spines['right'].get_spine_transform()
+ else:
+ raise ValueError('unknown value for which')
 
 def get_yaxis_text1_transform(self, pad_points):
 """
@@ -729,7 +754,7 @@
 overridden by new kinds of projections that may need to
 place axis elements in different locations.
 """
- return (self._yaxis_transform +
+ return (self.get_yaxis_transform(which='tick1') +
 mtransforms.ScaledTranslation(-1 * pad_points / 72.0, 0,
 self.figure.dpi_scale_trans),
 "center", "right")
@@ -754,7 +779,7 @@
 overridden by new kinds of projections that may need to
 place axis elements in different locations.
 """
- return (self._yaxis_transform +
+ return (self.get_yaxis_transform(which='tick2') +
 mtransforms.ScaledTranslation(pad_points / 72.0, 0,
 self.figure.dpi_scale_trans),
 "center", "left")
@@ -853,6 +878,29 @@
 """
 return mpatches.Rectangle((0.0, 0.0), 1.0, 1.0)
 
+ def _gen_axes_spines(self, locations=None, offset=0.0, units='inches'):
+ """
+ Returns a dict whose keys are spine names and values are
+ Line2D or Patch instances. Each element is used to draw a
+ spine of the axes.
+
+ In the standard axes, this is a single line segment, but in
+ other projections it may not be.
+
+ .. note::
+ Intended to be overridden by new projection types.
+ """
+ return {
+ 'left':mspines.Spine(self,'left',
+ mlines.Line2D((0.0, 0.0), (0.0, 1.0))),
+ 'right':mspines.Spine(self,'right',
+ mlines.Line2D((1.0, 1.0), (0.0, 1.0))),
+ 'bottom':mspines.Spine(self,'bottom',
+ mlines.Line2D((0.0, 1.0), (0.0, 0.0))),
+ 'top':mspines.Spine(self,'top',
+ mlines.Line2D((0.0, 1.0), (1.0, 1.0))),
+ }
+
 def cla(self):
 'Clear the current axes'
 # Note: this is called by Axes.__init__()
@@ -928,17 +976,6 @@
 self.patch.set_linewidth(0)
 self.patch.set_transform(self.transAxes)
 
- # the frame draws the border around the axes and we want this
- # above. this is a place holder for a more sophisticated
- # artist that might just draw a left, bottom frame, or a
- # centered frame, etc the axesFrame name is deprecated
- self.frame = self.axesFrame = self._gen_axes_patch()
- self.frame.set_figure(self.figure)
- self.frame.set_facecolor('none')
- self.frame.set_edgecolor(rcParams['axes.edgecolor'])
- self.frame.set_linewidth(rcParams['axes.linewidth'])
- self.frame.set_transform(self.transAxes)
- self.frame.set_zorder(2.5)
 self.axison = True
 
 self.xaxis.set_clip_path(self.patch)
@@ -947,6 +984,10 @@
 self._shared_x_axes.clean()
 self._shared_y_axes.clean()
 
+ def get_frame(self):
+ raise AttributeError('Axes.frame was removed in favor of Axes.spines')
+ frame = property(get_frame)
+
 def clear(self):
 'clear the axes'
 self.cla()
@@ -1724,7 +1765,7 @@
 # decouple these so the patch can be in the background and the
 # frame in the foreground.
 if self.axison and self._frameon:
- artists.append(self.frame)
+ artists.extend(self.spines.itervalues())
 
 
 dsu = [ (a.zorder, i, a) for i, a in enumerate(artists)
@@ -2645,7 +2686,7 @@
 children.extend(self.collections)
 children.append(self.title)
 children.append(self.patch)
- children.append(self.frame)
+ children.extend(self.spines.itervalues())
 return children
 
 def contains(self,mouseevent):
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/lib/matplotlib/axis.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -282,7 +282,7 @@
 marker = self._xtickmarkers[0],
 markersize=self._size,
 )
- l.set_transform(self.axes.get_xaxis_transform())
+ l.set_transform(self.axes.get_xaxis_transform(which='tick1'))
 self._set_artist_props(l)
 return l
 
@@ -296,7 +296,7 @@
 markersize=self._size,
 )
 
- l.set_transform(self.axes.get_xaxis_transform())
+ l.set_transform(self.axes.get_xaxis_transform(which='tick2'))
 self._set_artist_props(l)
 return l
 
@@ -308,7 +308,7 @@
 linestyle=rcParams['grid.linestyle'],
 linewidth=rcParams['grid.linewidth'],
 )
- l.set_transform(self.axes.get_xaxis_transform())
+ l.set_transform(self.axes.get_xaxis_transform(which='grid'))
 l.get_path()._interpolation_steps = GRIDLINE_INTERPOLATION_STEPS
 self._set_artist_props(l)
 
@@ -412,7 +412,7 @@
 linestyle = 'None',
 markersize=self._size,
 )
- l.set_transform(self.axes.get_yaxis_transform())
+ l.set_transform(self.axes.get_yaxis_transform(which='tick1'))
 self._set_artist_props(l)
 return l
 
@@ -425,7 +425,7 @@
 markersize=self._size,
 )
 
- l.set_transform(self.axes.get_yaxis_transform())
+ l.set_transform(self.axes.get_yaxis_transform(which='tick2'))
 self._set_artist_props(l)
 return l
 
@@ -438,7 +438,7 @@
 linewidth=rcParams['grid.linewidth'],
 )
 
- l.set_transform(self.axes.get_yaxis_transform())
+ l.set_transform(self.axes.get_yaxis_transform(which='grid'))
 l.get_path()._interpolation_steps = GRIDLINE_INTERPOLATION_STEPS
 self._set_artist_props(l)
 return l
Modified: trunk/matplotlib/lib/matplotlib/projections/geo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/geo.py	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/lib/matplotlib/projections/geo.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -10,6 +10,8 @@
 from matplotlib import cbook
 from matplotlib.patches import Circle
 from matplotlib.path import Path
+import matplotlib.spines as mspines
+import matplotlib.axis as maxis
 from matplotlib.ticker import Formatter, Locator, NullLocator, FixedLocator, NullFormatter
 from matplotlib.transforms import Affine2D, Affine2DBase, Bbox, \
 BboxTransformTo, IdentityTransform, Transform, TransformWrapper
@@ -36,6 +38,14 @@
 
 RESOLUTION = 75
 
+ def _init_axis(self):
+ self.xaxis = maxis.XAxis(self)
+ self.yaxis = maxis.YAxis(self)
+ # Do not register xaxis or yaxis with spines -- as done in
+ # Axes._init_axis() -- until GeoAxes.xaxis.cla() works.
+ # self.spines['geo'].register_axis(self.yaxis)
+ self._update_transScale()
+
 def cla(self):
 Axes.cla(self)
 
@@ -111,7 +121,8 @@
 .scale(0.5 / xscale, 0.5 / yscale) \
 .translate(0.5, 0.5)
 
- def get_xaxis_transform(self):
+ def get_xaxis_transform(self,which=None):
+ assert which in ['tick1','tick2','grid']
 return self._xaxis_transform
 
 def get_xaxis_text1_transform(self, pad):
@@ -120,7 +131,8 @@
 def get_xaxis_text2_transform(self, pad):
 return self._xaxis_text2_transform, 'top', 'center'
 
- def get_yaxis_transform(self):
+ def get_yaxis_transform(self,which=None):
+ assert which in ['tick1','tick2','grid']
 return self._yaxis_transform
 
 def get_yaxis_text1_transform(self, pad):
@@ -132,6 +144,9 @@
 def _gen_axes_patch(self):
 return Circle((0.5, 0.5), 0.5)
 
+ def _gen_axes_spines(self):
+ return {'geo':mspines.Spine(self,'geo',Circle((0.5, 0.5), 0.5))}
+
 def set_yscale(self, *args, **kwargs):
 if args[0] != 'linear':
 raise NotImplementedError
Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py	2009年05月27日 16:24:53 UTC (rev 7143)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -7,12 +7,14 @@
 rcParams = matplotlib.rcParams
 from matplotlib.artist import kwdocd
 from matplotlib.axes import Axes
+import matplotlib.axis as maxis
 from matplotlib import cbook
 from matplotlib.patches import Circle
 from matplotlib.path import Path
 from matplotlib.ticker import Formatter, Locator
 from matplotlib.transforms import Affine2D, Affine2DBase, Bbox, \
 BboxTransformTo, IdentityTransform, Transform, TransformWrapper
+import matplotlib.spines as mspines
 
 class PolarAxes(Axes):
 """
@@ -202,6 +204,16 @@
 self.xaxis.set_ticks_position('none')
 self.yaxis.set_ticks_position('none')
 
+ def _init_axis(self):
+ "move this out of __init__ because non-separable axes don't use it"
+ self.xaxis = maxis.XAxis(self)
+ self.yaxis = maxis.YAxis(self)
+ # Calling polar_axes.xaxis.cla() or polar_axes.xaxis.cla()
+ # results in weird artifacts. Therefore we disable this for
+ # now.
+ # self.spines['polar'].register_axis(self.yaxis)
+ self._update_transScale()
+
 def _set_lim_and_transforms(self):
 self.transAxes = BboxTransformTo(self.bbox)
 
@@ -258,7 +270,8 @@
 self._yaxis_transform
 )
 
- def get_xaxis_transform(self):
+ def get_xaxis_transform(self,which=None):
+ assert which in ['tick1','tick2','grid']
 return self._xaxis_transform
 
 def get_xaxis_text1_transform(self, pad):
@@ -267,7 +280,8 @@
 def get_xaxis_text2_transform(self, pad):
 return self._xaxis_text2_transform, 'center', 'center'
 
- def get_yaxis_transform(self):
+ def get_yaxis_transform(self,which=None):
+ assert which in ['tick1','tick2','grid']
 return self._yaxis_transform
 
 def get_yaxis_text1_transform(self, pad):
@@ -279,6 +293,9 @@
 def _gen_axes_patch(self):
 return Circle((0.5, 0.5), 0.5)
 
+ def _gen_axes_spines(self):
+ return {'polar':mspines.Spine(self,'polar',Circle((0.5, 0.5), 0.5))}
+
 def set_rmax(self, rmax):
 self.viewLim.y0 = 0
 self.viewLim.y1 = rmax
Added: trunk/matplotlib/lib/matplotlib/spines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/spines.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/spines.py	2009年05月27日 16:25:15 UTC (rev 7144)
@@ -0,0 +1,232 @@
+from __future__ import division
+
+import matplotlib
+rcParams = matplotlib.rcParams
+
+import matplotlib.artist as martist
+from matplotlib.artist import allow_rasterization
+import matplotlib.transforms as mtransforms
+import matplotlib.lines as mlines
+import matplotlib.patches as mpatches
+import warnings
+
+class Spine(martist.Artist):
+ """an axis spine -- the line noting the data area boundaries
+
+ Spines are the lines connecting the axis tick marks and noting the
+ boundaries of the data area. They can be placed at arbitrary
+ positions. See function:`~matplotlib.spines.Spine.set_position`
+ for more information.
+
+ The default position is ``('outward',0)``.
+ """
+ def __str__(self):
+ return "Spine"
+
+ def __init__(self,axes,spine_type,artist):
+ """
+ - *axes* : the Axes instance containing the spine
+ - *spine_type* : a string specifying the spine type
+ - *artist* : the artist instance used to draw the spine
+ """
+ martist.Artist.__init__(self)
+ self.axes = axes
+ self.set_figure(self.axes.figure)
+ self.spine_type = spine_type
+ self.artist = artist
+ self.color = rcParams['axes.edgecolor']
+ self.axis = None
+
+ if isinstance(self.artist,mlines.Line2D):
+ self.artist.set_color(self.color)
+ self.artist.set_linewidth(rcParams['axes.linewidth'])
+ elif isinstance(self.artist,mpatches.Patch):
+ self.artist.set_facecolor('none')
+ self.artist.set_edgecolor(self.color)
+ self.artist.set_linewidth(rcParams['axes.linewidth'])
+ self.artist.set_zorder(2.5)
+ self.artist.set_transform(self.axes.transAxes) # default transform
+
+ # Defer initial position determination. (Not much support for
+ # non-rectangular axes is currently implemented, and this lets
+ # them pass through the spines machinery without errors.)
+ self._position = None
+
+ def _ensure_position_is_set(self):
+ if self._position is None:
+ # default position
+ self._position = ('outward',0.0) # in points
+ self.set_position(self._position)
+
+ def register_axis(self,axis):
+ """register an axis
+
+ An axis should be registered with its corresponding spine from
+ the Axes instance. This allows the spine to clear any axis
+ properties when needed.
+ """
+ self.axis = axis
+ if self.axis is not None:
+ self.axis.cla()
+
+ @allow_rasterization
+ def draw(self,renderer):
+ "draw everything that belongs to the spine"
+ if self.color=='none':
+ # don't draw invisible spines
+ return
+ self.artist.draw(renderer)
+
+ def _calc_offset_transform(self):
+ """calculate the offset transform performed by the spine"""
+ self._ensure_position_is_set()
+ position = self._position
+ if isinstance(position,basestring):
+ if position=='center':
+ position = ('axes',0.5)
+ elif position=='zero':
+ position = ('data',0)
+ assert len(position)==2, "position should be 2-tuple"
+ position_type, amount = position
+ assert position_type in ('axes','outward','data')
+ if position_type=='outward':
+ if amount == 0:
+ # short circuit commonest case
+ self._spine_transform = ('identity',mtransforms.IdentityTransform())
+ elif self.spine_type in ['left','right','top','bottom']:
+ offset_vec = {'left':(-1,0),
+ 'right':(1,0),
+ 'bottom':(0,-1),
+ 'top':(0,1),
+ }[self.spine_type]
+ # calculate x and y offset in dots
+ offset_x = amount*offset_vec[0]/ 72.0
+ offset_y = amount*offset_vec[1]/ 72.0
+ self._spine_transform = ('post',
+ mtransforms.ScaledTranslation(offset_x,offset_y,
+ self.figure.dpi_scale_trans))
+ else:
+ warnings.warn('unknown spine type "%s": no spine '
+ 'offset performed'%self.spine_type)
+ self._spine_transform = ('identity',mtransforms.IdentityTransform())
+ elif position_type=='axes':
+ if self.spine_type in ('left','right'):
+ self._spine_transform = ('pre',
+ mtransforms.Affine2D().translate(amount, 0.0))
+ elif self.spine_type in ('bottom','top'):
+ self._spine_transform = ('pre',
+ mtransforms.Affine2D().translate(0.0, amount))
+ else:
+ warnings.warn('unknown spine type "%s": no spine '
+ 'offset performed'%self.spine_type)
+ self._spine_transform = ('identity',mtransforms.IdentityTransform())
+ elif position_type=='data':
+ if self.spine_type in ('left','right'):
+ self._spine_transform = ('data',
+ mtransforms.Affine2D().translate(amount,0))
+ elif self.spine_type in ('bottom','top'):
+ self._spine_transform = ('data',
+ mtransforms.Affine2D().translate(0,amount))
+ else:
+ warnings.warn('unknown spine type "%s": no spine '
+ 'offset performed'%self.spine_type)
+ self._spine_transform = ('identity',mtransforms.IdentityTransform())
+
+ def set_position(self,position):
+ """set the position of the spine
+
+ Spine position is specified by a 2 tuple of (position type,
+ amount). The position types are:
+
+ * 'outward' : place the spine out from the data area by the
+ specified number of points. (Negative values specify placing the
+ spine inward.)
+
+ * 'axes' : place the spine at the specified Axes coordinate (from
+ 0.0-1.0).
+
+ * 'data' : place the spine at the specified data coordinate.
+
+ Additionally, shorthand notations define a special positions:
+
+ * 'center' -> ('axes',0.5)
+ * 'zero' -> ('data', 0.0)
+
+ """
+ if position in ('center','zero'):
+ # special positions
+ pass
+ else:
+ assert len(position)==2, "position should be 'center' or 2-tuple"
+ assert position[0] in ['outward','axes','data']
+ self._position = position
+ self._calc_offset_transform()
+
+ t = self.get_spine_transform()
+ if self.spine_type in ['left','right']:
+ t2 = mtransforms.blended_transform_factory(t,
+ self.axes.transAxes)
+ elif self.spine_type in ['bottom','top']:
+ t2 = mtransforms.blended_transform_factory(self.axes.transAxes,
+ t)
+ self.artist.set_transform(t2)
+
+ if self.axis is not None:
+ self.axis.cla()
+
+ def get_position(self):
+ """get the spine position"""
+ self._ensure_position_is_set()
+ return self._position
+
+ def get_spine_transform(self):
+ """get the spine transform"""
+ self._ensure_position_is_set()
+ what, how = self._spine_transform
+
+ if what == 'data':
+ # special case data based spine locations
+ if self.spine_type in ['left','right']:
+ data_xform = self.axes.transScale + \
+ (how+self.axes.transLimits + self.axes.transAxes)
+ result = mtransforms.blended_transform_factory(
+ data_xform,self.axes.transData)
+ elif self.spine_type in ['top','bottom']:
+ data_xform = self.axes.transScale + \
+ (how+self.axes.transLimits + self.axes.transAxes)
+ result = mtransforms.blended_transform_factory(
+ self.axes.transData,data_xform)
+ else:
+ raise ValueError('unknown spine spine_type: %s'%self.spine_type)
+ return result
+
+ if self.spine_type in ['left','right']:
+ base_transform = self.axes.get_yaxis_transform(which='grid')
+ elif self.spine_type in ['top','bottom']:
+ base_transform = self.axes.get_xaxis_transform(which='grid')
+ else:
+ raise ValueError('unknown spine spine_type: %s'%self.spine_type)
+
+ if what=='identity':
+ return base_transform
+ elif what=='post':
+ return base_transform+how
+ elif what=='pre':
+ return how+base_transform
+ else:
+ raise ValueError("unknown spine_transform type: %s"%what)
+
+ def set_color(self,value):
+ """set the color of the spine artist
+
+ Note: a value of 'none' will cause the artist not to be drawn.
+ """
+ self.color = value
+ if isinstance(self.artist,mlines.Line2D):
+ self.artist.set_color(self.color)
+ elif isinstance(self.artist,mpatches.Patch):
+ self.artist.set_edgecolor(self.color)
+
+ def get_color(self):
+ """get the color of the spine artist"""
+ return self.color
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <as...@us...> - 2009年05月27日 16:24:55
Revision: 7143
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7143&view=rev
Author: astraw
Date: 2009年05月27日 16:24:53 +0000 (2009年5月27日)
Log Message:
-----------
fix typo
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py	2009年05月25日 18:23:25 UTC (rev 7142)
+++ trunk/matplotlib/lib/matplotlib/legend.py	2009年05月27日 16:24:53 UTC (rev 7143)
@@ -305,7 +305,7 @@
 
 
 def _findoffset_best(self, width, height, xdescent, ydescent, renderer):
- "Heper function to locate the legend at its best position"
+ "Helper function to locate the legend at its best position"
 ox, oy = self._find_best_position(width, height, renderer)
 return ox+xdescent, oy+ydescent
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <cm...@us...> - 2009年05月25日 18:23:31
Revision: 7142
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7142&view=rev
Author: cmoad
Date: 2009年05月25日 18:23:25 +0000 (2009年5月25日)
Log Message:
-----------
more win32 build updates
Modified Paths:
--------------
 trunk/matplotlib/release/win32/Makefile
 trunk/matplotlib/release/win32/data/setup.cfg
Modified: trunk/matplotlib/release/win32/Makefile
===================================================================
--- trunk/matplotlib/release/win32/Makefile	2009年05月25日 17:39:45 UTC (rev 7141)
+++ trunk/matplotlib/release/win32/Makefile	2009年05月25日 18:23:25 UTC (rev 7142)
@@ -1,4 +1,4 @@
-PYTHON=python
+PYTHON=C:/Python26/python.exe
 SRCDIR=${PWD}
 ZLIBVERSION=1.2.3
 PNGVERSION=1.2.33
@@ -23,12 +23,14 @@
 	wget http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2
 
 zlib:
+	rm -rf zlib-${ZLIBVERSION}
 	tar xvfz zlib-${ZLIBVERSION}.tar.gz
 	cd zlib-${ZLIBVERSION} &&\
 	./configure &&\
 	make -j3
 
 png: zlib
+	rm -rf libpng-${PNGVERSION}
 	tar xvfj libpng-${PNGVERSION}.tar.bz2
 	cd libpng-${PNGVERSION} &&\
 	export CFLAGS=${CFLAGS} &&\
@@ -38,10 +40,10 @@
 	cp .libs/libpng.a .
 
 freetype:
-	tar xvfj freetype-${FREETYPEVERSION}.tar.bz2 &&\
+	rm -rf freetype-${FREETYPEVERSION}
+	tar xvfj freetype-${FREETYPEVERSION}.tar.bz2
 	cd freetype-${FREETYPEVERSION} &&\
-	export GNUMAKE=mingw32-make &&\
-	./configure --disable-shared &&\
+	GNUMAKE=mingw32-make ./configure --disable-shared &&\
 	cp builds/win32/w32-mingw32.mk config.mk &&\
 	mingw32-make -j3 &&\
 	cp objs/libfreetype.a .
@@ -49,13 +51,12 @@
 dependencies: png freetype
 
 installers:
-	tar xvzf matplotlib-${MPLVERSION}.tar.gz &&\
+	rm -rf matplotlib-${MPLVERSION}
+	tar xvzf matplotlib-${MPLVERSION}.tar.gz
 	cd matplotlib-${MPLVERSION} &&\
 	rm -rf build &&\
 	cp ../data/setup.cfg . &&\
-	export CFLAGS=${CFLAGS} &&\
-	export LDFLAGS=${LDFLAGS} &&\
 	${PYTHON} setup.py build -c mingw32 bdist_wininst &&\
-	${PYTHON) setupegg.py build -c mingw32 bdist_egg
+	${PYTHON} setupegg.py build -c mingw32 bdist_egg
 
 all: fetch_deps dependencies installers
Modified: trunk/matplotlib/release/win32/data/setup.cfg
===================================================================
--- trunk/matplotlib/release/win32/data/setup.cfg	2009年05月25日 17:39:45 UTC (rev 7141)
+++ trunk/matplotlib/release/win32/data/setup.cfg	2009年05月25日 18:23:25 UTC (rev 7142)
@@ -2,7 +2,7 @@
 # build options.
 
 [egg_info]
-tag_svn_revision = 0
+tag_svn_revision = 1
 
 [status]
 # To suppress display of the dependencies and their versions
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2009年05月25日 17:39:51
Revision: 7141
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7141&view=rev
Author: jdh2358
Date: 2009年05月25日 17:39:45 +0000 (2009年5月25日)
Log Message:
-----------
only forward pick events to children with the same axes instance as the pick event inaxes method
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/artist.py
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py	2009年05月25日 17:38:09 UTC (rev 7140)
+++ trunk/matplotlib/lib/matplotlib/artist.py	2009年05月25日 17:39:45 UTC (rev 7141)
@@ -24,13 +24,13 @@
 
 
 
-def allow_rasterization(draw): 
+def allow_rasterization(draw):
 """
 Decorator for Artist.draw method. Provides routines
 that run before and after the draw call. The before and after functions
 are useful for changing artist-dependant renderer attributes or making
 other setup function calls, such as starting and flushing a mixed-mode
- renderer. 
+ renderer.
 """
 def before(artist, renderer):
 if artist.get_rasterized():
@@ -42,7 +42,7 @@
 
 # the axes class has a second argument inframe for its draw method.
 def draw_wrapper(artist, renderer, *kl):
- before(artist, renderer) 
+ before(artist, renderer)
 draw(artist, renderer, *kl)
 after(artist, renderer)
 
@@ -52,8 +52,8 @@
 draw_wrapper.__doc__ = draw.__doc__
 draw_wrapper._supports_rasterization = True
 return draw_wrapper
- 
 
+
 class Artist(object):
 """
 Abstract base class for someone who renders into a
@@ -308,7 +308,10 @@
 
 # Pick children
 for a in self.get_children():
- a.pick(mouseevent)
+ # make sure the event happened in the same axes
+ ax = getattr(a, 'axes', None)
+ if mouseevent.inaxes==ax:
+ a.pick(mouseevent)
 
 def set_picker(self, picker):
 """
@@ -543,16 +546,16 @@
 else:
 gc.set_clip_rectangle(None)
 gc.set_clip_path(None)
- 
+
 def get_rasterized(self):
 return self._rasterized
- 
+
 def set_rasterized(self, rasterized):
 """
 Force rasterized (bitmap) drawing in vector backend output.
- 
+
 Defaults to None, which implies the backend's default behavior
- 
+
 ACCEPTS: [True | False | None]
 """
 if rasterized and not hasattr(self.draw, "_supports_rasterization"):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing results of 90

1 2 3 4 > >> (Page 1 of 4)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /