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
(7) |
2
(14) |
3
(6) |
4
(8) |
5
(6) |
6
(3) |
7
(2) |
8
(22) |
9
(9) |
10
(23) |
11
(14) |
12
(22) |
13
(7) |
14
(3) |
15
(22) |
16
(13) |
17
(18) |
18
(21) |
19
(9) |
20
|
21
(3) |
22
(6) |
23
(5) |
24
|
25
|
26
(3) |
27
|
28
(1) |
29
(11) |
30
(1) |
31
(12) |
|
|
|
From: <js...@us...> - 2008-12-26 23:21:00
|
Revision: 6704 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6704&view=rev Author: jswhit Date: 2008-12-26 23:20:56 +0000 (Fri, 26 Dec 2008) Log Message: ----------- fix defn of llcrnrlon, urcrnrlon for pseudo-cyl projections Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-26 16:36:39 UTC (rev 6703) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-26 23:20:56 UTC (rev 6704) @@ -594,9 +594,9 @@ raise ValueError, 'must specify lon_0 for %s projection' % _projnames[self.projection] if width is not None or height is not None: print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection] - llcrnrlon = -180. + llcrnrlon = lon_0-180. llcrnrlat = -90. - urcrnrlon = 180 + urcrnrlon = lon_0+180 urcrnrlat = 90. self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-12-26 16:36:43
|
Revision: 6703 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6703&view=rev Author: mdboom Date: 2008-12-26 16:36:39 +0000 (Fri, 26 Dec 2008) Log Message: ----------- Document \mathdefault{} and \mathregular{} and the new mathtext.default rcParam. Modified Paths: -------------- trunk/matplotlib/doc/users/mathtext.rst Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008-12-26 16:28:04 UTC (rev 6702) +++ trunk/matplotlib/doc/users/mathtext.rst 2008-12-26 16:36:39 UTC (rev 6703) @@ -144,10 +144,17 @@ Fonts ----- -The default font is *italics* for mathematical symbols. To change -fonts, eg, to write "sin" in a Roman font, enclose the text in a font -command:: +The default font is *italics* for mathematical symbols. +.. note:: + + This default can be changed using the ``mathtext.default`` rcParam. + This is useful, for example, to use the same font as regular + non-math text for math text, by setting it to ``regular``. + +To change fonts, eg, to write "sin" in a Roman font, enclose the text +in a font command:: + r'$s(t) = \mathcal{A}\mathrm{sin}(2 \omega t)$' .. math:: @@ -223,6 +230,12 @@ .. image:: ../_static/stixsans_fontset.png +Additionally, you can use ``\mathdefault{...}`` or its alias +``\mathregular{...}`` to use the font used for regular text outside of +mathtext. There are a number of limitations to this approach, most +notably that far fewer symbols will be available, but it can be useful +to make math expressions blend well with other text in the plot. + Custom fonts ~~~~~~~~~~~~ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2008-12-26 16:28:07
|
Revision: 6702 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6702&view=rev Author: mdboom Date: 2008-12-26 16:28:04 +0000 (Fri, 26 Dec 2008) Log Message: ----------- Merge branch 'mathdefault' Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/rcsetup.py trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/matplotlibrc.template Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-12-23 21:55:45 UTC (rev 6701) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-12-26 16:28:04 UTC (rev 6702) @@ -168,6 +168,7 @@ bf = T.Trait('serif:bold' , mplT.FontconfigPatternHandler()) sf = T.Trait('sans' , mplT.FontconfigPatternHandler()) fontset = T.Trait('cm', 'cm', 'stix', 'stixsans', 'custom') + default = T.Trait(*("rm cal it tt sf bf default bb frak circled scr regular".split())) fallback_to_cm = T.true class axes(TConfig): Modified: trunk/matplotlib/lib/matplotlib/config/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2008-12-23 21:55:45 UTC (rev 6701) +++ trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2008-12-26 16:28:04 UTC (rev 6702) @@ -209,6 +209,9 @@ validate_fontset = ValidateInStrings('fontset', ['cm', 'stix', 'stixsans', 'custom']) +validate_mathtext_default = ValidateInStrings( + 'default', "rm cal it tt sf bf default bb frak circled scr regular".split()) + validate_verbose = ValidateInStrings('verbose',[ 'silent', 'helpful', 'debug', 'debug-annoying', ]) @@ -371,6 +374,7 @@ 'mathtext.bf' : ['serif:bold', validate_font_properties], 'mathtext.sf' : ['sans\-serif', validate_font_properties], 'mathtext.fontset' : ['cm', validate_fontset], + 'mathtext.default' : ['it', validate_mathtext_default], 'mathtext.fallback_to_cm' : [True, validate_bool], 'image.aspect' : ['equal', validate_aspect], # equal, auto, a number Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-23 21:55:45 UTC (rev 6701) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-26 16:28:04 UTC (rev 6702) @@ -403,7 +403,7 @@ *fontX*: one of the TeX font names:: - tt, it, rm, cal, sf, bf or default (non-math) + tt, it, rm, cal, sf, bf or default/regular (non-math) *fontclassX*: TODO @@ -419,7 +419,7 @@ """ *font*: one of the TeX font names:: - tt, it, rm, cal, sf, bf or default (non-math) + tt, it, rm, cal, sf, bf or default/regular (non-math) *font_class*: TODO @@ -543,6 +543,7 @@ filename = findfont(default_font_prop) default_font = self.CachedFont(FT2Font(str(filename))) self._fonts['default'] = default_font + self._fonts['regular'] = default_font def destroy(self): self.glyphd = None @@ -616,7 +617,7 @@ pclt = cached_font.font.get_sfnt_table('pclt') if pclt is None: # Some fonts don't store the xHeight, so we do a poor man's xHeight - metrics = self.get_metrics(font, 'it', 'x', fontsize, dpi) + metrics = self.get_metrics(font, rcParams['mathtext.default'], 'x', fontsize, dpi) return metrics.iceberg xHeight = (pclt['xHeight'] / 64.0) * (fontsize / 12.0) * (dpi / 100.0) return xHeight @@ -936,7 +937,7 @@ elif not doing_sans_conversion: # This will generate a dummy character uniindex = 0x1 - fontname = 'it' + fontname = rcParams['mathtext.default'] # Handle private use area glyphs if (fontname in ('it', 'rm', 'bf') and @@ -1007,6 +1008,7 @@ default_font.fname = filename self.fonts['default'] = default_font + self.fonts['regular'] = default_font self.pswriter = StringIO() def _get_font(self, font): @@ -2064,7 +2066,7 @@ _dropsub_symbols = set(r'''\int \oint'''.split()) - _fontnames = set("rm cal it tt sf bf default bb frak circled scr".split()) + _fontnames = set("rm cal it tt sf bf default bb frak circled scr regular".split()) _function_names = set(""" arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim @@ -2294,7 +2296,7 @@ def _get_font(self): return self._font def _set_font(self, name): - if name in ('it', 'rm', 'bf'): + if name in Parser._fontnames: self.font_class = name self._font = name font = property(_get_font, _set_font) @@ -2336,7 +2338,7 @@ hlist = Hlist(symbols) # We're going into math now, so set font to 'it' self.push_state() - self.get_state().font = 'it' + self.get_state().font = rcParams['mathtext.default'] return [hlist] def _make_space(self, percentage): @@ -2346,7 +2348,7 @@ width = self._em_width_cache.get(key) if width is None: metrics = state.font_output.get_metrics( - state.font, 'it', 'm', state.fontsize, state.dpi) + state.font, rcParams['mathtext.default'], 'm', state.fontsize, state.dpi) width = metrics.advance self._em_width_cache[key] = width return Kern(width * percentage) @@ -2665,7 +2667,7 @@ # Shift so the fraction line sits in the middle of the # equals sign metrics = state.font_output.get_metrics( - state.font, 'it', '=', state.fontsize, state.dpi) + state.font, rcParams['mathtext.default'], '=', state.fontsize, state.dpi) shift = (cden.height - ((metrics.ymax + metrics.ymin) / 2 - thickness * 3.0)) Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-23 21:55:45 UTC (rev 6701) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-26 16:28:04 UTC (rev 6702) @@ -233,6 +233,9 @@ validate_fontset = ValidateInStrings('fontset', ['cm', 'stix', 'stixsans', 'custom']) +validate_mathtext_default = ValidateInStrings( + 'default', "rm cal it tt sf bf default bb frak circled scr regular".split()) + validate_verbose = ValidateInStrings('verbose',[ 'silent', 'helpful', 'debug', 'debug-annoying', ]) @@ -397,6 +400,7 @@ 'mathtext.bf' : ['serif:bold', validate_font_properties], 'mathtext.sf' : ['sans\-serif', validate_font_properties], 'mathtext.fontset' : ['cm', validate_fontset], + 'mathtext.default' : ['it', validate_mathtext_default], 'mathtext.fallback_to_cm' : [True, validate_bool], 'image.aspect' : ['equal', validate_aspect], # equal, auto, a number Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2008-12-23 21:55:45 UTC (rev 6701) +++ trunk/matplotlib/matplotlibrc.template 2008-12-26 16:28:04 UTC (rev 6702) @@ -185,6 +185,11 @@ # fonts when a symbol can not be found in one of # the custom math fonts. +#mathtext.default : it # The default font to use for math. + # Can be any of the LaTeX font names, including + # the special name "regular" for the same font + # used in regular text. + ### AXES # default face and edge color, default tick sizes, # default fontsizes for ticklabels, and so on. See This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-23 23:17:26
|
Revision: 6701 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6701&view=rev Author: jdh2358 Date: 2008-12-23 21:55:45 +0000 (Tue, 23 Dec 2008) Log Message: ----------- fixed a mincnt problem with hexbin Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:54:17 UTC (rev 6700) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 21:55:45 UTC (rev 6701) @@ -5417,7 +5417,7 @@ for i in xrange(nx2): for j in xrange(ny2): vals = lattice2[i,j] - if len(vals): + if len(vals)>mincnt: lattice2[i,j] = reduce_C_function( vals ) else: lattice2[i,j] = np.nan This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-23 19:54:22
|
Revision: 6700 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6700&view=rev Author: jdh2358 Date: 2008-12-23 19:54:17 +0000 (Tue, 23 Dec 2008) Log Message: ----------- added support for mincnt to hexbin Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:49:08 UTC (rev 6699) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:54:17 UTC (rev 6700) @@ -5270,7 +5270,7 @@ Use a linear or log10 scale on the vertical axis. *mincnt*: None | a positive integer - If not None, only display cells with at least *mincnt* + If not None, only display cells with more than *mincnt* number of points in the cell Other keyword arguments controlling color mapping and normalization This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-23 19:49:18
|
Revision: 6699 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6699&view=rev Author: jdh2358 Date: 2008-12-23 19:49:08 +0000 (Tue, 23 Dec 2008) Log Message: ----------- added support for mincnt to hexbin Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/release/osx/Makefile Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 16:06:15 UTC (rev 6698) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:49:08 UTC (rev 6699) @@ -5212,7 +5212,7 @@ xscale = 'linear', yscale = 'linear', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, edgecolors='none', - reduce_C_function = np.mean, + reduce_C_function = np.mean, mincnt=None, **kwargs): """ call signature:: @@ -5221,7 +5221,7 @@ xscale = 'linear', yscale = 'linear', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, edgecolors='none' - reduce_C_function = np.mean, + reduce_C_function = np.mean, mincnt=None, **kwargs) Make a hexagonal binning plot of *x* versus *y*, where *x*, @@ -5269,6 +5269,10 @@ *scale*: [ 'linear' | 'log' ] Use a linear or log10 scale on the vertical axis. + *mincnt*: None | a positive integer + If not None, only display cells with at least *mincnt* + number of points in the cell + Other keyword arguments controlling color mapping and normalization arguments: @@ -5369,6 +5373,8 @@ d1 = (x-ix1)**2 + 3.0 * (y-iy1)**2 d2 = (x-ix2-0.5)**2 + 3.0 * (y-iy2-0.5)**2 bdist = (d1<d2) + if mincnt is None: + mincnt = 0 if C is None: accum = np.zeros(n) @@ -5400,10 +5406,11 @@ else: lattice2[ix2[i], iy2[i]].append( C[i] ) + for i in xrange(nx1): for j in xrange(ny1): vals = lattice1[i,j] - if len(vals): + if len(vals)>mincnt: lattice1[i,j] = reduce_C_function( vals ) else: lattice1[i,j] = np.nan Modified: trunk/matplotlib/release/osx/Makefile =================================================================== --- trunk/matplotlib/release/osx/Makefile 2008-12-23 16:06:15 UTC (rev 6698) +++ trunk/matplotlib/release/osx/Makefile 2008-12-23 19:49:08 UTC (rev 6699) @@ -95,7 +95,7 @@ rm -rf upload &&\ mkdir upload &&\ cp matplotlib-${MPLVERSION}.tar.gz upload/ &&\ - cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-py2.5.egg &&\ + cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-macosx-py2.5.egg &&\ cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py2.5-mpkg.zip&&\ scp upload/* jd...@fr...:uploads/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-23 16:06:19
|
Revision: 6698 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6698&view=rev Author: jdh2358 Date: 2008-12-23 16:06:15 +0000 (Tue, 23 Dec 2008) Log Message: ----------- fixed a bug in the nsorted changes Modified Paths: -------------- trunk/py4science/examples/pyrex/trailstats/ringbufnan.c Modified: trunk/py4science/examples/pyrex/trailstats/ringbufnan.c =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-23 01:06:18 UTC (rev 6697) +++ trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-23 16:06:15 UTC (rev 6698) @@ -376,7 +376,7 @@ rb_ptr = new_ringbuf(nrb); for (i = 0; i < npad; i++) { - nsorted[j*step] = ringbuf_add(rb_ptr, data[i*step]); + nsorted[i*step] = ringbuf_add(rb_ptr, data[i*step]); } for (j=0; j<nd; i++, j++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ry...@us...> - 2008-12-23 01:06:21
|
Revision: 6697 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6697&view=rev Author: ryanmay Date: 2008-12-23 01:06:18 +0000 (Tue, 23 Dec 2008) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/toolkits/basemap/doc/users/installing.rst Modified: trunk/toolkits/basemap/doc/users/installing.rst =================================================================== --- trunk/toolkits/basemap/doc/users/installing.rst 2008-12-22 21:24:21 UTC (rev 6696) +++ trunk/toolkits/basemap/doc/users/installing.rst 2008-12-23 01:06:18 UTC (rev 6697) @@ -36,7 +36,7 @@ C library with python interface for reading ESRI shapefiles. If not present, will be installed with basemap. -`pupnyere <http://pypi.python.org/pypi/pupynere/>`__ +`pupynere <http://pypi.python.org/pypi/pupynere/>`__ Pure python `netCDF <http://www.unidata.ucar.edu/software/netcdf/>`__ reader. Patched version automatically installed with basemap. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-22 21:24:25
|
Revision: 6696 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6696&view=rev Author: jdh2358 Date: 2008-12-22 21:24:21 +0000 (Mon, 22 Dec 2008) Log Message: ----------- default to draw_idle in draw_if_interactive if it is supported Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py trunk/matplotlib/lib/matplotlib/backends/backend_wx.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-12-22 20:13:24 UTC (rev 6695) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-12-22 21:24:21 UTC (rev 6696) @@ -60,7 +60,7 @@ if matplotlib.is_interactive(): figManager = Gcf.get_active() if figManager is not None: - figManager.canvas.draw() + figManager.canvas.draw_idle() def show(mainloop=True): Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-12-22 20:13:24 UTC (rev 6695) +++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-12-22 21:24:21 UTC (rev 6696) @@ -389,7 +389,7 @@ # anim.py requires this if sys.platform=='win32' : self.window.update() else: - self.canvas.draw() + self.canvas.draw_idle() self._shown = True Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-12-22 20:13:24 UTC (rev 6695) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-12-22 21:24:21 UTC (rev 6696) @@ -1306,7 +1306,7 @@ figManager = Gcf.get_active() if figManager is not None: - figManager.canvas.draw() + figManager.canvas.draw_idle() def show(): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2008-12-22 20:13:30
|
Revision: 6695 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6695&view=rev Author: jswhit Date: 2008-12-22 20:13:24 +0000 (Mon, 22 Dec 2008) Log Message: ----------- fix another typo Modified Paths: -------------- trunk/toolkits/basemap/doc/users/installing.rst Modified: trunk/toolkits/basemap/doc/users/installing.rst =================================================================== --- trunk/toolkits/basemap/doc/users/installing.rst 2008-12-22 20:06:24 UTC (rev 6694) +++ trunk/toolkits/basemap/doc/users/installing.rst 2008-12-22 20:13:24 UTC (rev 6695) @@ -38,7 +38,7 @@ `pupnyere <http://pypi.python.org/pypi/pupynere/>`__ Pure python `netCDF <http://www.unidata.ucar.edu/software/netcdf/>`__ - netCDF reader. Patched version automatically installed with basemap. + reader. Patched version automatically installed with basemap. `pydap <http://code.google.com/p/pydap>`__ Pure python `OPeNDAP <http://opendap.org>`__ implementation. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2008-12-22 20:06:29
|
Revision: 6694 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6694&view=rev Author: jswhit Date: 2008-12-22 20:06:24 +0000 (Mon, 22 Dec 2008) Log Message: ----------- use default css, fix typo in installation guide. Modified Paths: -------------- trunk/toolkits/basemap/doc/conf.py trunk/toolkits/basemap/doc/users/installing.rst Modified: trunk/toolkits/basemap/doc/conf.py =================================================================== --- trunk/toolkits/basemap/doc/conf.py 2008-12-22 19:42:46 UTC (rev 6693) +++ trunk/toolkits/basemap/doc/conf.py 2008-12-22 20:06:24 UTC (rev 6694) @@ -80,7 +80,7 @@ # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. -html_style = 'matplotlib.css' +#html_style = 'mpl.css' # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". Modified: trunk/toolkits/basemap/doc/users/installing.rst =================================================================== --- trunk/toolkits/basemap/doc/users/installing.rst 2008-12-22 19:42:46 UTC (rev 6693) +++ trunk/toolkits/basemap/doc/users/installing.rst 2008-12-22 20:06:24 UTC (rev 6694) @@ -38,7 +38,7 @@ `pupnyere <http://pypi.python.org/pypi/pupynere/>`__ Pure python `netCDF <http://www.unidata.ucar.edu/software/netcdf/>`__ - patched version automatically installed with basemap. + netCDF reader. Patched version automatically installed with basemap. `pydap <http://code.google.com/p/pydap>`__ Pure python `OPeNDAP <http://opendap.org>`__ implementation. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2008-12-22 19:42:53
|
Revision: 6693 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6693&view=rev Author: jswhit Date: 2008-12-22 19:42:46 +0000 (Mon, 22 Dec 2008) Log Message: ----------- update install instructions. Modified Paths: -------------- trunk/toolkits/basemap/doc/users/installing.rst Modified: trunk/toolkits/basemap/doc/users/installing.rst =================================================================== --- trunk/toolkits/basemap/doc/users/installing.rst 2008-12-22 16:50:12 UTC (rev 6692) +++ trunk/toolkits/basemap/doc/users/installing.rst 2008-12-22 19:42:46 UTC (rev 6693) @@ -33,12 +33,12 @@ Patched version automatically built into basemap. `pyshapelib <http://intevation.de/pipermail/thuban-devel/2004-May/000184.html>`__ - C library with python interface for reading ESRI shapefiles (automatically - built and installed with basemap). + C library with python interface for reading ESRI shapefiles. + If not present, will be installed with basemap. `pupnyere <http://pypi.python.org/pypi/pupynere/>`__ Pure python `netCDF <http://www.unidata.ucar.edu/software/netcdf/>`__ - interface automatically installed with basemap. + patched version automatically installed with basemap. `pydap <http://code.google.com/p/pydap>`__ Pure python `OPeNDAP <http://opendap.org>`__ implementation. @@ -87,11 +87,11 @@ by running ``from mpl_toolkits.basemap import Basemap`` at the python prompt. - Basemap includes two auxilliary packages, pydap and httplib2. + Basemap includes three auxilliary packages, pydap, pyshapelib httplib2. By default, setup.py checks to see if these are already installed, and if so does not try to overwrite - them. If you get import errors related to either of these two packages, - edit setup.cfg and set pydap and/or httplib2 to True to force + them. If you get import errors related to any of these packages, + edit setup.cfg and set the appropriate entry to True to force installation of the included versions. * To test, cd to the examples directory and run ``python simpletest.py``. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-22 16:50:15
|
Revision: 6692 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6692&view=rev Author: jdh2358 Date: 2008-12-22 16:50:12 +0000 (Mon, 22 Dec 2008) Log Message: ----------- added nsorted attr Modified Paths: -------------- trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi trunk/py4science/examples/pyrex/trailstats/movavg_fast.py trunk/py4science/examples/pyrex/trailstats/movavg_ringbuf.py trunk/py4science/examples/pyrex/trailstats/ringbuf.h trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx trunk/py4science/examples/pyrex/trailstats/ringbuf_demo.py trunk/py4science/examples/pyrex/trailstats/ringbufnan.c Modified: trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi =================================================================== --- trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi 2008-12-22 16:16:58 UTC (rev 6691) +++ trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi 2008-12-22 16:50:12 UTC (rev 6692) @@ -13,7 +13,7 @@ ringbuf_t *new_ringbuf(int N) void zero_ringbuf(ringbuf_t *rb_ptr) void delete_ringbuf(ringbuf_t *rb_ptr) - void ringbuf_add(ringbuf_t *rb_ptr, double d) + int ringbuf_add(ringbuf_t *rb_ptr, double d) double ringbuf_getitem(ringbuf_t *rb_ptr, int i) double ringbuf_min(ringbuf_t *rb_ptr) double ringbuf_max(ringbuf_t *rb_ptr) @@ -29,12 +29,12 @@ double *dstd, double *dmin, double *dmax, - double *dmed, - double *dptile5, - double *dptile95, + double *dmed, + double *dptile5, + double *dptile95, + int *nsorted, int *ng) void c_runstats2(int nrb, int nd, int step, int ofs, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, double *dptile5, - double *dptile95, int *ng) - + double *dmin, double *dmax, double *dmed, double *dptile5, + double *dptile95, int *nsorted, int *ng) Modified: trunk/py4science/examples/pyrex/trailstats/movavg_fast.py =================================================================== --- trunk/py4science/examples/pyrex/trailstats/movavg_fast.py 2008-12-22 16:16:58 UTC (rev 6691) +++ trunk/py4science/examples/pyrex/trailstats/movavg_fast.py 2008-12-22 16:50:12 UTC (rev 6692) @@ -5,10 +5,10 @@ import ringbuf x = numpy.random.rand(10000) -dmean, dstd, dmin, dmax, dmedian, ptile5, ptile95, ng = ringbuf.runstats(x, 30) +dmean, dstd, dmin, dmax, dmedian, ptile5, ptile95, nsorted, ng = ringbuf.runstats(x, 30) r = numpy.rec.fromarrays([dmean, dstd, dmin, dmax, dmedian, ng], - names='dmean,dstd,dmin,dmax,dmedian,ptile5,ptile95,ngood') + names='dmean,dstd,dmin,dmax,dmedian,ptile5,ptile95,nsorted,ngood') Modified: trunk/py4science/examples/pyrex/trailstats/movavg_ringbuf.py =================================================================== --- trunk/py4science/examples/pyrex/trailstats/movavg_ringbuf.py 2008-12-22 16:16:58 UTC (rev 6691) +++ trunk/py4science/examples/pyrex/trailstats/movavg_ringbuf.py 2008-12-22 16:50:12 UTC (rev 6692) @@ -9,8 +9,8 @@ data = [] for thisx in x: - r.add(thisx) - data.append([thisx, r.N_good(), r.min(), r.max(), r.mean(), r.sd()]) + nsorted = r.add(thisx) + data.append([thisx, r.N_good(), nsorted,r.min(), r.max(), r.mean(), r.sd()]) -r = numpy.rec.fromarrays(data,names='x,ngood,min30,max30,mean30,sd30') +r = numpy.rec.fromarrays(data,names='x,ngood,nsorted,min30,max30,mean30,sd30') Modified: trunk/py4science/examples/pyrex/trailstats/ringbuf.h =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbuf.h 2008-12-22 16:16:58 UTC (rev 6691) +++ trunk/py4science/examples/pyrex/trailstats/ringbuf.h 2008-12-22 16:50:12 UTC (rev 6692) @@ -21,7 +21,7 @@ int ringbuf_slice_i(ringbuf_t *rb_ptr, int i); double ringbuf_getitem(ringbuf_t *rb_ptr, int i); -void ringbuf_add(ringbuf_t *rb_ptr, double d); +int ringbuf_add(ringbuf_t *rb_ptr, double d); double ringbuf_min(ringbuf_t *rb_ptr); double ringbuf_max(ringbuf_t *rb_ptr); double ringbuf_median(ringbuf_t *rb_ptr); @@ -33,10 +33,10 @@ double ringbuf_sd(ringbuf_t *rb_ptr); void c_runstats(int nrb, int nd, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *ng); + double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *nsorted, int *ng); void c_runstats2(int nrb, int nd, int step, int ofs, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *ng); + double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *nsorted, int *ng); Modified: trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx 2008-12-22 16:16:58 UTC (rev 6691) +++ trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx 2008-12-22 16:50:12 UTC (rev 6692) @@ -46,7 +46,7 @@ zero_ringbuf(self.rb_ptr) def add(self, d): - ringbuf_add(self.rb_ptr, d) + return ringbuf_add(self.rb_ptr, d) def min(self): return ringbuf_min(self.rb_ptr) @@ -113,10 +113,11 @@ self.records = [] def add(self, d, r): - ringbuf_add(self.rb_ptr, d) + ret = ringbuf_add(self.rb_ptr, d) self.records.append(r) if len(self.records) > self.rb_ptr.N_size: del self.records[0] + return ret def min(self): return ringbuf_min(self.rb_ptr) @@ -170,8 +171,10 @@ cdef c_numpy.ndarray c_dmedian cdef c_numpy.ndarray c_dptile5 cdef c_numpy.ndarray c_dptile95 + cdef c_numpy.ndarray c_nsorted cdef c_numpy.ndarray c_ng + # make sure that the input array is a 1D numpy array of floats. # asarray is used to copy and cast a python sequence or array to # the approriate type, with the advantage that if the data is @@ -193,6 +196,7 @@ dmedian = numpy.empty_like(data) dptile5 = numpy.empty_like(data) dptile95 = numpy.empty_like(data) + nsorted = numpy.empty(data.shape, dtype=numpy.int_) ng = numpy.empty(data.shape, dtype=numpy.int_) # now we have to assign the c_data structures and friends to their @@ -205,8 +209,10 @@ c_dmedian = dmedian c_dptile5 = dptile5 c_dptile95 = dptile95 + c_nsorted = nsorted c_ng = ng + # now we call the function and pass in the c data pointers to the # arrays. The syntax <double *>c_data.data tells pyrex to pass # the numpy data memory block as a pointer to a float array. @@ -218,7 +224,8 @@ <double *>c_dmedian.data, <double *>c_dptile5.data, <double *>c_dptile95.data, + <int *>c_nsorted.data, <int *>c_ng.data) # all done, return the arrays - return dmean, dstd, dmin, dmax, dmedian, dptile5, dptile95, ng + return dmean, dstd, dmin, dmax, dmedian, dptile5, dptile95, nsorted, ng Modified: trunk/py4science/examples/pyrex/trailstats/ringbuf_demo.py =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbuf_demo.py 2008-12-22 16:16:58 UTC (rev 6691) +++ trunk/py4science/examples/pyrex/trailstats/ringbuf_demo.py 2008-12-22 16:50:12 UTC (rev 6692) @@ -1,14 +1,17 @@ """ Example code showin how to use the ringbuf extension code from python """ +import numpy as np import random import ringbuf r = ringbuf.Ringbuf(30) for i in range(100): - r.add(random.random()) - print 'Nadded=%d, Ngood=%d, min=%1.2f, max=%1.2f, mean=%1.2f, std=%1.2f'%( - r.N_added(), r.N_good(), r.min(), r.max(), r.mean(), r.sd()) + val = random.random() + indsorted = r.add(val) + ng = r.N_good() + percentile = indsorted/float(ng) + print 'val=%1.4f, Nadded=%d, Ngood=%d, Nsorted=%d, percentile=%1.4f, min=%1.2f, max=%1.2f, mean=%1.2f, std=%1.2f'%(val, r.N_added(), r.N_good(), indsorted, percentile, r.min(), r.max(), r.mean(), r.sd()) print 'slice', r[:10] Modified: trunk/py4science/examples/pyrex/trailstats/ringbufnan.c =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-22 16:16:58 UTC (rev 6691) +++ trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-22 16:50:12 UTC (rev 6692) @@ -20,7 +20,7 @@ static double NaN = 0.0; -static void sort_ringbuf(ringbuf_t *rb_ptr); +static int sort_ringbuf(ringbuf_t *rb_ptr); static void resum_ringbuf(ringbuf_t *rb_ptr); ringbuf_t *new_ringbuf(int N) @@ -110,19 +110,21 @@ } } -void ringbuf_add(ringbuf_t *rb_ptr, double d) +// return the index into the sorted ring buffer, -1 if no good points +int ringbuf_add(ringbuf_t *rb_ptr, double d) { double d_old; - int i, i_new, good_new, N; + int i, i_new, good_new, N, indsorted; + indsorted = -1; N = rb_ptr->N_size; /* We need this many times. */ i_new = rb_ptr->i_next; /* Save the old value; otherwise, it will be overwritten. */ d_old = rb_ptr->data[rb_ptr->i_oldest]; rb_ptr->data[i_new] = d; good_new = !isnan(d); -#if 1 +#if 0 printf("new value: %lf good_new: %d\n", d, good_new); printf("i_next: %d i_oldest: %d N_filled: %d N_good: %d\n", rb_ptr->i_next, rb_ptr->i_oldest, @@ -174,7 +176,7 @@ { rb_ptr->sum += d; rb_ptr->sumsq += d*d; - sort_ringbuf(rb_ptr); + indsorted = sort_ringbuf(rb_ptr); } /* To prevent accumulation of truncation error, we recalculate the sums periodically. @@ -184,11 +186,12 @@ { resum_ringbuf(rb_ptr); } -#if 1 +#if 0 printf("i_next: %d i_oldest: %d N_filled: %d N_good: %d\n", rb_ptr->i_next, rb_ptr->i_oldest, rb_ptr->N_filled, rb_ptr->N_good); #endif + return indsorted; } /* This is not a full sort--it assumes the list is @@ -196,7 +199,7 @@ pass of bubble sorting to put that entry in its place. The code could be moved bodily into the function above. */ -void sort_ringbuf(ringbuf_t *rb_ptr) +int sort_ringbuf(ringbuf_t *rb_ptr) { int i, i_hold; int *ip; @@ -218,6 +221,7 @@ break; } } + return i; } double ringbuf_min(ringbuf_t *rb_ptr) @@ -325,7 +329,7 @@ } void c_runstats(int nrb, int nd, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *ng) + double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *nsorted, int *ng) { int i, j; ringbuf_t *rb_ptr; @@ -334,7 +338,7 @@ for (j=0; j<nd; i++, j++) { - ringbuf_add(rb_ptr, data[j]); + nsorted[j] = ringbuf_add(rb_ptr, data[j]); dmean[j] = ringbuf_mean(rb_ptr); dstd[j] = ringbuf_sd(rb_ptr); dmin[j] = ringbuf_min(rb_ptr); @@ -342,6 +346,7 @@ dmed[j] = ringbuf_median(rb_ptr); dptile5[j] = ringbuf_ptile(rb_ptr, 0.05); dptile95[j] = ringbuf_ptile(rb_ptr, 0.95); + ng[j] = rb_ptr->N_good; } delete_ringbuf(rb_ptr); @@ -351,7 +356,7 @@ void c_runstats2(int nrb, int nd, int step, int ofs, double *data, double *dmean, double *dstd, double *dmin, double *dmax, double *dmed, double -*dptile5, double *dptile95, int *ng) +*dptile5, double *dptile95, int *nsorted, int *ng) { int i, j; int npad = (nrb - 1) / 2; @@ -365,17 +370,18 @@ dmed += ofs; dptile5 += ofs; dptile95 += ofs; + nsorted += ofs; ng += ofs; rb_ptr = new_ringbuf(nrb); for (i = 0; i < npad; i++) { - ringbuf_add(rb_ptr, data[i*step]); + nsorted[j*step] = ringbuf_add(rb_ptr, data[i*step]); } for (j=0; j<nd; i++, j++) { - if (i < nd) {ringbuf_add(rb_ptr, data[i*step]);} - else {ringbuf_add(rb_ptr, NaN);} + if (i < nd) {nsorted[j*step] = ringbuf_add(rb_ptr, data[i*step]);} + else {nsorted[j*step] = ringbuf_add(rb_ptr, NaN);} dmean[j*step] = ringbuf_mean(rb_ptr); dstd[j*step] = ringbuf_sd(rb_ptr); dmin[j*step] = ringbuf_min(rb_ptr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2008-12-22 16:17:02
|
Revision: 6691 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6691&view=rev Author: jswhit Date: 2008-12-22 16:16:58 +0000 (Mon, 22 Dec 2008) Log Message: ----------- mathpng no longer exists, use mathmpl Modified Paths: -------------- trunk/toolkits/basemap/doc/conf.py Modified: trunk/toolkits/basemap/doc/conf.py =================================================================== --- trunk/toolkits/basemap/doc/conf.py 2008-12-21 04:14:20 UTC (rev 6690) +++ trunk/toolkits/basemap/doc/conf.py 2008-12-22 16:16:58 UTC (rev 6691) @@ -27,7 +27,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['mathpng', 'sphinx.ext.autodoc'] +extensions = ['mathmpl', 'math_symbol_table', 'sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lee...@us...> - 2008-12-21 04:14:24
|
Revision: 6690 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6690&view=rev Author: leejjoon Date: 2008-12-21 04:14:20 +0000 (Sun, 21 Dec 2008) Log Message: ----------- Merged revisions 6688-6689 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6688 | leejjoon | 2008-12-20 22:46:05 -0500 (Sat, 20 Dec 2008) | 1 line fix hatch bug in pdf backend ........ r6689 | leejjoon | 2008-12-20 23:07:26 -0500 (Sat, 20 Dec 2008) | 1 line fix dpi dependent offset of Shadow ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/examples/pylab_examples/hatch_demo.py trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py trunk/matplotlib/lib/matplotlib/patches.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6685 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6689 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-12-21 04:07:26 UTC (rev 6689) +++ trunk/matplotlib/CHANGELOG 2008-12-21 04:14:20 UTC (rev 6690) @@ -1,8 +1,13 @@ +2008-12-20 fix the dpi-dependent offset of Shadow. - JJL + +2008-12-20 fix the hatch bug in the pdf backend. minor update + in docs and example - JJL + 2008-12-19 Add axes_locator attribute in Axes. Two examples are added. - JJL -2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also - updated to describe chages in keyword parameters. +2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also + updated to describe chages in keyword parameters. Issue a warning if old keyword parameters are used. - JJL 2008-12-18 add new arrow style, a line + filled triangles. -JJL Modified: trunk/matplotlib/examples/pylab_examples/hatch_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/hatch_demo.py 2008-12-21 04:07:26 UTC (rev 6689) +++ trunk/matplotlib/examples/pylab_examples/hatch_demo.py 2008-12-21 04:14:20 UTC (rev 6690) @@ -1,18 +1,25 @@ """ -Hatching (pattern filled polygons) is supported currently on PS +Hatching (pattern filled polygons) is supported currently on PS and PDF backend only. See the set_patch method in http://matplotlib.sf.net/matplotlib.patches.html#Patch for details """ -import matplotlib -matplotlib.use('PS') -from pylab import figure +import matplotlib.pyplot as plt -fig = figure() -ax = fig.add_subplot(111) -bars = ax.bar(range(1,5), range(1,5), color='gray', ecolor='black') +fig = plt.figure() +ax1 = fig.add_subplot(121) +ax1.annotate("Hatch is only supported in the PS and PDF backend", (1, 1), + xytext=(0, 5), + xycoords="axes fraction", textcoords="offset points", ha="center" + ) +ax1.bar(range(1,5), range(1,5), color='gray', ecolor='black', hatch="/") + +ax2 = fig.add_subplot(122) +bars = ax2.bar(range(1,5), range(1,5), color='gray', ecolor='black') + patterns = ('/', '+', 'x', '\\') for bar, pattern in zip(bars, patterns): bar.set_hatch(pattern) -fig.savefig('hatch4.ps') + +plt.show() Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-12-21 04:07:26 UTC (rev 6689) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-12-21 04:14:20 UTC (rev 6690) @@ -942,7 +942,7 @@ def hatchPattern(self, lst): pattern = self.hatchPatterns.get(lst, None) if pattern is not None: - return pattern[0] + return pattern name = Name('H%d' % self.nextHatch) self.nextHatch += 1 @@ -1233,7 +1233,7 @@ def get_image_magnification(self): return self.image_dpi/72.0 - + def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): # MGDTODO: Support clippath here gc = self.new_gc() Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-21 04:07:26 UTC (rev 6689) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-21 04:14:20 UTC (rev 6690) @@ -247,12 +247,12 @@ CURRENT LIMITATIONS: - 1. Hatching is supported in the PostScript backend only. + 1. Hatching is supported in the PostScript and the PDF backend only. 2. Hatching is done with solid black lines of width 0. - ACCEPTS: [ '/' | '\\' | '|' | '-' | '#' | 'x' ] + ACCEPTS: [ '/' | '\\' | '|' | '-' | '#' | 'x' ] (ps & pdf backend only) """ self._hatch = h @@ -373,7 +373,7 @@ self.patch = patch self.props = props self._ox, self._oy = ox, oy - self._update_transform() + self._shadow_transform = transforms.Affine2D() self._update() __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd @@ -391,20 +391,20 @@ self.set_facecolor((r,g,b,0.5)) self.set_edgecolor((r,g,b,0.5)) - def _update_transform(self): - self._shadow_transform = transforms.Affine2D().translate(self._ox, self._oy) + def _update_transform(self, renderer): + ox = renderer.points_to_pixels(self._ox) + oy = renderer.points_to_pixels(self._oy) + self._shadow_transform.clear().translate(ox, oy) def _get_ox(self): return self._ox def _set_ox(self, ox): self._ox = ox - self._update_transform() def _get_oy(self): return self._oy def _set_oy(self, oy): self._oy = oy - self._update_transform() def get_path(self): return self.patch.get_path() @@ -412,6 +412,10 @@ def get_patch_transform(self): return self.patch.get_patch_transform() + self._shadow_transform + def draw(self, renderer): + self._update_transform(renderer) + Patch.draw(self, renderer) + class Rectangle(Patch): """ Draw a rectangle with lower left at *xy* = (*x*, *y*) with This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lee...@us...> - 2008-12-21 04:07:28
|
Revision: 6689 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6689&view=rev Author: leejjoon Date: 2008-12-21 04:07:26 +0000 (Sun, 21 Dec 2008) Log Message: ----------- fix dpi dependent offset of Shadow Modified Paths: -------------- branches/v0_98_5_maint/CHANGELOG branches/v0_98_5_maint/lib/matplotlib/patches.py Modified: branches/v0_98_5_maint/CHANGELOG =================================================================== --- branches/v0_98_5_maint/CHANGELOG 2008-12-21 03:46:05 UTC (rev 6688) +++ branches/v0_98_5_maint/CHANGELOG 2008-12-21 04:07:26 UTC (rev 6689) @@ -1,3 +1,5 @@ +2008-12-20 fix the dpi-dependent offset of Shadow. - JJL + 2008-12-20 fix the hatch bug in the pdf backend. minor update in docs and example - JJL Modified: branches/v0_98_5_maint/lib/matplotlib/patches.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/patches.py 2008-12-21 03:46:05 UTC (rev 6688) +++ branches/v0_98_5_maint/lib/matplotlib/patches.py 2008-12-21 04:07:26 UTC (rev 6689) @@ -372,7 +372,7 @@ self.patch = patch self.props = props self._ox, self._oy = ox, oy - self._update_transform() + self._shadow_transform = transforms.Affine2D() self._update() __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd @@ -390,20 +390,20 @@ self.set_facecolor((r,g,b,0.5)) self.set_edgecolor((r,g,b,0.5)) - def _update_transform(self): - self._shadow_transform = transforms.Affine2D().translate(self._ox, self._oy) + def _update_transform(self, renderer): + ox = renderer.points_to_pixels(self._ox) + oy = renderer.points_to_pixels(self._oy) + self._shadow_transform.clear().translate(ox, oy) def _get_ox(self): return self._ox def _set_ox(self, ox): self._ox = ox - self._update_transform() def _get_oy(self): return self._oy def _set_oy(self, oy): self._oy = oy - self._update_transform() def get_path(self): return self.patch.get_path() @@ -411,6 +411,10 @@ def get_patch_transform(self): return self.patch.get_patch_transform() + self._shadow_transform + def draw(self, renderer): + self._update_transform(renderer) + Patch.draw(self, renderer) + class Rectangle(Patch): """ Draw a rectangle with lower left at *xy* = (*x*, *y*) with This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lee...@us...> - 2008-12-21 03:46:09
|
Revision: 6688 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6688&view=rev Author: leejjoon Date: 2008-12-21 03:46:05 +0000 (Sun, 21 Dec 2008) Log Message: ----------- fix hatch bug in pdf backend Modified Paths: -------------- branches/v0_98_5_maint/CHANGELOG branches/v0_98_5_maint/examples/pylab_examples/hatch_demo.py branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py branches/v0_98_5_maint/lib/matplotlib/patches.py Modified: branches/v0_98_5_maint/CHANGELOG =================================================================== --- branches/v0_98_5_maint/CHANGELOG 2008-12-19 22:48:11 UTC (rev 6687) +++ branches/v0_98_5_maint/CHANGELOG 2008-12-21 03:46:05 UTC (rev 6688) @@ -1,5 +1,8 @@ -2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also - updated to describe chages in keyword parameters. +2008-12-20 fix the hatch bug in the pdf backend. minor update + in docs and example - JJL + +2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also + updated to describe chages in keyword parameters. Issue a warning if old keyword parameters are used. - JJL ======================================================================= Modified: branches/v0_98_5_maint/examples/pylab_examples/hatch_demo.py =================================================================== --- branches/v0_98_5_maint/examples/pylab_examples/hatch_demo.py 2008-12-19 22:48:11 UTC (rev 6687) +++ branches/v0_98_5_maint/examples/pylab_examples/hatch_demo.py 2008-12-21 03:46:05 UTC (rev 6688) @@ -1,18 +1,25 @@ """ -Hatching (pattern filled polygons) is supported currently on PS +Hatching (pattern filled polygons) is supported currently on PS and PDF backend only. See the set_patch method in http://matplotlib.sf.net/matplotlib.patches.html#Patch for details """ -import matplotlib -matplotlib.use('PS') -from pylab import figure +import matplotlib.pyplot as plt -fig = figure() -ax = fig.add_subplot(111) -bars = ax.bar(range(1,5), range(1,5), color='gray', ecolor='black') +fig = plt.figure() +ax1 = fig.add_subplot(121) +ax1.annotate("Hatch is only supported in the PS and PDF backend", (1, 1), + xytext=(0, 5), + xycoords="axes fraction", textcoords="offset points", ha="center" + ) +ax1.bar(range(1,5), range(1,5), color='gray', ecolor='black', hatch="/") + +ax2 = fig.add_subplot(122) +bars = ax2.bar(range(1,5), range(1,5), color='gray', ecolor='black') + patterns = ('/', '+', 'x', '\\') for bar, pattern in zip(bars, patterns): bar.set_hatch(pattern) -fig.savefig('hatch4.ps') + +plt.show() Modified: branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py 2008-12-19 22:48:11 UTC (rev 6687) +++ branches/v0_98_5_maint/lib/matplotlib/backends/backend_pdf.py 2008-12-21 03:46:05 UTC (rev 6688) @@ -942,7 +942,7 @@ def hatchPattern(self, lst): pattern = self.hatchPatterns.get(lst, None) if pattern is not None: - return pattern[0] + return pattern name = Name('H%d' % self.nextHatch) self.nextHatch += 1 @@ -1233,7 +1233,7 @@ def get_image_magnification(self): return self.image_dpi/72.0 - + def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): # MGDTODO: Support clippath here gc = self.new_gc() Modified: branches/v0_98_5_maint/lib/matplotlib/patches.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/patches.py 2008-12-19 22:48:11 UTC (rev 6687) +++ branches/v0_98_5_maint/lib/matplotlib/patches.py 2008-12-21 03:46:05 UTC (rev 6688) @@ -247,12 +247,12 @@ CURRENT LIMITATIONS: - 1. Hatching is supported in the PostScript backend only. + 1. Hatching is supported in the PostScript and the PDF backend only. 2. Hatching is done with solid black lines of width 0. - ACCEPTS: [ '/' | '\\' | '|' | '-' | '#' | 'x' ] + ACCEPTS: [ '/' | '\\' | '|' | '-' | '#' | 'x' ] (ps & pdf backend only) """ self._hatch = h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lee...@us...> - 2008-12-19 22:48:15
|
Revision: 6687 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6687&view=rev Author: leejjoon Date: 2008-12-19 22:48:11 +0000 (Fri, 19 Dec 2008) Log Message: ----------- axes_locator in the Axes class Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/axes.py Added Paths: ----------- trunk/matplotlib/examples/pylab_examples/axes_divider.py trunk/matplotlib/examples/pylab_examples/axes_grid.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-12-19 21:41:11 UTC (rev 6686) +++ trunk/matplotlib/CHANGELOG 2008-12-19 22:48:11 UTC (rev 6687) @@ -1,3 +1,6 @@ +2008-12-19 Add axes_locator attribute in Axes. Two examples are added. + - JJL + 2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also updated to describe chages in keyword parameters. Issue a warning if old keyword parameters are used. - JJL Added: trunk/matplotlib/examples/pylab_examples/axes_divider.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/axes_divider.py (rev 0) +++ trunk/matplotlib/examples/pylab_examples/axes_divider.py 2008-12-19 22:48:11 UTC (rev 6687) @@ -0,0 +1,638 @@ + +import matplotlib.axes as maxes +import matplotlib.transforms as mtransforms + +import matplotlib.cbook as cbook + +import new + + +class Size(object): + + @classmethod + def from_any(self, size, fraction_ref=None): + if cbook.is_numlike(size): + return Size.Fixed(size) + elif cbook.is_string_like(size): + if size[-1] == "%": + return Size.Fraction(fraction_ref, float(size[:-1])/100.) + + raise ValueError("") + + + + class _Base(object): + pass + + class Fixed(_Base): + def __init__(self, fixed_size): + self._fixed_size = fixed_size + + def get_size(self, renderer): + rel_size = 0. + abs_size = self._fixed_size + return rel_size, abs_size + + class Scalable(_Base): + def __init__(self, scalable_size): + self._scalable_size = scalable_size + + def get_size(self, renderer): + rel_size = self._scalable_size + abs_size = 0. + return rel_size, abs_size + + + class AxesX(_Base): + def __init__(self, axes, aspect=1.): + self._axes = axes + self._aspect = aspect + + def get_size(self, renderer): + l1, l2 = self._axes.get_xlim() + rel_size = abs(l2-l1)*self._aspect + abs_size = 0. + return rel_size, abs_size + + class AxesY(_Base): + def __init__(self, axes, aspect=1.): + self._axes = axes + self._aspect = aspect + + def get_size(self, renderer): + l1, l2 = self._axes.get_ylim() + rel_size = abs(l2-l1)*self._aspect + abs_size = 0. + return rel_size, abs_size + + + class MaxExtent(_Base): + def __init__(self, artist_list, w_or_h): + self._artist_list = artist_list + + if w_or_h not in ["width", "height"]: + raise ValueError() + + self._w_or_h = w_or_h + + def add_artist(self, a): + self._artist_list.append(a) + + def get_size(self, renderer): + rel_size = 0. + w_list, h_list = [], [] + for a in self._artist_list: + bb = a.get_window_extent(renderer) + w_list.append(bb.width) + h_list.append(bb.height) + dpi = a.get_figure().get_dpi() + if self._w_or_h == "width": + abs_size = max(w_list)/dpi + elif self._w_or_h == "height": + abs_size = max(h_list)/dpi + + return rel_size, abs_size + + class Fraction(_Base): + def __init__(self, size, fraction): + self._size = size + self._fraction = fraction + + def get_size(self, renderer): + r, a = self._size.get_size(renderer) + rel_size = r*self._fraction + abs_size = a*self._fraction + return rel_size, abs_size + + class Padded(_Base): + def __init__(self, size, pad): + self._size = size + self._pad = pad + + def get_size(self, renderer): + r, a = self._size.get_size(renderer) + rel_size = r + abs_size = a + self._pad + return rel_size, abs_size + + + +class AxesLocator(object): + def __init__(self, axes_divider, nx, ny, nx1=None, ny1=None): + + self._axes_divider = axes_divider + + _xrefindex = axes_divider._xrefindex + _yrefindex = axes_divider._yrefindex + + self._nx, self._ny = nx - _xrefindex, ny - _yrefindex + + if nx1 is None: + nx1 = nx+1 + if ny1 is None: + ny1 = ny+1 + + self._nx1 = nx1 - _xrefindex + self._ny1 = ny1 - _yrefindex + + + def __call__(self, axes, renderer): + + _xrefindex = self._axes_divider._xrefindex + _yrefindex = self._axes_divider._yrefindex + + return self._axes_divider.locate(self._nx + _xrefindex, self._ny + _yrefindex, + self._nx1 + _xrefindex, self._ny1 + _yrefindex, + renderer) + + +class Divider(object): + + def __init__(self, fig, pos, horizontal, vertical, aspect=None, anchor="C"): + self._fig = fig + self._pos = pos + self._horizontal = horizontal + self._vertical = vertical + self._anchor = anchor + self._aspect = aspect + self._xrefindex = 0 + self._yrefindex = 0 + + + @staticmethod + def _calc_k(l, total_size, renderer): + + rs_sum, as_sum = 0., 0. + + for s in l: + rs, as = s.get_size(renderer) + rs_sum += rs + as_sum += as + + k = (total_size - as_sum) / rs_sum + return k + + + @staticmethod + def _calc_offsets(l, k, renderer): + + offsets = [0.] + + for s in l: + rs, as = s.get_size(renderer) + offsets.append(offsets[-1] + rs*k + as) + + return offsets + + + def set_position(self, pos): + self._pos = pos + + def get_position(self): + return self._pos + + def set_anchor(self, anchor): + """ + *anchor* + + ===== ============ + value description + ===== ============ + 'C' Center + 'SW' bottom left + 'S' bottom + 'SE' bottom right + 'E' right + 'NE' top right + 'N' top + 'NW' top left + 'W' left + ===== ============ + + """ + if anchor in mtransforms.Bbox.coefs.keys() or len(anchor) == 2: + self._anchor = anchor + else: + raise ValueError('argument must be among %s' % + ', '.join(mtransforms.BBox.coefs.keys())) + + + def set_horizontal(self, h): + self._horizontal = h + + def get_horizontal(self): + return self._horizontal + + def set_vertical(self, v): + self._vertical = v + + def get_vertical(self): + return self._vertical + + + def get_anchor(self): + return self._anchor + + + def set_aspect(self, aspect=False): + """ + *aspect* : True or False + """ + self._aspect = aspect + + def get_aspect(self): + return self._aspect + + + def locate(self, nx, ny, nx1=None, ny1=None, renderer=None): + + + figW,figH = self._fig.get_size_inches() + x, y, w, h = self.get_position() + + k_h = self._calc_k(self._horizontal, figW*w, renderer) + k_v = self._calc_k(self._vertical, figH*h, renderer) + + if self.get_aspect(): + k = min(k_h, k_v) + ox = self._calc_offsets(self._horizontal, k, renderer) + oy = self._calc_offsets(self._vertical, k, renderer) + else: + ox = self._calc_offsets(self._horizontal, k_h, renderer) + oy = self._calc_offsets(self._vertical, k_v, renderer) + + + ww = (ox[-1] - ox[0])/figW + hh = (oy[-1] - oy[0])/figH + pb = mtransforms.Bbox.from_bounds(x, y, w, h) + pb1 = mtransforms.Bbox.from_bounds(x, y, ww, hh) + pb1_anchored = pb1.anchored(self.get_anchor(), pb) + + if nx1 is None: + nx1=nx+1 + if ny1 is None: + ny1=ny+1 + + x0, y0 = pb1_anchored.x0, pb1_anchored.y0 + x1, w1 = x0 + ox[nx]/figW, (ox[nx1] - ox[nx])/figW + y1, h1 = y0 + oy[ny]/figH, (oy[ny1] - oy[ny])/figH + + return mtransforms.Bbox.from_bounds(x1, y1, w1, h1) + + + def new_locator(self, nx, ny, nx1=None, ny1=None): + return AxesLocator(self, nx, ny, nx1, ny1) + + +class SubplotDivider(Divider): + + def __init__(self, fig, *args, **kwargs): + """ + *fig* is a :class:`matplotlib.figure.Figure` instance. + + *args* is the tuple (*numRows*, *numCols*, *plotNum*), where + the array of subplots in the figure has dimensions *numRows*, + *numCols*, and where *plotNum* is the number of the subplot + being created. *plotNum* starts at 1 in the upper left + corner and increases to the right. + + If *numRows* <= *numCols* <= *plotNum* < 10, *args* can be the + decimal integer *numRows* * 100 + *numCols* * 10 + *plotNum*. + """ + + self.figure = fig + + if len(args)==1: + s = str(args[0]) + if len(s) != 3: + raise ValueError('Argument to subplot must be a 3 digits long') + rows, cols, num = map(int, s) + elif len(args)==3: + rows, cols, num = args + else: + raise ValueError( 'Illegal argument to subplot') + + + total = rows*cols + num -= 1 # convert from matlab to python indexing + # ie num in range(0,total) + if num >= total: + raise ValueError( 'Subplot number exceeds total subplots') + self._rows = rows + self._cols = cols + self._num = num + + self.update_params() + + pos = self.figbox.bounds + horizontal = kwargs.pop("horizontal", []) + vertical = kwargs.pop("vertical", []) + aspect = kwargs.pop("aspect", None) + anchor = kwargs.pop("anchor", "C") + + if kwargs: + raise Exception("") + + Divider.__init__(self, fig, pos, horizontal, vertical, + aspect=aspect, anchor=anchor) + + + def get_position(self): + self.update_params() + return self.figbox.bounds + + + def update_params(self): + 'update the subplot position from fig.subplotpars' + + rows = self._rows + cols = self._cols + num = self._num + + pars = self.figure.subplotpars + left = pars.left + right = pars.right + bottom = pars.bottom + top = pars.top + wspace = pars.wspace + hspace = pars.hspace + totWidth = right-left + totHeight = top-bottom + + figH = totHeight/(rows + hspace*(rows-1)) + sepH = hspace*figH + + figW = totWidth/(cols + wspace*(cols-1)) + sepW = wspace*figW + + rowNum, colNum = divmod(num, cols) + + figBottom = top - (rowNum+1)*figH - rowNum*sepH + figLeft = left + colNum*(figW + sepW) + + self.figbox = mtransforms.Bbox.from_bounds(figLeft, figBottom, + figW, figH) + +class AxesDivider(Divider): + + + def __init__(self, axes): + self._axes = axes + self._xref = Size.AxesX(axes) + self._yref = Size.AxesY(axes) + Divider.__init__(self, fig=axes.get_figure(), pos=None, + horizontal=[self._xref], vertical=[self._yref], + aspect=None, anchor="C") + + def new_horizontal(self, size, pad=None, pack_start=False): + + if pad: + if not isinstance(pad, Size._Base): + pad = Size.from_any(pad, + fraction_ref=self._xref) + if pack_start: + self._horizontal.insert(0, pad) + self._xrefindex += 1 + else: + self._horizontal.append(pad) + + if not isinstance(size, Size._Base): + size = Size.from_any(size, + fraction_ref=self._xref) + + if pack_start: + self._horizontal.insert(0, pad) + self._xrefindex += 1 + locator = self.new_locator(nx=0, ny=0) + else: + self._horizontal.append(size) + locator = self.new_locator(nx=len(self._horizontal)-1, ny=0) + + ax = LocatableAxes(self._axes.get_figure(), + self._axes.get_position(original=True)) + locator = self.new_locator(nx=len(self._horizontal)-1, ny=0) + ax.set_axes_locator(locator) + + return ax + + def new_vertical(self, size, pad=None, pack_start=False): + + if pad: + if not isinstance(pad, Size._Base): + pad = Size.from_any(pad, + fraction_ref=self._yref) + if pack_start: + self._vertical.insert(0, pad) + self._yrefindex += 1 + else: + self._vertical.append(pad) + + if not isinstance(size, Size._Base): + size = Size.from_any(size, + fraction_ref=self._yref) + + if pack_start: + self._vertical.insert(0, pad) + self._yrefindex += 1 + locator = self.new_locator(nx=0, ny=0) + else: + self._vertical.append(size) + locator = self.new_locator(nx=0, ny=len(self._vertical)-1) + + ax = LocatableAxes(self._axes.get_figure(), + self._axes.get_position(original=True)) + ax.set_axes_locator(locator) + + return ax + + + def get_aspect(self): + if self._aspect is None: + aspect = self._axes.get_aspect() + if aspect == "auto": + return False + else: + return True + else: + return self._aspect + + def get_position(self): + if self._pos is None: + bbox = self._axes.get_position(original=True) + return bbox.bounds + else: + return self._pos + + def get_anchor(self): + if self._anchor is None: + return self._axes.get_anchor() + else: + return self._anchor + + + +class LocatableAxesBase: + def __init__(self, *kl, **kw): + + self._axes_class.__init__(self, *kl, **kw) + + self._locator = None + self._locator_renderer = None + + def set_axes_locator(self, locator): + self._locator = locator + + def get_axes_locator(self): + return self._locator + + def apply_aspect(self, position=None): + + if self.get_axes_locator() is None: + self._axes_class.apply_apsect(self, position) + else: + pos = self.get_axes_locator()(self, self._locator_renderer) + self._axes_class.apply_aspect(self, position=pos) + + + def draw(self, renderer=None, inframe=False): + + self._locator_renderer = renderer + + self._axes_class.draw(self, renderer, inframe) + + + +_locatableaxes_classes = {} +def locatable_axes_factory(axes_class): + + new_class = _locatableaxes_classes.get(axes_class) + if new_class is None: + new_class = new.classobj("Locatable%s" % (axes_class.__name__), + (LocatableAxesBase, axes_class), + {'_axes_class': axes_class}) + _locatableaxes_classes[axes_class] = new_class + + return new_class + +if hasattr(maxes.Axes, "get_axes_locator"): + LocatableAxes = maxes.Axes +else: + LocatableAxes = locatable_axes_factory(maxes.Axes) + + +def make_axes_locatable(axes): + if not hasattr(axes, "set_axes_locator"): + new_class = locatable_axes_factory(type(axes)) + axes.__class__ = new_class + + divider = AxesDivider(axes) + locator = divider.new_locator(nx=0, ny=0) + axes.set_axes_locator(locator) + + return divider + + +def get_demo_image(): + # prepare image + delta = 0.5 + + extent = (-3,4,-4,3) + import numpy as np + x = np.arange(-3.0, 4.001, delta) + y = np.arange(-4.0, 3.001, delta) + X, Y = np.meshgrid(x, y) + import matplotlib.mlab as mlab + Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) + Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1) + Z = (Z1 - Z2) * 10 + + return Z, extent + +def demo_locatable_axes(): + import matplotlib.pyplot as plt + + fig1 = plt.figure(1, (6, 6)) + fig1.clf() + + ## PLOT 1 + # simple image & colorbar + ax = fig1.add_subplot(2, 2, 1) + + Z, extent = get_demo_image() + + im = ax.imshow(Z, extent=extent, interpolation="nearest") + cb = plt.colorbar(im) + plt.setp(cb.ax.get_yticklabels(), visible=False) + + + ## PLOT 2 + # image and colorbar whose location is adjusted in the drawing time. + # a hard way + + divider = SubplotDivider(fig1, 2, 2, 2, aspect=True) + + # axes for image + ax = LocatableAxes(fig1, divider.get_position()) + + # axes for coloarbar + ax_cb = LocatableAxes(fig1, divider.get_position()) + + h = [Size.AxesX(ax), # main axes + Size.Fixed(0.05), # padding, 0.1 inch + Size.Fixed(0.2), # colorbar, 0.3 inch + ] + + v = [Size.AxesY(ax)] + + divider.set_horizontal(h) + divider.set_vertical(v) + + ax.set_axes_locator(divider.new_locator(nx=0, ny=0)) + ax_cb.set_axes_locator(divider.new_locator(nx=2, ny=0)) + + fig1.add_axes(ax) + fig1.add_axes(ax_cb) + + ax_cb.yaxis.set_ticks_position("right") + + Z, extent = get_demo_image() + + im = ax.imshow(Z, extent=extent, interpolation="nearest") + plt.colorbar(im, cax=ax_cb) + plt.setp(ax_cb.get_yticklabels(), visible=False) + + plt.draw() + #plt.colorbar(im, cax=ax_cb) + + + ## PLOT 3 + # image and colorbar whose location is adjusted in the drawing time. + # a easy way + + ax = fig1.add_subplot(2, 2, 3) + divider = make_axes_locatable(ax) + + ax_cb = divider.new_horizontal(size="5%", pad=0.05) + fig1.add_axes(ax_cb) + + im = ax.imshow(Z, extent=extent, interpolation="nearest") + plt.colorbar(im, cax=ax_cb) + plt.setp(ax_cb.get_yticklabels(), visible=False) + + + ## PLOT 4 + # two images side by sied with fixed padding. + + ax = fig1.add_subplot(2, 2, 4) + divider = make_axes_locatable(ax) + + ax2 = divider.new_horizontal(size="100%", pad=0.05) + fig1.add_axes(ax2) + + ax.imshow(Z, extent=extent, interpolation="nearest") + ax2.imshow(Z, extent=extent, interpolation="nearest") + plt.setp(ax2.get_yticklabels(), visible=False) + plt.draw() + +if __name__ == "__main__": + demo_locatable_axes() Added: trunk/matplotlib/examples/pylab_examples/axes_grid.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/axes_grid.py (rev 0) +++ trunk/matplotlib/examples/pylab_examples/axes_grid.py 2008-12-19 22:48:11 UTC (rev 6687) @@ -0,0 +1,343 @@ +import matplotlib.cbook as cbook + +import matplotlib.pyplot as plt + +from axes_divider import Size, SubplotDivider, LocatableAxes, Divider, get_demo_image + +class AxesGrid(object): + + def __init__(self, fig, rect, + nrows_ncols, + ngrids = None, + direction="row", + axes_pad = 0.02, + axes_class=None, + add_all=True, + share_all=False, + aspect=True, + label_mode="L", + colorbar_mode=None, + colorbar_location="right", + colorbar_pad=None, + colorbar_size="5%", + ): + + self._nrows, self._ncols = nrows_ncols + + if ngrids is None: + ngrids = self._nrows * self._ncols + else: + if (ngrids > self._nrows * self._ncols) or (ngrids <= 0): + raise Exception("") + + self.ngrids = ngrids + + self._axes_pad = axes_pad + + self._colorbar_mode = colorbar_mode + self._colorbar_location = colorbar_location + if colorbar_pad is None: + self._colorbar_pad = axes_pad + else: + self._colorbar_pad = colorbar_pad + + self._colorbar_size = colorbar_size + + if direction not in ["column", "row"]: + raise Exception("") + + self._direction = direction + + + if axes_class is None: + axes_class = LocatableAxes + + + self.axes_all = [] + self.axes_column = [[] for i in range(self._ncols)] + self.axes_row = [[] for i in range(self._nrows)] + + self.cbar_axes = [] + + h = [] + v = [] + if cbook.is_string_like(rect) or cbook.is_numlike(rect): + self._divider = SubplotDivider(fig, rect, horizontal=h, vertical=v, + aspect=aspect) + elif len(rect) == 3: + kw = dict(horizontal=h, vertical=v, aspect=aspect) + self._divider = SubplotDivider(fig, *rect, **kw) + elif len(rect) == 4: + self._divider = Divider(fig, rect, horizontal=h, vertical=v, + aspect=aspect) + else: + raise Exception("") + + + rect = self._divider.get_position() + + # reference axes + self._column_refax = [None for i in range(self._ncols)] + self._row_refax = [None for i in range(self._nrows)] + self._refax = None + + for i in range(self.ngrids): + + col, row = self.get_col_row(i) + + if share_all: + sharex = self._refax + sharey = self._refax + else: + sharex = self._column_refax[col] + sharey = self._row_refax[row] + + ax = axes_class(fig, rect, sharex=sharex, sharey=sharey) + + if share_all: + if self._refax is None: + self._refax = ax + else: + if sharex is None: + self._column_refax[col] = ax + if sharey is None: + self._row_refax[row] = ax + + self.axes_all.append(ax) + self.axes_column[col].append(ax) + self.axes_row[row].append(ax) + + cax = axes_class(fig, rect) + self.cbar_axes.append(cax) + + self.axes_llc = self.axes_column[0][-1] + + self._update_locators() + + if add_all: + for ax in self.axes_all+self.cbar_axes: + fig.add_axes(ax) + + self.set_label_mode(label_mode) + + + def _update_locators(self): + + h = [] + + h_ax_pos = [] + h_cb_pos = [] + for ax in self._column_refax: + if h: h.append(Size.Fixed(self._axes_pad)) + + h_ax_pos.append(len(h)) + + if ax: + sz = Size.AxesX(ax) + else: + sz = Size.AxesX(self.axes_llc) + h.append(sz) + + if self._colorbar_mode == "each" and self._colorbar_location == "right": + h.append(Size.from_any(self._colorbar_pad, sz)) + h_cb_pos.append(len(h)) + h.append(Size.from_any(self._colorbar_size, sz)) + + + v = [] + + v_ax_pos = [] + v_cb_pos = [] + for ax in self._row_refax[::-1]: + if v: v.append(Size.Fixed(self._axes_pad)) + v_ax_pos.append(len(v)) + if ax: + sz = Size.AxesY(ax) + else: + sz = Size.AxesY(self.axes_llc) + v.append(sz) + + + if self._colorbar_mode == "each" and self._colorbar_location == "top": + v.append(Size.from_any(self._colorbar_pad, sz)) + v_cb_pos.append(len(v)) + v.append(Size.from_any(self._colorbar_size, sz)) + + + for i in range(self.ngrids): + col, row = self.get_col_row(i) + #locator = self._divider.new_locator(nx=4*col, ny=2*(self._nrows - row - 1)) + locator = self._divider.new_locator(nx=h_ax_pos[col], + ny=v_ax_pos[self._nrows -1 - row]) + self.axes_all[i].set_axes_locator(locator) + + if self._colorbar_mode == "each": + if self._colorbar_location == "right": + locator = self._divider.new_locator(nx=h_cb_pos[col], + ny=v_ax_pos[self._nrows -1 - row]) + elif self._colorbar_location == "top": + locator = self._divider.new_locator(nx=h_ax_pos[col], + ny=v_cb_pos[self._nrows -1 - row]) + self.cbar_axes[i].set_axes_locator(locator) + + + if self._colorbar_mode == "single": + if self._colorbar_location == "right": + sz = Size.Fraction(Size.AxesX(self.axes_llc), self._nrows) + h.append(Size.from_any(self._colorbar_pad, sz)) + h.append(Size.from_any(self._colorbar_size, sz)) + locator = self._divider.new_locator(nx=-2, ny=0, ny1=-1) + elif self._colorbar_location == "top": + sz = Size.Fraction(Size.AxesY(self.axes_llc), self._ncols) + v.append(Size.from_any(self._colorbar_pad, sz)) + v.append(Size.from_any(self._colorbar_size, sz)) + locator = self._divider.new_locator(nx=0, nx1=-1, ny=-2) + for i in range(self.ngrids): + self.cbar_axes[i].set_visible(False) + self.cbar_axes[0].set_axes_locator(locator) + self.cbar_axes[0].set_visible(True) + elif self._colorbar_mode == "each": + for i in range(self.ngrids): + self.cbar_axes[i].set_visible(True) + else: + for i in range(self.ngrids): + self.cbar_axes[i].set_visible(False) + + self._divider.set_horizontal(h) + self._divider.set_vertical(v) + + + + def get_col_row(self, n): + if self._direction == "column": + col, row = divmod(n, self._nrows) + else: + row, col = divmod(n, self._ncols) + + return col, row + + + def __getitem__(self, i): + return self.axes_all[i] + + + def get_geometry(self): + return self._nrows, self._ncols + + def set_axes_pad(self, axes_pad): + self._axes_pad = axes_pad + + def get_axes_pad(self): + return self._axes_pad + + def set_aspect(self, aspect): + self._divider.set_aspect(aspect) + + def get_aspect(self): + return self._divider.get_aspect() + + def set_label_mode(self, mode): + if mode == "all": + for ax in self.axes_all: + [l.set_visible(True) for l in ax.get_xticklabels()] + [l.set_visible(True) for l in ax.get_yticklabels()] + elif mode == "L": + for ax in self.axes_column[0][:-1]: + [l.set_visible(False) for l in ax.get_xticklabels()] + [l.set_visible(True) for l in ax.get_yticklabels()] + ax = self.axes_column[0][-1] + [l.set_visible(True) for l in ax.get_xticklabels()] + [l.set_visible(True) for l in ax.get_yticklabels()] + for col in self.axes_column[1:]: + for ax in col[:-1]: + [l.set_visible(False) for l in ax.get_xticklabels()] + [l.set_visible(False) for l in ax.get_yticklabels()] + ax = col[-1] + [l.set_visible(True) for l in ax.get_xticklabels()] + [l.set_visible(False) for l in ax.get_yticklabels()] + elif mode == "1": + for ax in self.axes_all: + [l.set_visible(False) for l in ax.get_xticklabels()] + [l.set_visible(False) for l in ax.get_yticklabels()] + ax = self.axes_llc + [l.set_visible(True) for l in ax.get_xticklabels()] + [l.set_visible(True) for l in ax.get_yticklabels()] + + + +if __name__ == "__main__": + F = plt.figure(1, (9, 3.5)) + F.clf() + + F.subplots_adjust(left=0.05, right=0.98) + + grid = AxesGrid(F, 131, # similar to subplot(111) + nrows_ncols = (2, 2), + direction="row", + axes_pad = 0.05, + add_all=True, + label_mode = "1", + ) + + Z, extent = get_demo_image() + plt.ioff() + for i in range(4): + im = grid[i].imshow(Z, extent=extent, interpolation="nearest") + + # This only affects axes in first column and second row as share_all = False. + grid.axes_llc.set_xticks([-2, 0, 2]) + grid.axes_llc.set_yticks([-2, 0, 2]) + plt.ion() + + + grid = AxesGrid(F, 132, # similar to subplot(111) + nrows_ncols = (2, 2), + direction="row", + axes_pad = 0.0, + add_all=True, + share_all=True, + label_mode = "1", + colorbar_mode="single", + ) + + Z, extent = get_demo_image() + plt.ioff() + for i in range(4): + im = grid[i].imshow(Z, extent=extent, interpolation="nearest") + plt.colorbar(im, cax = grid.cbar_axes[0]) + plt.setp(grid.cbar_axes[0].get_yticklabels(), visible=False) + + # This affects all axes as share_all = True. + grid.axes_llc.set_xticks([-2, 0, 2]) + grid.axes_llc.set_yticks([-2, 0, 2]) + + plt.ion() + + + + grid = AxesGrid(F, 133, # similar to subplot(122) + nrows_ncols = (2, 2), + direction="row", + axes_pad = 0.1, + add_all=True, + label_mode = "1", + share_all = True, + colorbar_location="top", + colorbar_mode="each", + colorbar_size="7%", + colorbar_pad="2%", + ) + plt.ioff() + for i in range(4): + im = grid[i].imshow(Z, extent=extent, interpolation="nearest") + plt.colorbar(im, cax = grid.cbar_axes[i], + orientation="horizontal") + grid.cbar_axes[i].xaxis.set_ticks_position("top") + plt.setp(grid.cbar_axes[i].get_xticklabels(), visible=False) + + # This affects all axes as share_all = True. + grid.axes_llc.set_xticks([-2, 0, 2]) + grid.axes_llc.set_yticks([-2, 0, 2]) + + plt.ion() + plt.draw() Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-19 21:41:11 UTC (rev 6686) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-19 22:48:11 UTC (rev 6687) @@ -545,6 +545,8 @@ self.set_navigate(True) self.set_navigate_mode(None) + self._axes_locator = None + if len(kwargs): martist.setp(self, **kwargs) if self.xaxis is not None: @@ -793,6 +795,21 @@ pos = self.get_position(original=True) self.set_position(pos, which='active') + def set_axes_locator(self, locator): + """ + set axes_locator + + ACCEPT : a callable object which takes an axes instance and renderer and + returns a bbox. + """ + self._axes_locator = locator + + def get_axes_locator(self): + """ + return axes_locator + """ + return self._axes_locator + def _set_artist_props(self, a): 'set the boilerplate props for artists added to axes' a.set_figure(self.figure) @@ -1531,7 +1548,12 @@ if not self.get_visible(): return renderer.open_group('axes') - self.apply_aspect() + locator = self.get_axes_locator() + if locator: + pos = locator(self, renderer) + self.apply_aspect(pos) + else: + self.apply_aspect() # the patch draws the background rectangle -- the frame below # will draw the edges This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lee...@us...> - 2008-12-19 22:03:12
|
Revision: 6686 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6686&view=rev Author: leejjoon Date: 2008-12-19 21:41:11 +0000 (Fri, 19 Dec 2008) Log Message: ----------- Merged revisions 6685 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6685 | leejjoon | 2008-12-19 16:24:32 -0500 (Fri, 19 Dec 2008) | 1 line update legend-related document ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/api/api_changes.rst trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/legend.py trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template trunk/matplotlib/lib/matplotlib/rcsetup.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6681 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6685 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/CHANGELOG 2008-12-19 21:41:11 UTC (rev 6686) @@ -1,3 +1,7 @@ +2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also + updated to describe chages in keyword parameters. + Issue a warning if old keyword parameters are used. - JJL + 2008-12-18 add new arrow style, a line + filled triangles. -JJL ================================================================== Modified: trunk/matplotlib/doc/api/api_changes.rst =================================================================== --- trunk/matplotlib/doc/api/api_changes.rst 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/doc/api/api_changes.rst 2008-12-19 21:41:11 UTC (rev 6686) @@ -15,6 +15,22 @@ Changes for 0.98.x ================== +* Following keyword parameters for :class:`matplotlib.label.Label` are now + deprecated and new set of parameters are introduced. The new parameters + are given as a fraction of the font-size. Also, *scatteryoffsets*, + *fancybox* and *columnspacing* are added as keyword parameters. + + ================ ================ + Deprecated New + ================ ================ + pad borderpad + labelsep labelspacing + handlelen handlelength + handlestextsep handletextpad + axespad borderaxespad + ================ ================ + + * Removed the configobj and experiemtnal traits rc support * Modified :func:`matplotlib.mlab.psd`, :func:`matplotlib.mlab.csd`, Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -582,7 +582,15 @@ 'tick.size' : 'tick.major.size', } +_deprecated_ignore_map = { + 'legend.pad' : 'legend.borderpad', + 'legend.labelsep' : 'legend.labelspacing', + 'legend.handlelen' : 'legend.handlelength', + 'legend.handletextsep' : 'legend.handletextpad', + 'legend.axespad' : 'legend.borderaxespad', + } + class RcParams(dict): """ @@ -602,6 +610,10 @@ warnings.warn('%s is deprecated in matplotlibrc. Use %s \ instead.'% (key, alt)) key = alt + elif key in _deprecated_ignore_map: + alt = _deprecated_ignore_map[key] + warnings.warn('%s is deprecated. Use %s instead.'% (key, alt)) + return cval = self.validate[key](val) dict.__setitem__(self, key, cval) except KeyError: @@ -665,6 +677,9 @@ except Exception, msg: warnings.warn('Bad val "%s" on line #%d\n\t"%s"\n\tin file \ "%s"\n\t%s' % (val, cnt, line, fname, msg)) + elif key in _deprecated_ignore_map: + warnings.warn('%s is deprecated. Update your matplotlibrc to use %s instead.'% (key, _deprecated_ignore_map[key])) + else: print >> sys.stderr, """ Bad key "%s" on line %d in Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -3740,10 +3740,6 @@ A :class:`matplotlib.font_manager.FontProperties` instance, or *None* to use rc settings. - *pad*: [ None | scalar ] - The fractional whitespace inside the legend border, between 0 and 1. - If *None*, use rc settings. - *markerscale*: [ None | scalar ] The relative size of legend markers vs. original. If *None*, use rc settings. @@ -3751,21 +3747,21 @@ *shadow*: [ None | False | True ] If *True*, draw a shadow behind legend. If *None*, use rc settings. - *labelsep*: [ None | scalar ] - The vertical space between the legend entries. If *None*, use rc - settings. + Padding and spacing between various elements use following keywords + parameters. The dimensions of these values are given as a fraction + of the fontsize. Values from rcParams will be used if None. - *handlelen*: [ None | scalar ] - The length of the legend lines. If *None*, use rc settings. + ================ ================================================================== + Keyword Description + ================ ================================================================== + borderpad the fractional whitespace inside the legend border + labelspacing the vertical space between the legend entries + handlelength the length of the legend handles + handletextpad the pad between the legend handle and text + borderaxespad the pad between the axes and legend border + columnspacing the spacing between columns + ================ ================================================================== - *handletextsep*: [ None | scalar ] - The space between the legend line and legend text. If *None*, use rc - settings. - - *axespad*: [ None | scalar ] - The border between the axes and legend edge. If *None*, use rc - settings. - **Example:** .. plot:: mpl_examples/api/legend_demo.py Modified: trunk/matplotlib/lib/matplotlib/legend.py =================================================================== --- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -98,7 +98,7 @@ handletextsep = None, # deprecated; use handletextpad axespad = None, # deprecated; use borderaxespad - # spacing & pad defined as a fractionof the font-size + # spacing & pad defined as a fraction of the font-size borderpad = None, # the whitespace inside the legend border labelspacing=None, #the vertical space between the legend entries handlelength=None, # the length of the legend handles Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.template 2008-12-19 21:41:11 UTC (rev 6686) @@ -233,19 +233,11 @@ origin = 'upper' [legend] - # a float - axespad = 0.02 # a float or 'xx-small' or 'x-small' or 'small' or 'medium' or 'large' or # 'x-large' or 'xx-large' fontsize = 'medium' - # a float - handlelen = 0.050000000000000003 - # a float - handletextsep = 0.02 # a boolean isaxes = True - # a float - labelsep = 0.01 # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' # or 'right' or 'center left' or 'center right' or 'lower center' or # 'upper center' or 'center' @@ -254,11 +246,22 @@ markerscale = 1.0 # an integer numpoints = 3 - # a float - pad = 0.20000000000000001 # a boolean shadow = False + # float + borderpad = 0.4 + # float + labelspacing = 0.5 + # float + handlelength = 2. + # float + handletextpad = 0.8 + # float + borderaxespad = 0.5 + # float + columnspacing = 2. + [lines] # a boolean antialiased = True Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-19 21:24:32 UTC (rev 6685) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-19 21:41:11 UTC (rev 6686) @@ -432,18 +432,12 @@ 'legend.isaxes' : [True,validate_bool], # this option is internally ignored - it never served any useful purpose 'legend.numpoints' : [2, validate_int], # the number of points in the legend line 'legend.fontsize' : ['large', validate_fontsize], - 'legend.pad' : [0, validate_float], # was 0.2, deprecated; the fractional whitespace inside the legend border - 'legend.borderpad' : [0.4, validate_float], # units are fontsize 'legend.markerscale' : [1.0, validate_float], # the relative size of legend markers vs. original - - # the following dimensions are in axes coords - 'legend.labelsep' : [0.010, validate_float], # the vertical space between the legend entries - 'legend.handlelen' : [0.05, validate_float], # the length of the legend lines - 'legend.handletextsep' : [0.02, validate_float], # the space between the legend line and legend text - 'legend.axespad' : [0.02, validate_float], # the border between the axes and legend edge 'legend.shadow' : [False, validate_bool], + # the following dimensions are in fraction of the font size + 'legend.borderpad' : [0.4, validate_float], # units are fontsize 'legend.labelspacing' : [0.5, validate_float], # the vertical space between the legend entries 'legend.handlelength' : [2., validate_float], # the length of the legend lines 'legend.handletextpad' : [.8, validate_float], # the space between the legend line and legend text @@ -453,11 +447,6 @@ 'legend.markerscale' : [1.0, validate_float], # the relative size of legend markers vs. original - # the following dimensions are in axes coords - 'legend.labelsep' : [0.010, validate_float], # the vertical space between the legend entries - 'legend.handlelen' : [0.05, validate_float], # the length of the legend lines - 'legend.handletextsep' : [0.02, validate_float], # the space between the legend line and legend text - 'legend.axespad' : [0.5, validate_float], # the border between the axes and legend edge 'legend.shadow' : [False, validate_bool], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lee...@us...> - 2008-12-19 21:24:41
|
Revision: 6685 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6685&view=rev Author: leejjoon Date: 2008-12-19 21:24:32 +0000 (Fri, 19 Dec 2008) Log Message: ----------- update legend-related document Modified Paths: -------------- branches/v0_98_5_maint/CHANGELOG branches/v0_98_5_maint/doc/api/api_changes.rst branches/v0_98_5_maint/lib/matplotlib/__init__.py branches/v0_98_5_maint/lib/matplotlib/axes.py branches/v0_98_5_maint/lib/matplotlib/legend.py branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template branches/v0_98_5_maint/lib/matplotlib/rcsetup.py Modified: branches/v0_98_5_maint/CHANGELOG =================================================================== --- branches/v0_98_5_maint/CHANGELOG 2008-12-19 20:27:18 UTC (rev 6684) +++ branches/v0_98_5_maint/CHANGELOG 2008-12-19 21:24:32 UTC (rev 6685) @@ -1,3 +1,6 @@ +2008-12-19 Update Axes.legend documnetation. /api/api_changes.rst is also + updated to describe chages in keyword parameters. + Issue a warning if old keyword parameters are used. - JJL ======================================================================= Re-Released 0.98.5.2 at r6679 Modified: branches/v0_98_5_maint/doc/api/api_changes.rst =================================================================== --- branches/v0_98_5_maint/doc/api/api_changes.rst 2008-12-19 20:27:18 UTC (rev 6684) +++ branches/v0_98_5_maint/doc/api/api_changes.rst 2008-12-19 21:24:32 UTC (rev 6685) @@ -8,6 +8,22 @@ Changes for 0.98.x ================== +* Following keyword parameters for :class:`matplotlib.label.Label` are now + deprecated and new set of parameters are introduced. The new parameters + are given as a fraction of the font-size. Also, *scatteryoffsets*, + *fancybox* and *columnspacing* are added as keyword parameters. + + ================ ================ + Deprecated New + ================ ================ + pad borderpad + labelsep labelspacing + handlelen handlelength + handlestextsep handletextpad + axespad borderaxespad + ================ ================ + + * Removed the configobj and experiemtnal traits rc support * Modified :func:`matplotlib.mlab.psd`, :func:`matplotlib.mlab.csd`, Modified: branches/v0_98_5_maint/lib/matplotlib/__init__.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/__init__.py 2008-12-19 20:27:18 UTC (rev 6684) +++ branches/v0_98_5_maint/lib/matplotlib/__init__.py 2008-12-19 21:24:32 UTC (rev 6685) @@ -582,7 +582,15 @@ 'tick.size' : 'tick.major.size', } +_deprecated_ignore_map = { + 'legend.pad' : 'legend.borderpad', + 'legend.labelsep' : 'legend.labelspacing', + 'legend.handlelen' : 'legend.handlelength', + 'legend.handletextsep' : 'legend.handletextpad', + 'legend.axespad' : 'legend.borderaxespad', + } + class RcParams(dict): """ @@ -602,6 +610,10 @@ warnings.warn('%s is deprecated in matplotlibrc. Use %s \ instead.'% (key, alt)) key = alt + elif key in _deprecated_ignore_map: + alt = _deprecated_ignore_map[key] + warnings.warn('%s is deprecated. Use %s instead.'% (key, alt)) + return cval = self.validate[key](val) dict.__setitem__(self, key, cval) except KeyError: @@ -665,6 +677,9 @@ except Exception, msg: warnings.warn('Bad val "%s" on line #%d\n\t"%s"\n\tin file \ "%s"\n\t%s' % (val, cnt, line, fname, msg)) + elif key in _deprecated_ignore_map: + warnings.warn('%s is deprecated. Update your matplotlibrc to use %s instead.'% (key, _deprecated_ignore_map[key])) + else: print >> sys.stderr, """ Bad key "%s" on line %d in Modified: branches/v0_98_5_maint/lib/matplotlib/axes.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/axes.py 2008-12-19 20:27:18 UTC (rev 6684) +++ branches/v0_98_5_maint/lib/matplotlib/axes.py 2008-12-19 21:24:32 UTC (rev 6685) @@ -3728,10 +3728,6 @@ A :class:`matplotlib.font_manager.FontProperties` instance, or *None* to use rc settings. - *pad*: [ None | scalar ] - The fractional whitespace inside the legend border, between 0 and 1. - If *None*, use rc settings. - *markerscale*: [ None | scalar ] The relative size of legend markers vs. original. If *None*, use rc settings. @@ -3739,21 +3735,21 @@ *shadow*: [ None | False | True ] If *True*, draw a shadow behind legend. If *None*, use rc settings. - *labelsep*: [ None | scalar ] - The vertical space between the legend entries. If *None*, use rc - settings. + Padding and spacing between various elements use following keywords + parameters. The dimensions of these values are given as a fraction + of the fontsize. Values from rcParams will be used if None. - *handlelen*: [ None | scalar ] - The length of the legend lines. If *None*, use rc settings. + ================ ================================================================== + Keyword Description + ================ ================================================================== + borderpad the fractional whitespace inside the legend border + labelspacing the vertical space between the legend entries + handlelength the length of the legend handles + handletextpad the pad between the legend handle and text + borderaxespad the pad between the axes and legend border + columnspacing the spacing between columns + ================ ================================================================== - *handletextsep*: [ None | scalar ] - The space between the legend line and legend text. If *None*, use rc - settings. - - *axespad*: [ None | scalar ] - The border between the axes and legend edge. If *None*, use rc - settings. - **Example:** .. plot:: mpl_examples/api/legend_demo.py Modified: branches/v0_98_5_maint/lib/matplotlib/legend.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/legend.py 2008-12-19 20:27:18 UTC (rev 6684) +++ branches/v0_98_5_maint/lib/matplotlib/legend.py 2008-12-19 21:24:32 UTC (rev 6685) @@ -98,7 +98,7 @@ handletextsep = None, # deprecated; use handletextpad axespad = None, # deprecated; use borderaxespad - # spacing & pad defined as a fractionof the font-size + # spacing & pad defined as a fraction of the font-size borderpad = None, # the whitespace inside the legend border labelspacing=None, #the vertical space between the legend entries handlelength=None, # the length of the legend handles Modified: branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template 2008-12-19 20:27:18 UTC (rev 6684) +++ branches/v0_98_5_maint/lib/matplotlib/mpl-data/matplotlib.conf.template 2008-12-19 21:24:32 UTC (rev 6685) @@ -233,19 +233,11 @@ origin = 'upper' [legend] - # a float - axespad = 0.02 # a float or 'xx-small' or 'x-small' or 'small' or 'medium' or 'large' or # 'x-large' or 'xx-large' fontsize = 'medium' - # a float - handlelen = 0.050000000000000003 - # a float - handletextsep = 0.02 # a boolean isaxes = True - # a float - labelsep = 0.01 # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' # or 'right' or 'center left' or 'center right' or 'lower center' or # 'upper center' or 'center' @@ -254,11 +246,22 @@ markerscale = 1.0 # an integer numpoints = 3 - # a float - pad = 0.20000000000000001 # a boolean shadow = False + # float + borderpad = 0.4 + # float + labelspacing = 0.5 + # float + handlelength = 2. + # float + handletextpad = 0.8 + # float + borderaxespad = 0.5 + # float + columnspacing = 2. + [lines] # a boolean antialiased = True Modified: branches/v0_98_5_maint/lib/matplotlib/rcsetup.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/rcsetup.py 2008-12-19 20:27:18 UTC (rev 6684) +++ branches/v0_98_5_maint/lib/matplotlib/rcsetup.py 2008-12-19 21:24:32 UTC (rev 6685) @@ -422,18 +422,12 @@ 'legend.isaxes' : [True,validate_bool], # this option is internally ignored - it never served any useful purpose 'legend.numpoints' : [2, validate_int], # the number of points in the legend line 'legend.fontsize' : ['large', validate_fontsize], - 'legend.pad' : [0, validate_float], # was 0.2, deprecated; the fractional whitespace inside the legend border - 'legend.borderpad' : [0.4, validate_float], # units are fontsize 'legend.markerscale' : [1.0, validate_float], # the relative size of legend markers vs. original - - # the following dimensions are in axes coords - 'legend.labelsep' : [0.010, validate_float], # the vertical space between the legend entries - 'legend.handlelen' : [0.05, validate_float], # the length of the legend lines - 'legend.handletextsep' : [0.02, validate_float], # the space between the legend line and legend text - 'legend.axespad' : [0.02, validate_float], # the border between the axes and legend edge 'legend.shadow' : [False, validate_bool], + # the following dimensions are in fraction of the font size + 'legend.borderpad' : [0.4, validate_float], # units are fontsize 'legend.labelspacing' : [0.5, validate_float], # the vertical space between the legend entries 'legend.handlelength' : [2., validate_float], # the length of the legend lines 'legend.handletextpad' : [.8, validate_float], # the space between the legend line and legend text @@ -443,11 +437,6 @@ 'legend.markerscale' : [1.0, validate_float], # the relative size of legend markers vs. original - # the following dimensions are in axes coords - 'legend.labelsep' : [0.010, validate_float], # the vertical space between the legend entries - 'legend.handlelen' : [0.05, validate_float], # the length of the legend lines - 'legend.handletextsep' : [0.02, validate_float], # the space between the legend line and legend text - 'legend.axespad' : [0.5, validate_float], # the border between the axes and legend edge 'legend.shadow' : [False, validate_bool], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-19 20:27:23
|
Revision: 6684 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6684&view=rev Author: jdh2358 Date: 2008-12-19 20:27:18 +0000 (Fri, 19 Dec 2008) Log Message: ----------- added ringbuf license Modified Paths: -------------- trunk/py4science/examples/pyrex/trailstats/ringbuf.h trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx trunk/py4science/examples/pyrex/trailstats/ringbufnan.c Added Paths: ----------- trunk/py4science/examples/pyrex/trailstats/LICENSE.ringbuf Added: trunk/py4science/examples/pyrex/trailstats/LICENSE.ringbuf =================================================================== --- trunk/py4science/examples/pyrex/trailstats/LICENSE.ringbuf (rev 0) +++ trunk/py4science/examples/pyrex/trailstats/LICENSE.ringbuf 2008-12-19 20:27:18 UTC (rev 6684) @@ -0,0 +1,32 @@ +Copyright (c) 2008, Eric Firing +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the copyright holder nor the names of + subsequent contributors may be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + Modified: trunk/py4science/examples/pyrex/trailstats/ringbuf.h =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbuf.h 2008-12-19 19:31:23 UTC (rev 6683) +++ trunk/py4science/examples/pyrex/trailstats/ringbuf.h 2008-12-19 20:27:18 UTC (rev 6684) @@ -1,5 +1,5 @@ +//See LICENSE.ringbuf for license (BSD) - typedef struct { int N_size; int N_filled; Modified: trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx 2008-12-19 19:31:23 UTC (rev 6683) +++ trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx 2008-12-19 20:27:18 UTC (rev 6684) @@ -3,6 +3,8 @@ Ringbuf, on which various statistics are calculated as each entry is added and a method runstats for computing a host of trailing statistics over a numpy array + +See LICENSE.ringbuf for license (BSD) """ include "c_ringbuf.pxi" Modified: trunk/py4science/examples/pyrex/trailstats/ringbufnan.c =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-19 19:31:23 UTC (rev 6683) +++ trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-19 20:27:18 UTC (rev 6684) @@ -10,6 +10,7 @@ 2003/07/28 EF +See LICENSE.ringbuf for license (BSD) */ #include <stdlib.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-19 19:31:29
|
Revision: 6683 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6683&view=rev Author: jdh2358 Date: 2008-12-19 19:31:23 +0000 (Fri, 19 Dec 2008) Log Message: ----------- fixed a min/max bug when initial values all nan Modified Paths: -------------- trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi trunk/py4science/examples/pyrex/trailstats/movavg_fast.py trunk/py4science/examples/pyrex/trailstats/ringbuf.h trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx trunk/py4science/examples/pyrex/trailstats/ringbufnan.c trunk/py4science/examples/pyrex/trailstats/setup.py Modified: trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi =================================================================== --- trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi 2008-12-19 12:40:09 UTC (rev 6682) +++ trunk/py4science/examples/pyrex/trailstats/c_ringbuf.pxi 2008-12-19 19:31:23 UTC (rev 6683) @@ -18,6 +18,7 @@ double ringbuf_min(ringbuf_t *rb_ptr) double ringbuf_max(ringbuf_t *rb_ptr) double ringbuf_median(ringbuf_t *rb_ptr) + double ringbuf_ptile(ringbuf_t *rb_ptr, double x) int ringbuf_N_good(ringbuf_t *rb_ptr) int ringbuf_N_added(ringbuf_t *rb_ptr) int ringbuf_N_filled(ringbuf_t *rb_ptr) @@ -28,8 +29,12 @@ double *dstd, double *dmin, double *dmax, - double *dmed, int *ng) + double *dmed, + double *dptile5, + double *dptile95, + int *ng) void c_runstats2(int nrb, int nd, int step, int ofs, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, int *ng) + double *dmin, double *dmax, double *dmed, double *dptile5, + double *dptile95, int *ng) Modified: trunk/py4science/examples/pyrex/trailstats/movavg_fast.py =================================================================== --- trunk/py4science/examples/pyrex/trailstats/movavg_fast.py 2008-12-19 12:40:09 UTC (rev 6682) +++ trunk/py4science/examples/pyrex/trailstats/movavg_fast.py 2008-12-19 19:31:23 UTC (rev 6683) @@ -5,10 +5,10 @@ import ringbuf x = numpy.random.rand(10000) -dmean, dstd, dmin, dmax, dmedian, ng = ringbuf.runstats(x, 30) +dmean, dstd, dmin, dmax, dmedian, ptile5, ptile95, ng = ringbuf.runstats(x, 30) r = numpy.rec.fromarrays([dmean, dstd, dmin, dmax, dmedian, ng], - names='dmean,dstd,dmin,dmax,dmedian,ngood') + names='dmean,dstd,dmin,dmax,dmedian,ptile5,ptile95,ngood') Modified: trunk/py4science/examples/pyrex/trailstats/ringbuf.h =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbuf.h 2008-12-19 12:40:09 UTC (rev 6682) +++ trunk/py4science/examples/pyrex/trailstats/ringbuf.h 2008-12-19 19:31:23 UTC (rev 6683) @@ -25,6 +25,7 @@ double ringbuf_min(ringbuf_t *rb_ptr); double ringbuf_max(ringbuf_t *rb_ptr); double ringbuf_median(ringbuf_t *rb_ptr); +double ringbuf_ptile(ringbuf_t *rb_ptr, double val); int ringbuf_N_added(ringbuf_t *rb_ptr); int ringbuf_N_filled(ringbuf_t *rb_ptr); int ringbuf_N_good(ringbuf_t *rb_ptr); @@ -32,10 +33,10 @@ double ringbuf_sd(ringbuf_t *rb_ptr); void c_runstats(int nrb, int nd, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, int *ng); + double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *ng); void c_runstats2(int nrb, int nd, int step, int ofs, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, int *ng); + double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *ng); Modified: trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx 2008-12-19 12:40:09 UTC (rev 6682) +++ trunk/py4science/examples/pyrex/trailstats/ringbuf.pyx 2008-12-19 19:31:23 UTC (rev 6683) @@ -14,7 +14,7 @@ cdef class Ringbuf: cdef ringbuf_t *rb_ptr - def __new__(self, N): + def __cinit__(self, N): self.rb_ptr = new_ringbuf(N) def __dealloc__(self): @@ -55,6 +55,9 @@ def median(self): return ringbuf_median(self.rb_ptr) + def ptile(self, x): + return ringbuf_ptile(self.rb_ptr, x) + def N_added(self): return ringbuf_N_added(self.rb_ptr) @@ -73,7 +76,7 @@ cdef object records - def __new__(self, N): + def __cinit__(self, N): self.rb_ptr = new_ringbuf(N) self.records = [] @@ -122,6 +125,9 @@ def median(self): return ringbuf_median(self.rb_ptr) + def ptile(self, x): + return ringbuf_ptile(self.rb_ptr, x) + def N_added(self): return ringbuf_N_added(self.rb_ptr) @@ -160,6 +166,8 @@ cdef c_numpy.ndarray c_dmin cdef c_numpy.ndarray c_dmax cdef c_numpy.ndarray c_dmedian + cdef c_numpy.ndarray c_dptile5 + cdef c_numpy.ndarray c_dptile95 cdef c_numpy.ndarray c_ng # make sure that the input array is a 1D numpy array of floats. @@ -181,6 +189,8 @@ dmin = numpy.empty_like(data) dmax = numpy.empty_like(data) dmedian = numpy.empty_like(data) + dptile5 = numpy.empty_like(data) + dptile95 = numpy.empty_like(data) ng = numpy.empty(data.shape, dtype=numpy.int_) # now we have to assign the c_data structures and friends to their @@ -191,6 +201,8 @@ c_dmin = dmin c_dmax = dmax c_dmedian = dmedian + c_dptile5 = dptile5 + c_dptile95 = dptile95 c_ng = ng # now we call the function and pass in the c data pointers to the @@ -202,7 +214,9 @@ <double *>c_dmin.data, <double *>c_dmax.data, <double *>c_dmedian.data, + <double *>c_dptile5.data, + <double *>c_dptile95.data, <int *>c_ng.data) # all done, return the arrays - return dmean, dstd, dmin, dmax, dmedian, ng + return dmean, dstd, dmin, dmax, dmedian, dptile5, dptile95, ng Modified: trunk/py4science/examples/pyrex/trailstats/ringbufnan.c =================================================================== --- trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-19 12:40:09 UTC (rev 6682) +++ trunk/py4science/examples/pyrex/trailstats/ringbufnan.c 2008-12-19 19:31:23 UTC (rev 6683) @@ -121,7 +121,7 @@ d_old = rb_ptr->data[rb_ptr->i_oldest]; rb_ptr->data[i_new] = d; good_new = !isnan(d); -#if 0 +#if 1 printf("new value: %lf good_new: %d\n", d, good_new); printf("i_next: %d i_oldest: %d N_filled: %d N_good: %d\n", rb_ptr->i_next, rb_ptr->i_oldest, @@ -183,7 +183,7 @@ { resum_ringbuf(rb_ptr); } -#if 0 +#if 1 printf("i_next: %d i_oldest: %d N_filled: %d N_good: %d\n", rb_ptr->i_next, rb_ptr->i_oldest, rb_ptr->N_filled, rb_ptr->N_good); @@ -221,13 +221,21 @@ double ringbuf_min(ringbuf_t *rb_ptr) { + if (rb_ptr->N_good==0) + return NaN; return rb_ptr->data[rb_ptr->i_sorted[0]]; } double ringbuf_max(ringbuf_t *rb_ptr) { - int i_end; + + int i_end; + + if (rb_ptr->N_good==0) + return NaN; + i_end = rb_ptr->N_good - 1; + return rb_ptr->data[rb_ptr->i_sorted[i_end]]; } @@ -248,6 +256,16 @@ } } +double ringbuf_ptile(ringbuf_t *rb_ptr, double ptile) +{ + int i, N; + + N = rb_ptr->N_good; + if (N == 0) return NaN; + i = (int)(ptile*N); + return rb_ptr->data[rb_ptr->i_sorted[i]]; +} + int ringbuf_N_good(ringbuf_t *rb_ptr) { return rb_ptr->N_good; @@ -272,6 +290,7 @@ { int N; + N = rb_ptr->N_good; if (N > 0) { @@ -286,6 +305,7 @@ double ringbuf_sd(ringbuf_t *rb_ptr) { double m, s; + int N; N = rb_ptr->N_good; @@ -304,7 +324,7 @@ } void c_runstats(int nrb, int nd, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, int *ng) + double *dmin, double *dmax, double *dmed, double *dptile5, double *dptile95, int *ng) { int i, j; ringbuf_t *rb_ptr; @@ -319,6 +339,8 @@ dmin[j] = ringbuf_min(rb_ptr); dmax[j] = ringbuf_max(rb_ptr); dmed[j] = ringbuf_median(rb_ptr); + dptile5[j] = ringbuf_ptile(rb_ptr, 0.05); + dptile95[j] = ringbuf_ptile(rb_ptr, 0.95); ng[j] = rb_ptr->N_good; } delete_ringbuf(rb_ptr); @@ -327,7 +349,8 @@ void c_runstats2(int nrb, int nd, int step, int ofs, double *data, double *dmean, double *dstd, - double *dmin, double *dmax, double *dmed, int *ng) + double *dmin, double *dmax, double *dmed, double +*dptile5, double *dptile95, int *ng) { int i, j; int npad = (nrb - 1) / 2; @@ -339,6 +362,8 @@ dmin += ofs; dmax += ofs; dmed += ofs; + dptile5 += ofs; + dptile95 += ofs; ng += ofs; rb_ptr = new_ringbuf(nrb); @@ -355,6 +380,8 @@ dmin[j*step] = ringbuf_min(rb_ptr); dmax[j*step] = ringbuf_max(rb_ptr); dmed[j*step] = ringbuf_median(rb_ptr); + dptile5[j*step] = ringbuf_ptile(rb_ptr, 0.05); + dptile95[j*step] = ringbuf_ptile(rb_ptr, 0.95); ng[j*step] = rb_ptr->N_good; } delete_ringbuf(rb_ptr); Modified: trunk/py4science/examples/pyrex/trailstats/setup.py =================================================================== --- trunk/py4science/examples/pyrex/trailstats/setup.py 2008-12-19 12:40:09 UTC (rev 6682) +++ trunk/py4science/examples/pyrex/trailstats/setup.py 2008-12-19 19:31:23 UTC (rev 6683) @@ -4,11 +4,8 @@ # Make this usable by people who don't have pyrex installed (I've committed # the generated C sources to SVN). -try: - from Pyrex.Distutils import build_ext - has_pyrex = True -except ImportError: - has_pyrex = False +from Cython.Distutils import build_ext +has_pyrex = True import numpy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-19 12:40:16
|
Revision: 6682 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6682&view=rev Author: jdh2358 Date: 2008-12-19 12:40:09 +0000 (Fri, 19 Dec 2008) Log Message: ----------- Merged revisions 6679-6680 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6679 | jdh2358 | 2008-12-19 06:29:49 -0600 (Fri, 19 Dec 2008) | 1 line added macosx.m to manifest ........ r6680 | jdh2358 | 2008-12-19 06:30:33 -0600 (Fri, 19 Dec 2008) | 1 line added macosx.m to manifest; released 98.5.2 tarball ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/MANIFEST.in Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6676 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6681 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-12-19 12:38:33 UTC (rev 6681) +++ trunk/matplotlib/CHANGELOG 2008-12-19 12:40:09 UTC (rev 6682) @@ -1,7 +1,7 @@ 2008-12-18 add new arrow style, a line + filled triangles. -JJL ================================================================== -2008-12-18 Re-Released 0.98.5.2 from v0_98_5_maint at r6675 +2008-12-18 Re-Released 0.98.5.2 from v0_98_5_maint at r6679 Released 0.98.5.2 from v0_98_5_maint at r6667 2008-12-18 Removed configobj, experimental traits and doc/mpl_data link - JDH Modified: trunk/matplotlib/MANIFEST.in =================================================================== --- trunk/matplotlib/MANIFEST.in 2008-12-19 12:38:33 UTC (rev 6681) +++ trunk/matplotlib/MANIFEST.in 2008-12-19 12:40:09 UTC (rev 6682) @@ -16,7 +16,7 @@ recursive-include license LICENSE* recursive-include examples * recursive-include doc * -recursive-include src *.cpp *.c *.h +recursive-include src *.cpp *.c *.h *.m recursive-include CXX *.cxx *.hxx *.c *.h recursive-include agg24 * recursive-include lib * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-19 12:38:36
|
Revision: 6681 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6681&view=rev Author: jdh2358 Date: 2008-12-19 12:38:33 +0000 (Fri, 19 Dec 2008) Log Message: ----------- minor tweaks to makefile for osx release Modified Paths: -------------- trunk/matplotlib/release/osx/Makefile Modified: trunk/matplotlib/release/osx/Makefile =================================================================== --- trunk/matplotlib/release/osx/Makefile 2008-12-19 12:30:33 UTC (rev 6680) +++ trunk/matplotlib/release/osx/Makefile 2008-12-19 12:38:33 UTC (rev 6681) @@ -95,7 +95,7 @@ rm -rf upload &&\ mkdir upload &&\ cp matplotlib-${MPLVERSION}.tar.gz upload/ &&\ - cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.5-i386.egg upload/matplotlib-${MPLVERSION}-py2.5.egg &&\ + cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-py2.5.egg &&\ cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py2.5-mpkg.zip&&\ scp upload/* jd...@fr...:uploads/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-12-19 12:30:36
|
Revision: 6680 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6680&view=rev Author: jdh2358 Date: 2008-12-19 12:30:33 +0000 (Fri, 19 Dec 2008) Log Message: ----------- added macosx.m to manifest; released 98.5.2 tarball Modified Paths: -------------- branches/v0_98_5_maint/CHANGELOG Modified: branches/v0_98_5_maint/CHANGELOG =================================================================== --- branches/v0_98_5_maint/CHANGELOG 2008-12-19 12:29:49 UTC (rev 6679) +++ branches/v0_98_5_maint/CHANGELOG 2008-12-19 12:30:33 UTC (rev 6680) @@ -1,6 +1,6 @@ ======================================================================= -Re-Released 0.98.5.2 at r6675 +Re-Released 0.98.5.2 at r6679 Release 0.98.5.2 at r6667 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |