SourceForge logo
SourceForge logo
Menu

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

You can subscribe to this list here.

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

1
(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)



Showing 22 results of 22

From: <jd...@us...> - 2008年12月08日 23:29:06
Revision: 6526
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6526&view=rev
Author: jdh2358
Date: 2008年12月08日 23:28:55 +0000 (2008年12月08日)
Log Message:
-----------
add support for docstring.hardcopy to format the docstrings less verbosesly for interactive use
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/doc/matplotlibrc
 trunk/matplotlib/lib/matplotlib/artist.py
 trunk/matplotlib/lib/matplotlib/rcsetup.py
 trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年12月08日 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/CHANGELOG	2008年12月08日 23:28:55 UTC (rev 6526)
@@ -1,3 +1,13 @@
+2008年12月08日 Some of the changes Michael made to improve the output of
+ the property tables in the rest docs broke of made
+ difficult to use some of the interactive doc helpers, eg
+ setp and getp. Having all the rest markup in the ipython
+ shell also confused the docstrings. I added a new rc param
+ docstring.harcopy, to format the docstrings differently for
+ hardcopy and other use. Ther ArtistInspector could use a
+ little refactoring now since there is duplication of effort
+ between the rest out put and the non-rest output - JDH
+
 2008年12月08日 Updated spectral methods (psd, csd, etc.) to scale one-sided
 densities by a factor of 2 and, optionally, scale all densities
 by the sampling frequency. This gives better MatLab
Modified: trunk/matplotlib/doc/matplotlibrc
===================================================================
--- trunk/matplotlib/doc/matplotlibrc	2008年12月08日 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/doc/matplotlibrc	2008年12月08日 23:28:55 UTC (rev 6526)
@@ -294,6 +294,9 @@
 #svg.image_noscale : False # suppress scaling of raster data embedded in SVG
 #svg.embed_chars : True # embed character outlines in the SVG file
 
+# docstring params
+docstring.hardcopy = True # set this when you want to generate hardcopy docstring
+
 # Set the verbose flags. This controls how much information
 # matplotlib gives you at runtime and where it goes. The verbosity
 # levels are: silent, helpful, debug, debug-annoying. Any level is
@@ -311,5 +314,6 @@
 #
 # You can access the verbose instance in your code
 # from matplotlib import verbose.
+
 #verbose.level : silent # one of silent, helpful, debug, debug-annoying
 #verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py	2008年12月08日 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/lib/matplotlib/artist.py	2008年12月08日 23:28:55 UTC (rev 6526)
@@ -1,5 +1,6 @@
 from __future__ import division
 import re, warnings
+import matplotlib
 import matplotlib.cbook as cbook
 from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
 from path import Path
@@ -640,9 +641,12 @@
 type) and it is your responsibility to make sure this is so.
 """
 if cbook.iterable(o) and len(o): o = o[0]
+
+ self.oorig = o
 if not isinstance(o, type):
 o = type(o)
 self.o = o
+
 self.aliasd = self.get_aliases()
 
 def get_aliases(self):
@@ -735,7 +739,7 @@
 if ds is None: return False
 return ds.startswith('alias for ')
 
- def aliased_name(self, s, target):
+ def aliased_name(self, s):
 """
 return 'PROPNAME or alias' if *s* has an alias, else return
 PROPNAME.
@@ -746,11 +750,28 @@
 """
 
 if s in self.aliasd:
+ return s + ''.join([' or %s' % x for x in self.aliasd[s].keys()])
+ else:
+ return s
+
+
+ def aliased_name_rest(self, s, target):
+ """
+ return 'PROPNAME or alias' if *s* has an alias, else return
+ PROPNAME formatted for ReST
+
+ E.g. for the line markerfacecolor property, which has an
+ alias, return 'markerfacecolor or mfc' and for the transform
+ property, which does not, return 'transform'
+ """
+
+ if s in self.aliasd:
 aliases = ''.join([' or %s' % x for x in self.aliasd[s].keys()])
 else:
 aliases = ''
 return ':meth:`%s <%s>`%s' % (s, target, aliases)
 
+
 def pprint_setters(self, prop=None, leadingspace=2):
 """
 If *prop* is *None*, return a list of strings of all settable properies
@@ -772,8 +793,36 @@
 attrs.sort()
 lines = []
 
+ for prop, path in attrs:
+ accepts = self.get_valid_values(prop)
+ name = self.aliased_name(prop)
+
+ lines.append('%s%s: %s' %(pad, name, accepts))
+ return lines
+
+ def pprint_setters_rest(self, prop=None, leadingspace=2):
+ """
+ If *prop* is *None*, return a list of strings of all settable properies
+ and their valid values. Format the output for ReST
+
+ If *prop* is not *None*, it is a valid property name and that
+ property will be returned as a string of property : valid
+ values.
+ """
+ if leadingspace:
+ pad = ' '*leadingspace
+ else:
+ pad = ''
+ if prop is not None:
+ accepts = self.get_valid_values(prop)
+ return '%s%s: %s' %(pad, prop, accepts)
+
+ attrs = self._get_setters_and_targets()
+ attrs.sort()
+ lines = []
+
 ########
- names = [self.aliased_name(prop, target) for prop, target in attrs]
+ names = [self.aliased_name_rest(prop, target) for prop, target in attrs]
 accepts = [self.get_valid_values(prop) for prop, target in attrs]
 
 col0_len = max([len(n) for n in names])
@@ -796,7 +845,7 @@
 
 for prop, path in attrs:
 accepts = self.get_valid_values(prop)
- name = self.aliased_name(prop, path)
+ name = self.aliased_name_rest(prop, path)
 
 lines.append('%s%s: %s' %(pad, name, accepts))
 return lines
@@ -805,20 +854,27 @@
 """
 Return the getters and actual values as list of strings.
 """
- getters = [name for name in dir(self.o)
+
+ o = self.oorig
+ getters = [name for name in dir(o)
 if name.startswith('get_')
- and callable(getattr(self.o, name))]
+ and callable(getattr(o, name))]
+ #print getters
 getters.sort()
 lines = []
 for name in getters:
- func = getattr(self.o, name)
+ func = getattr(o, name)
 if self.is_alias(func): continue
+
 try: val = func()
 except: continue
 if getattr(val, 'shape', ()) != () and len(val)>6:
 s = str(val[:6]) + '...'
 else:
 s = str(val)
+ s = s.replace('\n', ' ')
+ if len(s)>50:
+ s = s[:50] + '...'
 name = self.aliased_name(name[4:])
 lines.append(' %s = %s' %(name, s))
 return lines
@@ -898,17 +954,17 @@
 insp = ArtistInspector(o)
 
 if property is None:
- print '\n'.join(insp.pprint_getters())
+ ret = insp.pprint_getters()
+ print '\n'.join(ret)
 return
 
 func = getattr(o, 'get_' + property)
+
 return func()
 
-def get(o, *args, **kwargs):
- return getp(o, *args, **kwargs)
-get.__doc__ = getp.__doc__
+# alias
+get = getp
 
-
 def setp(h, *args, **kwargs):
 """
 matplotlib supports the use of :func:`setp` ("set property") and
@@ -984,7 +1040,11 @@
 return [x for x in cbook.flatten(ret)]
 
 def kwdoc(a):
- return '\n'.join(ArtistInspector(a).pprint_setters(leadingspace=2))
+ hardcopy = matplotlib.rcParams['docstring.hardcopy']
+ if hardcopy:
+ return '\n'.join(ArtistInspector(a).pprint_setters_rest(leadingspace=2))
+ else:
+ return '\n'.join(ArtistInspector(a).pprint_setters(leadingspace=2))
 
 kwdocd = dict()
 kwdocd['Artist'] = kwdoc(Artist)
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py	2008年12月08日 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py	2008年12月08日 23:28:55 UTC (rev 6526)
@@ -511,6 +511,8 @@
 'svg.image_inline' : [True, validate_bool], # write raster image data directly into the svg file
 'svg.image_noscale' : [False, validate_bool], # suppress scaling of raster data embedded in SVG
 'svg.embed_char_paths' : [True, validate_bool], # True to save all characters as paths in the SVG
+
+ 'docstring.hardcopy' : [False, validate_bool], # set this when you want to generate hardcopy docstring
 'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate
 
 'path.simplify' : [False, validate_bool],
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template	2008年12月08日 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/matplotlibrc.template	2008年12月08日 23:28:55 UTC (rev 6526)
@@ -323,6 +323,9 @@
 #svg.image_noscale : False # suppress scaling of raster data embedded in SVG
 #svg.embed_char_paths : True # embed character outlines in the SVG file
 
+# docstring params
+#docstring.hardcopy = False # set this when you want to generate hardcopy docstring
+
 # Set the verbose flags. This controls how much information
 # matplotlib gives you at runtime and where it goes. The verbosity
 # levels are: silent, helpful, debug, debug-annoying. Any level is
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6525
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6525&view=rev
Author: jdh2358
Date: 2008年12月08日 23:27:08 +0000 (2008年12月08日)
Log Message:
-----------
removed dashtick
Removed Paths:
-------------
 trunk/matplotlib/examples/pylab_examples/dashtick.py
Deleted: trunk/matplotlib/examples/pylab_examples/dashtick.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/dashtick.py	2008年12月08日 22:04:15 UTC (rev 6524)
+++ trunk/matplotlib/examples/pylab_examples/dashtick.py	2008年12月08日 23:27:08 UTC (rev 6525)
@@ -1,61 +0,0 @@
-# Matplotlib xaxis label tweak
-# -*- noplot -*-
-
-import sys
-import matplotlib
-from matplotlib import pylab, ticker
-
-ROTATION=75
-DASHROTATION=75
-DASHBASE=10
-DASHLEN=35
-DASHSTAGGER=3
-FONTSIZE=6
-
-def dashlen(step):
- return DASHBASE+(DASHLEN*(step%DASHSTAGGER))
-
-def test_dashticklabel():
- pylab.clf()
- x = [0.0, 1.0, 1.1, 5.0, 5.1, 6.0]
- y = [1, 3, 2, 5, 1, 2]
- labels = ['foo', 'bar', 'baz', 'alpha', 'beta', 'gamma']
- locator = ticker.FixedLocator(x)
- formatter = ticker.FixedFormatter(labels)
- axis = pylab.axes([0.3, 0.3, 0.4, 0.4])
- axis.xaxis.set_major_locator(locator)
- axis.xaxis.set_major_formatter(formatter)
- axis.yaxis.set_major_locator(locator)
- axis.yaxis.set_major_formatter(formatter)
- for tick in axis.xaxis.get_major_ticks():
- tick.label2On = True
- for tick in axis.yaxis.get_major_ticks():
- tick.label2On = True
- step = 0
- for label in axis.get_xticklabels():
- pylab.setp(label,
- rotation=ROTATION,
- dashlength=dashlen(step),
- dashrotation=DASHROTATION,
- fontsize=FONTSIZE,
- )
- step += 1
- step = 0
- for label in axis.get_yticklabels():
- pylab.setp(label,
- rotation=90-ROTATION,
- dashlength=dashlen(step),
- dashrotation=90-DASHROTATION,
- fontsize=FONTSIZE,
- )
- step += 1
- pylab.xlabel('X Label')
- pylab.ylabel('Y Label')
- pylab.plot(x, y)
- axis.set_xlim((0.0, 6.0))
- axis.set_ylim((0.0, 6.0))
- pylab.savefig('dashticklabel')
- pylab.show()
-
-if __name__ == '__main__':
- test_dashticklabel()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年12月08日 22:04:19
Revision: 6524
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6524&view=rev
Author: jdh2358
Date: 2008年12月08日 22:04:15 +0000 (2008年12月08日)
Log Message:
-----------
fixed some doc formatting errors
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py	2008年12月08日 21:59:25 UTC (rev 6523)
+++ trunk/matplotlib/lib/matplotlib/patches.py	2008年12月08日 22:04:15 UTC (rev 6524)
@@ -1429,11 +1429,12 @@
 args = None
 
 if args is None:
- argstr = 'None' # empy table entry crashed latex build
+ argstr = 'None'
 else:
 argstr = ",".join([("%s=%s" % (an, av)) for an, av in args])
 
- _table.append([cls.__name__, name, argstr])
+ #adding quotes for now to work around tex bug treating '-' as itemize
+ _table.append([cls.__name__, "'%s'"%name, argstr])
 
 
 return _pprint_table(_table)
@@ -3309,13 +3310,13 @@
 
 
 def set_patchA(self, patchA):
- """ set the begin patche.
+ """ set the begin patch.
 """
 self.patchA = patchA
 
 
 def set_patchB(self, patchB):
- """ set the begin patche.
+ """ set the begin patch
 """
 self.patchB = patchB
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ry...@us...> - 2008年12月08日 21:59:28
Revision: 6523
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6523&view=rev
Author: ryanmay
Date: 2008年12月08日 21:59:25 +0000 (2008年12月08日)
Log Message:
-----------
Replace tabs with spaces.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年12月08日 21:54:22 UTC (rev 6522)
+++ trunk/matplotlib/CHANGELOG	2008年12月08日 21:59:25 UTC (rev 6523)
@@ -9,31 +9,31 @@
 numpy 1.2 or later. -JJL
 
 2008年12月06日 Fixed a bug in svg backend that new_figure_manager()
-	 ignores keywords arguments such as figsize, etc. -JJL
+ ignores keywords arguments such as figsize, etc. -JJL
 
-2008年12月05日 Fixed a bug that the handlelength of the new legend class 
-	 set too short when numpoints=1 -JJL
+2008年12月05日 Fixed a bug that the handlelength of the new legend class
+ set too short when numpoints=1 -JJL
 
 2008年12月04日 Added support for data with units (e.g. dates) to
 Axes.fill_between. -RM
 
 2008年12月04日 Added fancybox keyword to legend. Also applied some changes
-	 for better look, including baseline adjustment of the
-	 multiline texts so that it is center aligned. -JJL
+ for better look, including baseline adjustment of the
+ multiline texts so that it is center aligned. -JJL
 
 2008年12月02日 The transmuter classes in the patches.py are reorganized as
- subclasses of the Style classes. A few more box and arrow 
-	 styles are added. -JJL
+ subclasses of the Style classes. A few more box and arrow
+ styles are added. -JJL
 
-2008年12月02日 Fixed a bug in the new legend class that didn't allowed 
+2008年12月02日 Fixed a bug in the new legend class that didn't allowed
 a tuple of coordinate vlaues as loc. -JJL
 
-2008年12月02日 Improve checks for external dependencies, using subprocess 
+2008年12月02日 Improve checks for external dependencies, using subprocess
 (instead of deprecated popen*) and distutils (for version
 checking) - DSD
 
 2008年11月30日 Reimplementaion of the legend which supports baseline alignement,
-	 multi-column, and expand mode. - JJL
+ multi-column, and expand mode. - JJL
 
 2008年12月01日 Fixed histogram autoscaling bug when bins or range are given
 explicitly (fixes Debian bug 503148) - MM
@@ -187,16 +187,16 @@
 2008年07月31日 Added masked array support to griddata. - JSW
 
 2008年07月26日 Added optional C and reduce_C_function arguments to
-	 axes.hexbin(). This allows hexbin to accumulate the values
-	 of C based on the x,y coordinates and display in hexagonal
-	 bins. - ADS
+ axes.hexbin(). This allows hexbin to accumulate the values
+ of C based on the x,y coordinates and display in hexagonal
+ bins. - ADS
 
 2008年07月24日 Deprecated (raise NotImplementedError) all the mlab2
 functions from matplotlib.mlab out of concern that some of
 them were not clean room implementations. JDH
 
 2008年07月24日 Rewrite of a significant portion of the clabel code (class
-	 ContourLabeler) to improve inlining. - DMK
+ ContourLabeler) to improve inlining. - DMK
 
 2008年07月22日 Added Barbs polygon collection (similar to Quiver) for plotting
 wind barbs. Added corresponding helpers to Axes and pyplot as
@@ -684,8 +684,8 @@
 2007年11月27日 Released 0.91.0 at revision 4478
 
 2007年11月13日 All backends now support writing to a file-like object, not
-	 just a regular file. savefig() can be passed a file-like
-	 object in place of a file path. - MGD
+ just a regular file. savefig() can be passed a file-like
+ object in place of a file path. - MGD
 
 2007年11月13日 Improved the default backend selection at build time:
 SVG -> Agg -> TkAgg -> WXAgg -> GTK -> GTKAgg. The last usable
@@ -703,24 +703,24 @@
 updated on subsequent installs - DSD
 
 2007年11月12日 Added support for STIX fonts. A new rcParam,
-	 mathtext.fontset, can be used to choose between:
+ mathtext.fontset, can be used to choose between:
 
-	 'cm':
-	 The TeX/LaTeX Computer Modern fonts
+ 'cm':
+ The TeX/LaTeX Computer Modern fonts
 
-	 'stix':
-	 The STIX fonts (see stixfonts.org)
+ 'stix':
+ The STIX fonts (see stixfonts.org)
 
-	 'stixsans':
-	 The STIX fonts, using sans-serif glyphs by default
+ 'stixsans':
+ The STIX fonts, using sans-serif glyphs by default
 
-	 'custom':
-	 A generic Unicode font, in which case the mathtext font
-	 must be specified using mathtext.bf, mathtext.it,
-	 mathtext.sf etc.
+ 'custom':
+ A generic Unicode font, in which case the mathtext font
+ must be specified using mathtext.bf, mathtext.it,
+ mathtext.sf etc.
 
-	 Added a new example, stix_fonts_demo.py to show how to access
-	 different fonts and unusual symbols.
+ Added a new example, stix_fonts_demo.py to show how to access
+ different fonts and unusual symbols.
 
 - MGD
 
@@ -771,72 +771,72 @@
 
 2007年10月29日 TRANSFORMS REFACTORING
 
-	 The primary goal of this refactoring was to make it easier
-	 to extend matplotlib to support new kinds of projections.
-	 This is primarily an internal improvement, and the possible
-	 user-visible changes it allows are yet to come.
+ The primary goal of this refactoring was to make it easier
+ to extend matplotlib to support new kinds of projections.
+ This is primarily an internal improvement, and the possible
+ user-visible changes it allows are yet to come.
 
-	 The transformation framework was completely rewritten in
-	 Python (with Numpy). This will make it easier to add news
-	 kinds of transformations without writing C/C++ code.
+ The transformation framework was completely rewritten in
+ Python (with Numpy). This will make it easier to add news
+ kinds of transformations without writing C/C++ code.
 
-	 Transforms are composed into a 'transform tree', made of
-	 transforms whose value depends on other transforms (their
-	 children). When the contents of children change, their
-	 parents are automatically updated to reflect those changes.
-	 To do this an "invalidation" method is used: when children
-	 change, all of their ancestors are marked as "invalid".
-	 When the value of a transform is accessed at a later time,
-	 its value is recomputed only if it is invalid, otherwise a
-	 cached value may be used. This prevents unnecessary
-	 recomputations of transforms, and contributes to better
-	 interactive performance.
+ Transforms are composed into a 'transform tree', made of
+ transforms whose value depends on other transforms (their
+ children). When the contents of children change, their
+ parents are automatically updated to reflect those changes.
+ To do this an "invalidation" method is used: when children
+ change, all of their ancestors are marked as "invalid".
+ When the value of a transform is accessed at a later time,
+ its value is recomputed only if it is invalid, otherwise a
+ cached value may be used. This prevents unnecessary
+ recomputations of transforms, and contributes to better
+ interactive performance.
 
-	 The framework can be used for both affine and non-affine
-	 transformations. However, for speed, we want use the
-	 backend renderers to perform affine transformations
-	 whenever possible. Therefore, it is possible to perform
-	 just the affine or non-affine part of a transformation on a
-	 set of data. The affine is always assumed to occur after
-	 the non-affine. For any transform:
+ The framework can be used for both affine and non-affine
+ transformations. However, for speed, we want use the
+ backend renderers to perform affine transformations
+ whenever possible. Therefore, it is possible to perform
+ just the affine or non-affine part of a transformation on a
+ set of data. The affine is always assumed to occur after
+ the non-affine. For any transform:
 
-	 full transform == non-affine + affine
+ full transform == non-affine + affine
 
-	 Much of the drawing has been refactored in terms of
-	 compound paths. Therefore, many methods have been removed
-	 from the backend interface and replaced with a a handful to
-	 draw compound paths. This will make updating the backends
-	 easier, since there is less to update. It also should make
-	 the backends more consistent in terms of functionality.
+ Much of the drawing has been refactored in terms of
+ compound paths. Therefore, many methods have been removed
+ from the backend interface and replaced with a a handful to
+ draw compound paths. This will make updating the backends
+ easier, since there is less to update. It also should make
+ the backends more consistent in terms of functionality.
 
-	 User visible changes:
+ User visible changes:
 
-	 - POLAR PLOTS: Polar plots are now interactively zoomable,
+ - POLAR PLOTS: Polar plots are now interactively zoomable,
 and the r-axis labels can be interactively rotated.
 Straight line segments are now interpolated to follow the
 curve of the r-axis.
 
-	 - Non-rectangular clipping works in more backends and with
+ - Non-rectangular clipping works in more backends and with
 more types of objects.
 
-	 - Sharing an axis across figures is now done in exactly
-	 the same way as sharing an axis between two axes in the
-	 same figure:
+ - Sharing an axis across figures is now done in exactly
+ the same way as sharing an axis between two axes in the
+ same figure:
 
-	 	 fig1 = figure()
-		 fig2 = figure()
+ fig1 = figure()
+ fig2 = figure()
 
-		 ax1 = fig1.add_subplot(111)
-		 ax2 = fig2.add_subplot(111, sharex=ax1, sharey=ax1)
+ ax1 = fig1.add_subplot(111)
+ ax2 = fig2.add_subplot(111, sharex=ax1, sharey=ax1)
 
 - linestyles now include steps-pre, steps-post and
 steps-mid. The old step still works and is equivalent to
 step-pre.
 
-	 - Multiple line styles may be provided to a collection.
+ - Multiple line styles may be provided to a collection.
 
-	 See API_CHANGES for more low-level information about this
-	 refactoring.
+ See API_CHANGES for more low-level information about this
+ refactoring.
 
 2007年10月24日 Added ax kwarg to Figure.colorbar and pyplot.colorbar - EF
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年12月08日 21:54:54
Revision: 6522
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6522&view=rev
Author: jdh2358
Date: 2008年12月08日 21:54:22 +0000 (2008年12月08日)
Log Message:
-----------
fixed some doc formatting errors
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/legend.py
 trunk/matplotlib/lib/matplotlib/patches.py
 trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py	2008年12月08日 21:27:40 UTC (rev 6521)
+++ trunk/matplotlib/lib/matplotlib/legend.py	2008年12月08日 21:54:22 UTC (rev 6522)
@@ -123,10 +123,9 @@
 
 Optional keyword arguments:
 
- ================ =================================================
+ ================ ==================================================================
 Keyword Description
- ================ =================================================
-
+ ================ ==================================================================
 loc a location code or a tuple of coordinates
 numpoints the number of points in the legend line
 prop the font property
@@ -134,17 +133,16 @@
 fancybox if True, draw a frame with a round fancybox. If None, use rc
 shadow if True, draw a shadow behind legend
 scatteryoffsets a list of yoffsets for scatter symbols in legend
-
 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
+ ================ ==================================================================
 
 The dimensions of pad and spacing are given as a fraction of the
 fontsize. Values from rcParams will be used if None.
-
 """
 from matplotlib.axes import Axes # local import only to avoid circularity
 from matplotlib.figure import Figure # local import only to avoid circularity
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py	2008年12月08日 21:27:40 UTC (rev 6521)
+++ trunk/matplotlib/lib/matplotlib/patches.py	2008年12月08日 21:54:22 UTC (rev 6522)
@@ -1426,11 +1426,16 @@
 args = [(argname, argdefault) \
 for argname, argdefault in zip(args[1:], defaults)]
 else:
- args = []
+ args = None
 
- _table.append([cls.__name__, name,
- ",".join([("%s=%s" % (an, av)) for an, av in args])])
+ if args is None:
+ argstr = 'None' # empy table entry crashed latex build
+ else:
+ argstr = ",".join([("%s=%s" % (an, av)) for an, av in args])
 
+ _table.append([cls.__name__, name, argstr])
+
+
 return _pprint_table(_table)
 
 
@@ -2015,8 +2020,8 @@
 comma-separated attributes. Alternatively, the attrs can
 be provided as keywords::
 
- set_boxstyle("round,pad=0.2")
- set_boxstyle("round", pad=0.2)
+ set_boxstyle("round,pad=0.2")
+ set_boxstyle("round", pad=0.2)
 
 Old attrs simply are forgotten.
 
@@ -2024,6 +2029,7 @@
 available box styles.
 
 ACCEPTS: [ %(AvailableBoxstyles)s ]
+
 """
 
 if boxstyle==None:
@@ -2793,6 +2799,7 @@
 _style_list["-"] = Curve
 
 
+
 class CurveA(_Curve):
 """
 An arrow with a head at its begin point.
@@ -2813,7 +2820,6 @@
 
 _style_list["<-"] = CurveA
 
-
 class CurveB(_Curve):
 """
 An arrow with a head at its end point.
@@ -2832,6 +2838,7 @@
 beginarrow=False, endarrow=True,
 head_length=head_length, head_width=head_width )
 
+ #_style_list["->"] = CurveB
 _style_list["->"] = CurveB
 
 
@@ -2853,6 +2860,7 @@
 beginarrow=True, endarrow=True,
 head_length=head_length, head_width=head_width )
 
+ #_style_list["<->"] = CurveAB
 _style_list["<->"] = CurveAB
 
 
@@ -2960,6 +2968,7 @@
 super(ArrowStyle.BracketB, self).__init__(None, True,
 widthB=widthB, lengthB=lengthB, angleB=None )
 
+ #_style_list["-["] = BracketB
 _style_list["-["] = BracketB
 
 
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py	2008年12月08日 21:27:40 UTC (rev 6521)
+++ trunk/matplotlib/lib/matplotlib/text.py	2008年12月08日 21:54:22 UTC (rev 6522)
@@ -1297,9 +1297,9 @@
 drawn. Valid keys for YAArow are
 
 
- ========= ===========================================================
+ ========= =============================================================
 Key Description
- ========= ===========================================================
+ ========= =============================================================
 width the width of the arrow in points
 frac the fraction of the arrow length occupied by the head
 headwidth the width of the base of the arrow head in points
@@ -1310,7 +1310,7 @@
 and base are shink percent of the distance *d* away from the
 endpoints. ie, ``shrink=0.05 is 5%%``
 ? any key for :class:`matplotlib.patches.polygon`
- ========= ===========================================================
+ ========= =============================================================
 
 
 Valid keys for FancyArrowPatch are
@@ -1319,8 +1319,8 @@
 =============== ======================================================
 Key Description
 =============== ======================================================
- arrowstyle
- connectionstyle
+ arrowstyle the arrow style
+ connectionstyle the connection style
 relpos default is (0.5, 0.5)
 patchA default is bounding box of the text
 patchB default is None
@@ -1328,8 +1328,8 @@
 shrinkB default is 2 points
 mutation_scale default is text size (in points)
 mutation_aspect default is 1.
- ? any key for :class:`matplotlib.patches.PathPatch`
- ========= ===========================================================
+ ? any key for :class:`matplotlib.patches.PathPatch`
+ =============== ======================================================
 
 
 *xycoords* and *textcoords* are strings that indicate the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ry...@us...> - 2008年12月08日 21:27:44
Revision: 6521
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6521&view=rev
Author: ryanmay
Date: 2008年12月08日 21:27:40 +0000 (2008年12月08日)
Log Message:
-----------
Remove trailing whitespace.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2008年12月08日 21:23:04 UTC (rev 6520)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2008年12月08日 21:27:40 UTC (rev 6521)
@@ -6521,7 +6521,7 @@
 if not self._hold: self.cla()
 
 # NOTE: the range keyword overwrites the built-in func range !!!
- # needs to be fixed in with numpy !!! 
+ # needs to be fixed in with numpy !!!
 
 if kwargs.get('width') is not None:
 raise DeprecationWarning(
@@ -6551,7 +6551,7 @@
 binsgiven = (cbook.iterable(bins) or range != None)
 
 # check the version of the numpy
- if np.__version__ < "1.2": # version 1.1 
+ if np.__version__ < "1.2": # version 1.1
 hist_kwargs = dict(range=range,
 normed=bool(normed), new=True)
 else: # version 1.2 and later, drop new=True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ry...@us...> - 2008年12月08日 21:23:09
Revision: 6520
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6520&view=rev
Author: ryanmay
Date: 2008年12月08日 21:23:04 +0000 (2008年12月08日)
Log Message:
-----------
Update CHANGELOG and api_changes for the changes to psd and friends.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/doc/api/api_changes.rst
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年12月08日 21:16:04 UTC (rev 6519)
+++ trunk/matplotlib/CHANGELOG	2008年12月08日 21:23:04 UTC (rev 6520)
@@ -1,3 +1,8 @@
+2008年12月08日 Updated spectral methods (psd, csd, etc.) to scale one-sided
+ densities by a factor of 2 and, optionally, scale all densities
+ by the sampling frequency. This gives better MatLab
+ compatibility. -RM
+
 2008年12月08日 Fixed alignment of ticks in colorbars. -MGD
 
 2008年12月07日 drop the deprecated "new" keyword of np.histogram() for
Modified: trunk/matplotlib/doc/api/api_changes.rst
===================================================================
--- trunk/matplotlib/doc/api/api_changes.rst	2008年12月08日 21:16:04 UTC (rev 6519)
+++ trunk/matplotlib/doc/api/api_changes.rst	2008年12月08日 21:23:04 UTC (rev 6520)
@@ -9,6 +9,15 @@
 Changes for 0.98.x
 ==================
 
+* Modified :func:`matplotlib.mlab.psd`, :func:`matplotlib.mlab.csd`,
+ :func:`matplotlib.mlab.cohere`, and :func:`matplotlib.mlab.specgram`
+ to scale one-sided densities by a factor of 2. Also, optionally
+ scale the densities by the sampling frequency, which gives true values
+ of densities that can be integrated by the returned frequency values.
+ This also gives better MatLab compatibility. The corresponding
+ :class:`matplotlib.axes.Axes` methods and :mod:`matplotlib.pyplot`
+ functions were updated as well.
+
 * Font lookup now uses a nearest-neighbor approach rather than an
 exact match. Some fonts may be different in plots, but should be
 closer to what was requested.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6519
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6519&view=rev
Author: ryanmay
Date: 2008年12月08日 21:16:04 +0000 (2008年12月08日)
Log Message:
-----------
Add a converted MatLab example that was used to figure out the differences between MatLab and matplotlib PSD scaling.
Added Paths:
-----------
 trunk/matplotlib/examples/pylab_examples/psd_demo3.py
Added: trunk/matplotlib/examples/pylab_examples/psd_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/psd_demo3.py	 (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/psd_demo3.py	2008年12月08日 21:16:04 UTC (rev 6519)
@@ -0,0 +1,34 @@
+#This is a ported version of a Matlab example from the signal processing
+#toolbox that showed some difference at one time between Matplotlib's and
+#MatLab's scaling of the PSD.
+
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
+
+fs = 1000
+t = np.linspace(0, 0.3, 301)
+A = np.array([2, 8]).reshape(-1, 1)
+f = np.array([150, 140]).reshape(-1, 1)
+xn = (A * np.sin(2 * np.pi * f * t)).sum(axis=0) + 5 * np.random.randn(*t.shape)
+
+yticks = np.arange(-50, 30, 10)
+xticks = np.arange(0,550,100)
+
+plt.subplot(1,2,1)
+plt.psd(xn, NFFT=301, Fs=fs, window=mlab.window_none, pad_to=1024,
+ scale_by_freq=True)
+plt.title('Periodogram PSD Estimate')
+plt.yticks(yticks)
+plt.xticks(xticks)
+plt.grid(True)
+
+plt.subplot(1,2,2)
+plt.psd(xn, NFFT=150, Fs=fs, window=mlab.window_none, noverlap=75, pad_to=512,
+ scale_by_freq=True)
+plt.title('Welch Method PSD Estimate')
+plt.xticks(xticks)
+plt.yticks(yticks)
+plt.grid(True)
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ry...@us...> - 2008年12月08日 21:15:23
Revision: 6518
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6518&view=rev
Author: ryanmay
Date: 2008年12月08日 21:15:13 +0000 (2008年12月08日)
Log Message:
-----------
Update spectral methods (psd, csd, etc.) to scale one-sided densities by a factor of 2 and, optionally, scale all densities by the sampling frequency. This gives better MatLab compatibility. Update corresponding Axes methods, and make Axes.psd() label the y-axis of the plot as appropriate.
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2008年12月08日 21:06:49 UTC (rev 6517)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2008年12月08日 21:15:13 UTC (rev 6518)
@@ -6719,13 +6719,13 @@
 
 def psd(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
 window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs):
+ sides='default', scale_by_freq=None, **kwargs):
 """
 call signature::
 
 psd(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
 window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs)
+ sides='default', scale_by_freq=None, **kwargs)
 
 The power spectral density by Welch's average periodogram
 method. The vector *x* is divided into *NFFT* length
@@ -6764,13 +6764,18 @@
 """
 if not self._hold: self.cla()
 pxx, freqs = mlab.psd(x, NFFT, Fs, detrend, window, noverlap, pad_to,
- sides)
+ sides, scale_by_freq)
 pxx.shape = len(freqs),
 freqs += Fc
 
+ if scale_by_freq in (None, True):
+ psd_units = 'dB/Hz'
+ else:
+ psd_units = 'dB'
+
 self.plot(freqs, 10*np.log10(pxx), **kwargs)
 self.set_xlabel('Frequency')
- self.set_ylabel('Power Spectrum (dB)')
+ self.set_ylabel('Power Spectral Density (%s)' % psd_units)
 self.grid(True)
 vmin, vmax = self.viewLim.intervaly
 intv = vmax-vmin
@@ -6791,13 +6796,13 @@
 
 def csd(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
 window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs):
+ sides='default', scale_by_freq=None, **kwargs):
 """
 call signature::
 
 csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
 window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs)
+ sides='default', scale_by_freq=None, **kwargs)
 
 The cross spectral density :math:`P_{xy}` by Welch's average
 periodogram method. The vectors *x* and *y* are divided into
@@ -6837,7 +6842,7 @@
 """
 if not self._hold: self.cla()
 pxy, freqs = mlab.csd(x, y, NFFT, Fs, detrend, window, noverlap,
- pad_to, sides)
+ pad_to, sides, scale_by_freq)
 pxy.shape = len(freqs),
 # pxy is complex
 freqs += Fc
@@ -6859,13 +6864,13 @@
 
 def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
 window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs):
+ sides='default', scale_by_freq=None, **kwargs):
 """
 call signature::
 
 cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend = mlab.detrend_none,
 window = mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs)
+ sides='default', scale_by_freq=None, **kwargs)
 
 cohere the coherence between *x* and *y*. Coherence is the normalized
 cross spectral density:
@@ -6902,7 +6907,8 @@
 .. plot:: mpl_examples/pylab_examples/cohere_demo.py
 """
 if not self._hold: self.cla()
- cxy, freqs = mlab.cohere(x, y, NFFT, Fs, detrend, window, noverlap)
+ cxy, freqs = mlab.cohere(x, y, NFFT, Fs, detrend, window, noverlap,
+ scale_by_freq)
 freqs += Fc
 
 self.plot(freqs, cxy, **kwargs)
@@ -6915,13 +6921,15 @@
 
 def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
 window=mlab.window_hanning, noverlap=128,
- cmap=None, xextent=None, pad_to=None, sides='default'):
+ cmap=None, xextent=None, pad_to=None, sides='default',
+ scale_by_freq=None):
 """
 call signature::
 
 specgram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
 window=mlab.window_hanning, noverlap=128,
- cmap=None, xextent=None, pad_to=None, sides='default')
+ cmap=None, xextent=None, pad_to=None, sides='default',
+ scale_by_freq=None)
 
 Compute a spectrogram of data in *x*. Data are split into
 *NFFT* length segments and the PSD of each section is
@@ -6965,7 +6973,7 @@
 if not self._hold: self.cla()
 
 Pxx, freqs, bins = mlab.specgram(x, NFFT, Fs, detrend,
- window, noverlap, pad_to, sides)
+ window, noverlap, pad_to, sides, scale_by_freq)
 
 Z = 10. * np.log10(Pxx)
 Z = np.flipud(Z)
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py	2008年12月08日 21:06:49 UTC (rev 6517)
+++ trunk/matplotlib/lib/matplotlib/mlab.py	2008年12月08日 21:15:13 UTC (rev 6518)
@@ -243,14 +243,15 @@
 #This is a helper function that implements the commonality between the
 #psd, csd, and spectrogram. It is *NOT* meant to be used outside of mlab
 def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+ window=window_hanning, noverlap=0, pad_to=None, sides='default',
+ scale_by_freq=None):
 #The checks for if y is x are so that we can use the same function to
 #implement the core of psd(), csd(), and spectrogram() without doing
 #extra calculations. We return the unaveraged Pxy, freqs, and t.
+ same_data = y is x
 
 #Make sure we're dealing with a numpy array. If y and x were the same
 #object to start with, keep them that way
- same_data = y is x
 
 x = np.asarray(x)
 if not same_data:
@@ -270,15 +271,31 @@
 if pad_to is None:
 pad_to = NFFT
 
+ if scale_by_freq is None:
+ warnings.warn("psd, csd, and specgram have changed to scale their "
+ "densities by the sampling frequency for better MatLab "
+ "compatibility. You can pass scale_by_freq=False to disable "
+ "this behavior. Also, one-sided densities are scaled by a "
+ "factor of 2.")
+ scale_by_freq = True
+
 # For real x, ignore the negative frequencies unless told otherwise
 if (sides == 'default' and np.iscomplexobj(x)) or sides == 'twosided':
 numFreqs = pad_to
+ scaling_factor = 1.
 elif sides in ('default', 'onesided'):
 numFreqs = pad_to//2 + 1
+ scaling_factor = 2.
 else:
 raise ValueError("sides must be one of: 'default', 'onesided', or "
 "'twosided'")
 
+ # Matlab divides by the sampling frequency so that density function
+ # has units of dB/Hz and can be integrated by the plotted frequency
+ # values. Perform the same scaling here.
+ if scale_by_freq:
+ scaling_factor /= Fs
+
 if cbook.iterable(window):
 assert(len(window) == NFFT)
 windowVals = window
@@ -305,8 +322,10 @@
 Pxy[:,i] = np.conjugate(fx[:numFreqs]) * fy[:numFreqs]
 
 # Scale the spectrum by the norm of the window to compensate for
- # windowing loss; see Bendat & Piersol Sec 11.5.2
- Pxy /= (np.abs(windowVals)**2).sum()
+ # windowing loss; see Bendat & Piersol Sec 11.5.2. Also include
+ # scaling factors for one-sided densities and dividing by the sampling
+ # frequency, if desired.
+ Pxy *= scaling_factor / (np.abs(windowVals)**2).sum()
 t = 1./Fs * (ind + NFFT / 2.)
 freqs = float(Fs) / pad_to * np.arange(numFreqs)
 
@@ -363,12 +382,18 @@
 *sides*: [ 'default' | 'onesided' | 'twosided' ]
 Specifies which sides of the PSD to return. Default gives the
 default behavior, which returns one-sided for real data and both
- for complex data. 'one' forces the return of a one-sided PSD, while
- 'both' forces two-sided.
+ for complex data. 'onesided' forces the return of a one-sided PSD,
+ while 'twosided' forces two-sided.
+
+ *scale_by_freq*: boolean
+ Specifies whether the resulting density values should be scaled
+ by the scaling frequency, which gives density in units of Hz^-1.
+ This allows for integration over the returned frequency values.
+ The default is True for MatLab compatibility.
 """
 
-def psd(x, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+def psd(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
 """
 The power spectral density by Welch's average periodogram method.
 The vector *x* is divided into *NFFT* length blocks. Each block
@@ -388,13 +413,14 @@
 Bendat & Piersol -- Random Data: Analysis and Measurement
 Procedures, John Wiley & Sons (1986)
 """
- Pxx,freqs = csd(x, x, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
+ Pxx,freqs = csd(x, x, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
 return Pxx.real,freqs
 
 psd.__doc__ = psd.__doc__ % kwdocd
 
-def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
 """
 The cross power spectral density by Welch's average periodogram
 method. The vectors *x* and *y* are divided into *NFFT* length
@@ -417,7 +443,7 @@
 Procedures, John Wiley & Sons (1986)
 """
 Pxy, freqs, t = _spectral_helper(x, y, NFFT, Fs, detrend, window,
- noverlap, pad_to, sides)
+ noverlap, pad_to, sides, scale_by_freq)
 
 if len(Pxy.shape) == 2 and Pxy.shape[1]>1:
 Pxy = Pxy.mean(axis=1)
@@ -425,9 +451,8 @@
 
 csd.__doc__ = csd.__doc__ % kwdocd
 
-def specgram(x, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=128, pad_to=None,
- sides='default'):
+def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=128, pad_to=None, sides='default', scale_by_freq=None):
 """
 Compute a spectrogram of data in *x*. Data are split into *NFFT*
 length segements and the PSD of each section is computed. The
@@ -458,7 +483,7 @@
 assert(NFFT > noverlap)
 
 Pxx, freqs, t = _spectral_helper(x, x, NFFT, Fs, detrend, window,
- noverlap, pad_to, sides)
+ noverlap, pad_to, sides, scale_by_freq)
 Pxx = Pxx.real #Needed since helper implements generically
 
 if (np.iscomplexobj(x) and sides == 'default') or sides == 'twosided':
@@ -473,8 +498,8 @@
 _coh_error = """Coherence is calculated by averaging over *NFFT*
 length segments. Your signal is too short for your choice of *NFFT*.
 """
-def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
 """
 The coherence between *x* and *y*. Coherence is the normalized
 cross spectral density:
@@ -487,7 +512,9 @@
 Array or sequence containing the data
 %(PSD)s
 The return value is the tuple (*Cxy*, *f*), where *f* are the
- frequencies of the coherence vector.
+ frequencies of the coherence vector. For cohere, scaling the
+ individual densities by the sampling frequency has no effect, since
+ the factors cancel out.
 
 .. seealso::
 :func:`psd` and :func:`csd`:
@@ -497,9 +524,12 @@
 
 if len(x)<2*NFFT:
 raise ValueError(_coh_error)
- Pxx, f = psd(x, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
- Pyy, f = psd(y, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
- Pxy, f = csd(x, y, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
+ Pxx, f = psd(x, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
+ Pyy, f = psd(y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
+ Pxy, f = csd(x, y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
 
 Cxy = np.divide(np.absolute(Pxy)**2, Pxx*Pyy)
 Cxy.shape = (len(f),)
@@ -3246,4 +3276,3 @@
 c2x, c2y = c1x + 1./3. * (q2x - q0x), c1y + 1./3. * (q2y - q0y)
 # c3x, c3y = q2x, q2y
 return q0x, q0y, c1x, c1y, c2x, c2y, q2x, q2y
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年12月08日 21:06:52
Revision: 6517
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6517&view=rev
Author: jdh2358
Date: 2008年12月08日 21:06:49 +0000 (2008年12月08日)
Log Message:
-----------
fixed inaxes event bug
Modified Paths:
--------------
 trunk/matplotlib/doc/_templates/gallery.html
 trunk/matplotlib/doc/users/mathtext.rst
 trunk/matplotlib/lib/matplotlib/backend_bases.py
 trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/doc/_templates/gallery.html
===================================================================
--- trunk/matplotlib/doc/_templates/gallery.html	2008年12月08日 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/doc/_templates/gallery.html	2008年12月08日 21:06:49 UTC (rev 6517)
@@ -53,6 +53,8 @@
 
 <a href="examples/api/two_scales.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/two_scales.png" border="0" alt="two_scales"/></a>
 
+<a href="examples/api/unicode_minus.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/unicode_minus.png" border="0" alt="unicode_minus"/></a>
+
 <a href="examples/api/watermark_image.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_image.png" border="0" alt="watermark_image"/></a>
 
 <a href="examples/api/watermark_text.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_text.png" border="0" alt="watermark_text"/></a>
@@ -217,8 +219,12 @@
 
 <a href="examples/pylab_examples/errorbar_limits.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_limits_01.png" border="0" alt="errorbar_limits"/></a>
 
+<a href="examples/pylab_examples/fancyarrow_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancyarrow_demo.png" border="0" alt="fancyarrow_demo"/></a>
+
 <a href="examples/pylab_examples/fancybox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo.png" border="0" alt="fancybox_demo"/></a>
 
+<a href="examples/pylab_examples/fancybox_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo2.png" border="0" alt="fancybox_demo2"/></a>
+
 <a href="examples/pylab_examples/fancytextbox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancytextbox_demo.png" border="0" alt="fancytextbox_demo"/></a>
 
 <a href="examples/pylab_examples/figimage_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figimage_demo.png" border="0" alt="figimage_demo"/></a>
@@ -333,6 +339,8 @@
 
 <a href="examples/pylab_examples/legend_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo2.png" border="0" alt="legend_demo2"/></a>
 
+<a href="examples/pylab_examples/legend_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo3.png" border="0" alt="legend_demo3"/></a>
+
 <a href="examples/pylab_examples/legend_scatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_scatter.png" border="0" alt="legend_scatter"/></a>
 
 <a href="examples/pylab_examples/line_collection.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_collection.png" border="0" alt="line_collection"/></a>
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst	2008年12月08日 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/doc/users/mathtext.rst	2008年12月08日 21:06:49 UTC (rev 6517)
@@ -143,8 +143,16 @@
 s(t) = \mathcal{A}\sin(2 \omega t)
 
 Here "s" and "t" are variable in italics font (default), "sin" is in
-Roman font, and the amplitude "A" is in calligraphy font.
+Roman font, and the amplitude "A" is in calligraphy font. Note in the
+example above the caligraphy ``A`` is squished into the ``sin``. You
+can use a spacing command to add a little whitespace between them::
 
+ s(t) = \mathcal{A}\/\sin(2 \omega t)
+
+.. math::
+
+ s(t) = \mathcal{A}\/\sin(2 \omega t)
+
 The choices available with all fonts are:
 
 ============================ ==================================
@@ -159,7 +167,7 @@
 .. role:: math-stix(math)
 :fontset: stix
 
-When using the STIX fonts, you also have the choice of:
+When using the `STIX <http://www.aip.org/stixfonts/>`_ fonts, you also have the choice of:
 
 ====================================== =========================================
 Command Result
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年12月08日 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2008年12月08日 21:06:49 UTC (rev 6517)
@@ -758,7 +758,7 @@
 
 if x is None or y is None:
 # cannot check if event was in axes if no x,y info
- self.inaxes = False
+ self.inaxes = None
 self._update_enter_leave()
 return
 
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py	2008年12月08日 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/lib/matplotlib/patches.py	2008年12月08日 21:06:49 UTC (rev 6517)
@@ -1382,9 +1382,9 @@
 for row in _table:
 for column, cell in zip(columns, row):
 column.append(cell)
- 
- 
 
+
+
 col_len = [max([len(cell) for cell in column]) for column in columns]
 
 lines = []
@@ -1394,10 +1394,10 @@
 lines.append(table_formatstr)
 lines.append(pad + ' '.join([cell.ljust(cl) for cell, cl in zip(_table[0], col_len)]))
 lines.append(table_formatstr)
- 
+
 lines.extend([(pad + ' '.join([cell.ljust(cl) for cell, cl in zip(row, col_len)]))
 for row in _table[1:]])
- 
+
 lines.append(table_formatstr)
 lines.append('')
 return "\n".join(lines)
@@ -1427,10 +1427,10 @@
 for argname, argdefault in zip(args[1:], defaults)]
 else:
 args = []
- 
+
 _table.append([cls.__name__, name,
 ",".join([("%s=%s" % (an, av)) for an, av in args])])
- 
+
 return _pprint_table(_table)
 
 
@@ -1448,7 +1448,7 @@
 
 # the "class" should have the _style_list attribute, which is
 # a dictionary of stylname, style class paie.
- 
+
 _list = stylename.replace(" ","").split(",")
 _name = _list[0].lower()
 try:
@@ -1492,20 +1492,20 @@
 
 BoxStyle.Round(pad=0.2)
 
- or 
+ or
 
 BoxStyle("Round", pad=0.2)
 
 or
- 
+
 BoxStyle("Round, pad=0.2")
 
 Following boxstyle classes are defined.
- 
+
 %(AvailableBoxstyles)s
 
 An instance of any boxstyle class is an callable object,
- whose call signature is
+ whose call signature is::
 
 __call__(self, x0, y0, width, height, mutation_size, aspect_ratio=1.)
 
@@ -1517,7 +1517,7 @@
 the mutation.
 
 """
- 
+
 _style_list = {}
 
 
@@ -1593,7 +1593,7 @@
 *pad*
 amount of padding
 """
- 
+
 self.pad = pad
 super(BoxStyle.Square, self).__init__()
 
@@ -1653,7 +1653,7 @@
 dxx = dx*.5
 # adjust x0. 1.4 <- sqrt(2)
 x0 = x0 + pad / 1.4
- 
+
 cp = [(x0+dxx, y0), (x1, y0), (x1, y1), (x0+dxx, y1),
 (x0+dxx, y1+dxx), (x0-dx, y0+dx), (x0+dxx, y0-dxx), # arrow
 (x0+dxx, y0), (x0+dxx, y0)]
@@ -1687,7 +1687,7 @@
 
 return p
 
- 
+
 _style_list["rarrow"] = RArrow
 
 
@@ -1770,7 +1770,7 @@
 *rounding_size*
 rounding size of edges. *pad* if None
 """
- 
+
 self.pad = pad
 self.rounding_size = rounding_size
 super(BoxStyle.Round4, self).__init__()
@@ -2038,8 +2038,8 @@
 self._bbox_transmuter = boxstyle
 else:
 self._bbox_transmuter = BoxStyle(boxstyle, **kw)
- 
 
+
 kwdoc = dict()
 kwdoc["AvailableBoxstyles"]=_pprint_styles(BoxStyle._style_list)
 kwdoc.update(artist.kwdocd)
@@ -2180,12 +2180,12 @@
 
 ConnectionStyle.Arc3(rad=0.2)
 
- or 
+ or
 
 ConnectionStyle("Arc3", rad=0.2)
 
 or
- 
+
 ConnectionStyle("Arc3, rad=0.2")
 
 Following classes are defined
@@ -2194,7 +2194,7 @@
 
 
 An instance of any connection style class is an callable object,
- whose call signature is
+ whose call signature is::
 
 __call__(self, posA, posB, patchA=None, patchB=None, shrinkA=2., shrinkB=2.)
 
@@ -2204,17 +2204,17 @@
 (or end) from the boundary of the patch. The path is further
 shrinked by *shrinkA* (or *shrinkB*) which is given in points.
 """
- 
+
 _style_list = {}
 
 
 class _Base(object):
 """
 A base class for connectionstyle classes. The dervided needs
- to implement a *connect* methods whose call signature is
+ to implement a *connect* methods whose call signature is::
 
 connect(posA, posB)
- 
+
 where posA and posB are tuples of x, y coordinates to be
 connected. The methods needs to return a path connecting two
 points. This base class defines a __call__ method, and few
@@ -2289,7 +2289,7 @@
 Calls the *connect* method to create a path between *posA*
 and *posB*. The path is clipped and shrinked.
 """
- 
+
 path = self.connect(posA, posB)
 
 clipped_path = self._clip(path, patchA, patchB)
@@ -2334,8 +2334,8 @@
 return Path(vertices, codes)
 
 _style_list["arc3"] = Arc3
- 
 
+
 class Angle3(_Base):
 """
 Creates a simple quadratic bezier curve between two
@@ -2448,16 +2448,16 @@
 def __init__(self, angleA=0, angleB=0, armA=None, armB=None, rad=0.):
 """
 *angleA* :
- starting angle of the path 
+ starting angle of the path
 
 *angleB* :
- ending angle of the path 
+ ending angle of the path
 
 *armA* :
- length of the starting arm 
+ length of the starting arm
 
 *armB* :
- length of the ending arm 
+ length of the ending arm
 
 *rad* :
 rounding radius of the edges
@@ -2531,9 +2531,9 @@
 
 __doc__ = cbook.dedent(__doc__) % \
 {"AvailableConnectorstyles": _pprint_styles(_style_list)}
- 
 
 
+
 class ArrowStyle(_Style):
 """
 :class:`ArrowStyle` is a container class which defines several
@@ -2543,12 +2543,12 @@
 A arrowstyle object can be either created as
 
 ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)
- or 
+ or
 
 ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)
 
 or
- 
+
 ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")
 
 Following classes are defined
@@ -2557,7 +2557,7 @@
 
 
 An instance of any arrow style class is an callable object,
- whose call signature is
+ whose call signature is::
 
 __call__(self, path, mutation_size, linewidth, aspect_ratio=1.)
 
@@ -2795,14 +2795,14 @@
 
 class CurveA(_Curve):
 """
- An arrow with a head at its begin point. 
+ An arrow with a head at its begin point.
 """
 
 def __init__(self, head_length=.4, head_width=.2):
 """
 *head_length*
 length of the arrow head
- 
+
 *head_width*
 width of the arrow head
 """
@@ -2816,14 +2816,14 @@
 
 class CurveB(_Curve):
 """
- An arrow with a head at its end point. 
+ An arrow with a head at its end point.
 """
 
 def __init__(self, head_length=.4, head_width=.2):
 """
 *head_length*
 length of the arrow head
- 
+
 *head_width*
 width of the arrow head
 """
@@ -2837,14 +2837,14 @@
 
 class CurveAB(_Curve):
 """
- An arrow with heads both at the begin and the end point. 
+ An arrow with heads both at the begin and the end point.
 """
 
 def __init__(self, head_length=.4, head_width=.2):
 """
 *head_length*
 length of the arrow head
- 
+
 *head_width*
 width of the arrow head
 """
@@ -2859,7 +2859,7 @@
 class _Bracket(_Base):
 
 def __init__(self, bracketA=None, bracketB=None,
- widthA=1., widthB=1., 
+ widthA=1., widthB=1.,
 lengthA=0.2, lengthB=0.2,
 angleA=None, angleB=None,
 scaleA=None, scaleB=None
@@ -2870,8 +2870,8 @@
 self.angleA, self.angleB = angleA, angleB
 self.scaleA, self.scaleB= scaleA, scaleB
 
- def _get_bracket(self, x0, y0, 
- cos_t, sin_t, width, length, 
+ def _get_bracket(self, x0, y0,
+ cos_t, sin_t, width, length,
 ):
 
 # arrow from x0, y0 to x1, y1
@@ -2949,10 +2949,10 @@
 """
 *widthB*
 width of the bracket
- 
+
 *lengthB*
 length of the bracket
- 
+
 *angleB*
 angle between the bracket and the line
 """
@@ -2975,12 +2975,12 @@
 
 *head_with*
 width of the arrow head
- 
+
 *tail_width*
 width of the arrow tail
 
 """
- 
+
 self.head_length, self.head_width, self.tail_width = \
 head_length, head_width, tail_width
 super(ArrowStyle.Simple, self).__init__()
@@ -3043,7 +3043,7 @@
 
 *head_with*
 width of the arrow head
- 
+
 *tail_width*
 width of the arrow tail
 
@@ -3140,7 +3140,7 @@
 Wedge(?) shape. Only wokrs with a quadratic bezier curve. The
 begin point has a width of the tail_width and the end point has a
 width of 0. At the middle, the width is shrink_factor*tail_width.
- 
+
 """
 
 def __init__(self, tail_width=.3, shrink_factor=0.5):
@@ -3151,7 +3151,7 @@
 *shrink_factor*
 fraction of the arrow width at the middle point
 """
- 
+
 self.tail_width = tail_width
 self.shrink_factor = shrink_factor
 super(ArrowStyle.Wedge, self).__init__()
@@ -3191,7 +3191,7 @@
 A fancy arrow patch. It draws an arrow using the :class:ArrowStyle.
 """
 
- 
+
 def __str__(self):
 return self.__class__.__name__ \
 + "FancyArrowPatch(%g,%g,%g,%g,%g,%g)" % tuple(self._q_bezier)
@@ -3340,8 +3340,8 @@
 self._connector = connectionstyle
 else:
 self._connector = ConnectionStyle(connectionstyle, **kw)
- 
 
+
 def get_connectionstyle(self):
 """
 Return the ConnectionStyle instance
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6516
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6516&view=rev
Author: ryanmay
Date: 2008年12月08日 20:21:33 +0000 (2008年12月08日)
Log Message:
-----------
Correct typo in comment.
Modified Paths:
--------------
 trunk/matplotlib/examples/pylab_examples/line_collection2.py
Modified: trunk/matplotlib/examples/pylab_examples/line_collection2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/line_collection2.py	2008年12月08日 17:05:28 UTC (rev 6515)
+++ trunk/matplotlib/examples/pylab_examples/line_collection2.py	2008年12月08日 20:21:33 UTC (rev 6516)
@@ -10,7 +10,7 @@
 # Here are many sets of y to plot vs x
 ys = [x+i for i in x]
 
-# We need to set the plot limits, the will not autoscale
+# We need to set the plot limits, they will not autoscale
 ax = axes()
 ax.set_xlim((amin(x),amax(x)))
 ax.set_ylim((amin(amin(ys)),amax(amax(ys))))
@@ -32,5 +32,3 @@
 ax.set_title('Line Collection with mapped colors')
 sci(line_segments) # This allows interactive changing of the colormap.
 show()
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年12月08日 17:05:31
Revision: 6515
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6515&view=rev
Author: mdboom
Date: 2008年12月08日 17:05:28 +0000 (2008年12月08日)
Log Message:
-----------
Updated changelog.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年12月08日 17:00:12 UTC (rev 6514)
+++ trunk/matplotlib/CHANGELOG	2008年12月08日 17:05:28 UTC (rev 6515)
@@ -1,3 +1,5 @@
+2008年12月08日 Fixed alignment of ticks in colorbars. -MGD
+
 2008年12月07日 drop the deprecated "new" keyword of np.histogram() for
 numpy 1.2 or later. -JJL
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <js...@us...> - 2008年12月08日 17:00:15
Revision: 6514
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6514&view=rev
Author: jswhit
Date: 2008年12月08日 17:00:12 +0000 (2008年12月08日)
Log Message:
-----------
fix drawlsmask so it works for cylindrical projections that have limits 
outside -180,180
Modified Paths:
--------------
 trunk/toolkits/basemap/Changelog
 trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog	2008年12月08日 16:31:48 UTC (rev 6513)
+++ trunk/toolkits/basemap/Changelog	2008年12月08日 17:00:12 UTC (rev 6514)
@@ -1,4 +1,6 @@
 version 0.99.2 (not yet released)
+ * fix drawlsmask method so that it works for cylindrical
+ projections with limits outside (-180,180).
 * added 'scale' keyword to bluemarble and warpimage methods to
 downsample image background.
 * Made lat_ts default to 0 for mercator.
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 16:31:48 UTC (rev 6513)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 17:00:12 UTC (rev 6514)
@@ -3082,12 +3082,25 @@
 lsmask_lats = np.arange(-90.+0.5*delta,90.,delta)
 lsmask = np.reshape(np.fromstring(lsmaskf.read(),np.uint8),(nlats,nlons))
 lsmaskf.close()
- # instance variable lsmask is set on first invocation,
- # it contains the land-sea mask interpolated to the native
- # projection grid. Further calls to drawlsmask will not
- # redo the interpolation (unless a new land-sea mask is passed
- # in via the lsmask, lsmask_lons, lsmask_lats keywords).
+ # instance variable lsmask is set on first invocation,
+ # it contains the land-sea mask interpolated to the native
+ # projection grid. Further calls to drawlsmask will not
+ # redo the interpolation (unless a new land-sea mask is passed
+ # in via the lsmask, lsmask_lons, lsmask_lats keywords).
 
+ # is it a cylindrical projection whose limits lie 
+ # outside the limits of the image?
+ cylproj = self.projection in _cylproj and \
+ (self.urcrnrlon > lsmask_lons[-1] or \
+ self.llcrnrlon < lsmask_lons[0])
+ if cylproj:
+ # stack grids side-by-side (in longitiudinal direction), so
+ # any range of longitudes may be plotted on a world map.
+ lsmask_lons = \
+ np.concatenate((lsmask_lons,lsmask_lons+360),1)
+ lsmask = \
+ np.concatenate((lsmask,lsmask),1)
+
 # transform mask to nx x ny regularly spaced native projection grid
 # nx and ny chosen to have roughly the same horizontal
 # resolution as mask.
@@ -3097,7 +3110,7 @@
 if self.projection == 'cyl':
 dx = lsmask_lons[1]-lsmask_lons[0]
 else:
- dx = 2.*math.pi*self.rmajor/float(nlons)
+ dx = (np.pi/180.)*(lsmask_lons[1]-lsmask_lons[0])*self.rmajor
 nx = int((self.xmax-self.xmin)/dx)+1; ny = int((self.ymax-self.ymin)/dx)+1
 # interpolate rgba values from proj='cyl' (geographic coords)
 # to a rectangular map projection grid.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <js...@us...> - 2008年12月08日 16:31:53
Revision: 6513
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6513&view=rev
Author: jswhit
Date: 2008年12月08日 16:31:48 +0000 (2008年12月08日)
Log Message:
-----------
added 'scale' keyword to bluemarble and warpimage to downsample background
image (replaces 'resolution' keyword from previous commit).
Modified Paths:
--------------
 trunk/toolkits/basemap/Changelog
 trunk/toolkits/basemap/examples/warpimage.py
 trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Removed Paths:
-------------
 trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog	2008年12月08日 16:10:50 UTC (rev 6512)
+++ trunk/toolkits/basemap/Changelog	2008年12月08日 16:31:48 UTC (rev 6513)
@@ -1,5 +1,6 @@
 version 0.99.2 (not yet released)
- * added half resolution blue marble image (resolution='low')
+ * added 'scale' keyword to bluemarble and warpimage methods to
+ downsample image background.
 * Made lat_ts default to 0 for mercator.
 * Now can specify just lon_0 for all cylindrical projections
 (to produce global map centered on lon_0).
Modified: trunk/toolkits/basemap/examples/warpimage.py
===================================================================
--- trunk/toolkits/basemap/examples/warpimage.py	2008年12月08日 16:10:50 UTC (rev 6512)
+++ trunk/toolkits/basemap/examples/warpimage.py	2008年12月08日 16:31:48 UTC (rev 6513)
@@ -24,7 +24,7 @@
 fig=plt.figure()
 # define projection centered on North America.
 m = Basemap(projection='mbtfpq',lon_0=-100,resolution='l')
-m.bluemarble(resolution='low')
+m.bluemarble(scale=0.5)
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw lat/lon grid lines every 30 degrees.
@@ -38,7 +38,7 @@
 # define cylindrical equidistant projection.
 m = Basemap(projection='cyl',llcrnrlon=-180,llcrnrlat=-90,urcrnrlon=180,urcrnrlat=90,resolution='l')
 # plot (unwarped) rgba image.
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw lat/lon grid lines.
@@ -52,7 +52,7 @@
 # define cylindrical equidistant projection.
 m = Basemap(projection='cyl',llcrnrlon=0,llcrnrlat=-60,urcrnrlon=360,urcrnrlat=60,resolution='l')
 # plot (unwarped) rgba image.
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw lat/lon grid lines.
@@ -81,7 +81,7 @@
 m = Basemap(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
 rsphere=(6378137.00,6356752.3142),lat_1=50.,lon_0=-107.,\
 resolution='i',area_thresh=1000.,projection='lcc')
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw parallels and meridians.
@@ -100,7 +100,7 @@
 resolution=None,projection='omerc',\
 lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55)
 # plot warped rgba image.
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
 # draw lat/lon grid lines every 20 degrees.
 m.drawmeridians(np.arange(0,360,20),color='0.5')
 m.drawparallels(np.arange(-80,81,20),color='0.5')
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 16:10:50 UTC (rev 6512)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 16:31:48 UTC (rev 6513)
@@ -3135,17 +3135,20 @@
 im = self.imshow(rgba,interpolation='nearest',ax=ax,**kwargs)
 return im
 
- def bluemarble(self,ax=None,resolution='high'):
+ def bluemarble(self,ax=None,scale=None):
 """
 display blue marble image (from http://visibleearth.nasa.gov)
 as map background.
+ Default image size is 5400x2700, which can be quite slow and
+ use quite a bit of memory. The ``scale`` keyword can be used
+ to downsample the image (``scale=0.5`` downsamples to 2700x1350).
 """
 if ax is not None:
- self.warpimage(image='bluemarble',ax=ax,resolution=resolution)
+ self.warpimage(image='bluemarble',ax=ax,scale=scale)
 else:
- self.warpimage(image='bluemarble',resolution=resolution)
+ self.warpimage(image='bluemarble',scale=scale)
 
- def warpimage(self,image="bluemarble",resolution='high',**kwargs):
+ def warpimage(self,image="bluemarble",scale=None,**kwargs):
 """
 Display an image (filename given by ``image`` keyword) as a map background.
 If image is a URL (starts with 'http'), it is downloaded to a temp
@@ -3159,6 +3162,10 @@
 Works with the global images from 
 http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php.
 
+ The ``scale`` keyword can be used to downsample (rescale) the image.
+ Values less than 1.0 will speed things up at the expense of image
+ resolution.
+
 Extra keyword ``ax`` can be used to override the default axis instance.
 
 \**kwargs passed on to :meth:`imshow`.
@@ -3181,10 +3188,7 @@
 # default image file is blue marble next generation
 # from NASA (http://visibleearth.nasa.gov).
 if image == "bluemarble":
- if resolution == 'low':
- file = os.path.join(basemap_datadir,'bmng_low.jpg')
- else:
- file = os.path.join(basemap_datadir,'bmng.jpg')
+ file = os.path.join(basemap_datadir,'bmng.jpg')
 else:
 file = image
 # if image is same as previous invocation, used cached data.
@@ -3206,6 +3210,11 @@
 # read in jpeg image to rgba array of normalized floats.
 if not hasattr(self,'_bm_rgba') or newfile:
 pilImage = Image.open(self._bm_file)
+ if scale is not None:
+ w, h = pilImage.size
+ width = int(np.round(w*scale))
+ height = int(np.round(h*scale))
+ pilImage = pilImage.resize((width,height),Image.ANTIALIAS)
 self._bm_rgba = pil_to_array(pilImage)
 # define lat/lon grid that image spans.
 nlons = self._bm_rgba.shape[1]; nlats = self._bm_rgba.shape[0]
Deleted: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年12月08日 16:10:52
Revision: 6512
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6512&view=rev
Author: mdboom
Date: 2008年12月08日 16:10:50 +0000 (2008年12月08日)
Log Message:
-----------
Fix tick alignment in colorbars.
Modified Paths:
--------------
 trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp	2008年12月08日 15:30:56 UTC (rev 6511)
+++ trunk/matplotlib/src/_backend_agg.cpp	2008年12月08日 16:10:50 UTC (rev 6512)
@@ -555,6 +555,8 @@
 
 if (has_clippath) {
 while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
+ x = mpl_round(x); y = mpl_round(y);
+
 	pixfmt_amask_type pfa(pixFmt, alphaMask);
 	amask_ren_type r(pfa);
 	amask_aa_renderer_type ren(r);
@@ -570,6 +572,8 @@
 }
 } else {
 while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
+ x = mpl_round(x); y = mpl_round(y);
+
 	if (face.first) {
 	 rendererAA.color(face.second);
 	 sa.init(fillCache, fillSize, x, y);
@@ -1179,7 +1183,7 @@
 PathListGenerator path_generator(paths);
 
 try {
- _draw_path_collection_generic<PathListGenerator, 1, 1>
+ _draw_path_collection_generic<PathListGenerator, 0, 1>
 (master_transform,
 cliprect,
 clippath,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年12月08日 15:30:58
Revision: 6511
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6511&view=rev
Author: jdh2358
Date: 2008年12月08日 15:30:56 +0000 (2008年12月08日)
Log Message:
-----------
added rc param to control legend fancybox
Modified Paths:
--------------
 trunk/matplotlib/examples/pylab_examples/legend_demo.py
 trunk/matplotlib/examples/pylab_examples/legend_demo3.py
 trunk/matplotlib/lib/matplotlib/legend.py
 trunk/matplotlib/lib/matplotlib/rcsetup.py
 trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo.py	2008年12月08日 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo.py	2008年12月08日 15:30:56 UTC (rev 6511)
@@ -15,7 +15,7 @@
 ax = plt.subplot(111)
 plt.plot(a,c,'k--',a,d,'k:',a,c+d,'k')
 plt.legend(('Model length', 'Data length', 'Total message length'),
- 'upper center', shadow=True)
+ 'upper center', shadow=True, fancybox=True)
 plt.ylim([-1,20])
 plt.grid(False)
 plt.xlabel('Model complexity --->')
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo3.py	2008年12月08日 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo3.py	2008年12月08日 15:30:56 UTC (rev 6511)
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
-
+import matplotlib
+matplotlib.rcParams['legend.fancybox'] = True
 import matplotlib.pyplot as plt
 import numpy as np
 import pylab
@@ -22,7 +23,7 @@
 
 ax3 = plt.subplot(3,1,3)
 myplot(ax3)
-ax3.legend(loc=1, ncol=4, mode="expand", fancybox=False, shadow=True)
+ax3.legend(loc=1, ncol=4, mode="expand", shadow=True)
 
 
 #title('Damped oscillation')
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py	2008年12月08日 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/lib/matplotlib/legend.py	2008年12月08日 15:30:56 UTC (rev 6511)
@@ -63,7 +63,7 @@
 
 loc can be a tuple of the noramilzed coordinate values with
 respect its parent.
- 
+
 Return value is a sequence of text, line instances that make
 up the legend
 """
@@ -94,15 +94,15 @@
 scatterpoints = 3, # TODO: may be an rcParam
 scatteryoffsets=None,
 prop = None, # properties for the legend texts
- 
+
 # the following dimensions are in axes coords
 pad = None, # deprecated; use borderpad
- labelsep = None, # deprecated; use labelspacing 
- handlelen = None, # deprecated; use handlelength 
- handletextsep = None, # deprecated; use handletextpad 
+ labelsep = None, # deprecated; use labelspacing
+ handlelen = None, # deprecated; use handlelength
+ handletextsep = None, # deprecated; use handletextpad
 axespad = None, # deprecated; use borderaxespad
 
- # spacing & pad defined as a fractionof the font-size 
+ # spacing & pad defined as a fractionof 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
@@ -113,7 +113,7 @@
 ncol=1, # number of columns
 mode=None, # mode for horizontal distribution of columns. None, "expand"
 
- fancybox=True,
+ fancybox=None, # True use a fancy box, false use a rounded box, none use rc
 shadow = None,
 ):
 """
@@ -131,7 +131,7 @@
 numpoints the number of points in the legend line
 prop the font property
 markerscale the relative size of legend markers vs. original
- fancybox if True, draw a frame with a round fancybox.
+ fancybox if True, draw a frame with a round fancybox. If None, use rc
 shadow if True, draw a shadow behind legend
 scatteryoffsets a list of yoffsets for scatter symbols in legend
 
@@ -144,7 +144,7 @@
 
 The dimensions of pad and spacing are given as a fraction of the
 fontsize. Values from rcParams will be used if None.
- 
+
 """
 from matplotlib.axes import Axes # local import only to avoid circularity
 from matplotlib.figure import Figure # local import only to avoid circularity
@@ -172,7 +172,7 @@
 # Take care the deprecated keywords
 deprecated_kwds = {"pad":"borderpad",
 "labelsep":"labelspacing",
- "handlelen":"handlelength", 
+ "handlelen":"handlelength",
 "handletextsep":"handletextpad",
 "axespad":"borderaxespad"}
 
@@ -182,7 +182,7 @@
 # conversion factor
 bbox = parent.bbox
 axessize_fontsize = min(bbox.width, bbox.height)/self.fontsize
- 
+
 for k, v in deprecated_kwds.items():
 # use deprecated value if not None and if their newer
 # counter part is None.
@@ -199,7 +199,7 @@
 setattr(self, v, localdict[v])
 
 del localdict
- 
+
 self._ncol = ncol
 
 if self.numpoints <= 0:
@@ -265,6 +265,9 @@
 # The width and height of the legendPatch will be set (in the
 # draw()) to the length that includes the padding. Thus we set
 # pad=0 here.
+ if fancybox is None:
+ fancybox = rcParams["legend.fancybox"]
+
 if fancybox == True:
 self.legendPatch.set_boxstyle("round",pad=0,
 rounding_size=0.2)
@@ -318,7 +321,7 @@
 
 # find_offset function will be provided to _legend_box and
 # _legend_box will draw itself at the location of the return
- # value of the find_offset. 
+ # value of the find_offset.
 if self._loc == 0:
 self._legend_box.set_offset(self._findoffset_best)
 else:
@@ -339,7 +342,7 @@
 if self.shadow:
 shadow = Shadow(self.legendPatch, 2, -2)
 shadow.draw(renderer)
- 
+
 self.legendPatch.draw(renderer)
 
 self._legend_box.draw(renderer)
@@ -360,7 +363,7 @@
 Initiallize the legend_box. The legend_box is an instance of
 the OffsetBox, which is packed with legend handles and
 texts. Once packed, their location is calculated during the
- drawing time. 
+ drawing time.
 """
 
 # legend_box is a HPacker, horizontally packed with
@@ -371,7 +374,7 @@
 # is an instance of offsetbox.TextArea which contains legend
 # text.
 
- 
+
 text_list = [] # the list of text instances
 handle_list = [] # the list of text instances
 
@@ -394,12 +397,12 @@
 # The approximate height and descent of text. These values are
 # only used for plotting the legend handle.
 height = self._approx_text_height() * 0.7
- descent = 0. 
+ descent = 0.
 
 # each handle needs to be drawn inside a box of
 # (x, y, w, h) = (0, -descent, width, height).
 # And their corrdinates should be given in the display coordinates.
- 
+
 # The transformation of each handle will be automatically set
 # to self.get_trasnform(). If the artist does not uses its
 # default trasnform (eg, Collections), you need to
@@ -413,7 +416,7 @@
 if npoints > 1:
 # we put some pad here to compensate the size of the
 # marker
- xdata = np.linspace(0.3*self.fontsize, 
+ xdata = np.linspace(0.3*self.fontsize,
 (self.handlelength-0.3)*self.fontsize,
 npoints)
 xdata_marker = xdata
@@ -484,14 +487,14 @@
 size_min]
 else:
 sizes = (size_max-size_min)*np.linspace(0,1,self.scatterpoints)+size_min
- 
+
 p = type(handle)(handle.get_numsides(),
 rotation=handle.get_rotation(),
 sizes=sizes,
 offsets=zip(xdata_marker,ydata),
 transOffset=self.get_transform(),
 )
- 
+
 p.update_from(handle)
 p.set_figure(self.figure)
 p.set_clip_box(None)
@@ -534,7 +537,7 @@
 for h, t in handle_label[i0:i0+di]]
 # minimumdescent=False for the text of the last row of the column
 itemBoxes[-1].get_children()[1].set_minimumdescent(False)
- 
+
 # pack columnBox
 columnbox.append(VPacker(pad=0,
 sep=self.labelspacing*self.fontsize,
@@ -547,7 +550,7 @@
 mode = "fixed"
 
 sep = self.columnspacing*self.fontsize
- 
+
 self._legend_box = HPacker(pad=self.borderpad*self.fontsize,
 sep=sep, align="baseline",
 mode=mode,
@@ -555,8 +558,8 @@
 
 self.texts = text_list
 self.legendHandles = handle_list
- 
 
+
 def _auto_legend_data(self):
 """
 Returns list of vertices and extents covered by the plot.
@@ -655,12 +658,12 @@
 LC:"S",
 UC:"N",
 C:"C"}
- 
+
 c = anchor_coefs[loc]
 
 container = parentbbox.padded(-(self.borderaxespad) * self.fontsize)
 anchored_box = bbox.anchored(c, container=container)
- return anchored_box.x0, anchored_box.y0 
+ return anchored_box.x0, anchored_box.y0
 
 
 def _find_best_position(self, width, height, consider=None):
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py	2008年12月08日 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py	2008年12月08日 15:30:56 UTC (rev 6511)
@@ -417,6 +417,7 @@
 'polaraxes.grid' : [True, validate_bool], # display polar grid or not
 
 #legend properties
+ 'legend.fancybox' : [False,validate_bool],
 'legend.loc' : ['upper right',validate_legend_loc], # at some point, this should be changed to 'best'
 '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
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template	2008年12月08日 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/matplotlibrc.template	2008年12月08日 15:30:56 UTC (rev 6511)
@@ -235,6 +235,8 @@
 #grid.linewidth : 0.5 # in points
 
 ### Legend
+#legend.fancybox : False # if True, use a rounded box for the
+ # legend, else a rectangle
 #legend.isaxes : True
 #legend.numpoints : 2 # the number of points in the legend line
 #legend.fontsize : large
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <js...@us...> - 2008年12月08日 15:10:22
Revision: 6510
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6510&view=rev
Author: jswhit
Date: 2008年12月08日 15:10:20 +0000 (2008年12月08日)
Log Message:
-----------
use low resolution blue marble background
Modified Paths:
--------------
 trunk/toolkits/basemap/examples/warpimage.py
Modified: trunk/toolkits/basemap/examples/warpimage.py
===================================================================
--- trunk/toolkits/basemap/examples/warpimage.py	2008年12月08日 14:53:55 UTC (rev 6509)
+++ trunk/toolkits/basemap/examples/warpimage.py	2008年12月08日 15:10:20 UTC (rev 6510)
@@ -24,7 +24,7 @@
 fig=plt.figure()
 # define projection centered on North America.
 m = Basemap(projection='mbtfpq',lon_0=-100,resolution='l')
-m.bluemarble()
+m.bluemarble(resolution='low')
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw lat/lon grid lines every 30 degrees.
@@ -38,7 +38,7 @@
 # define cylindrical equidistant projection.
 m = Basemap(projection='cyl',llcrnrlon=-180,llcrnrlat=-90,urcrnrlon=180,urcrnrlat=90,resolution='l')
 # plot (unwarped) rgba image.
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw lat/lon grid lines.
@@ -52,7 +52,7 @@
 # define cylindrical equidistant projection.
 m = Basemap(projection='cyl',llcrnrlon=0,llcrnrlat=-60,urcrnrlon=360,urcrnrlat=60,resolution='l')
 # plot (unwarped) rgba image.
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw lat/lon grid lines.
@@ -81,7 +81,7 @@
 m = Basemap(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
 rsphere=(6378137.00,6356752.3142),lat_1=50.,lon_0=-107.,\
 resolution='i',area_thresh=1000.,projection='lcc')
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
 # draw coastlines.
 m.drawcoastlines(linewidth=0.5,color='0.5')
 # draw parallels and meridians.
@@ -100,7 +100,7 @@
 resolution=None,projection='omerc',\
 lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55)
 # plot warped rgba image.
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
 # draw lat/lon grid lines every 20 degrees.
 m.drawmeridians(np.arange(0,360,20),color='0.5')
 m.drawparallels(np.arange(-80,81,20),color='0.5')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <js...@us...> - 2008年12月08日 14:53:59
Revision: 6509
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6509&view=rev
Author: jswhit
Date: 2008年12月08日 14:53:55 +0000 (2008年12月08日)
Log Message:
-----------
added low resolution option for blue marble background.
Modified Paths:
--------------
 trunk/toolkits/basemap/Changelog
 trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Added Paths:
-----------
 trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog	2008年12月08日 12:52:29 UTC (rev 6508)
+++ trunk/toolkits/basemap/Changelog	2008年12月08日 14:53:55 UTC (rev 6509)
@@ -1,4 +1,5 @@
 version 0.99.2 (not yet released)
+ * added half resolution blue marble image (resolution='low')
 * Made lat_ts default to 0 for mercator.
 * Now can specify just lon_0 for all cylindrical projections
 (to produce global map centered on lon_0).
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 12:52:29 UTC (rev 6508)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 14:53:55 UTC (rev 6509)
@@ -3135,17 +3135,17 @@
 im = self.imshow(rgba,interpolation='nearest',ax=ax,**kwargs)
 return im
 
- def bluemarble(self,ax=None):
+ def bluemarble(self,ax=None,resolution='high'):
 """
 display blue marble image (from http://visibleearth.nasa.gov)
 as map background.
 """
 if ax is not None:
- self.warpimage(image='bluemarble',ax=ax)
+ self.warpimage(image='bluemarble',ax=ax,resolution=resolution)
 else:
- self.warpimage(image='bluemarble')
+ self.warpimage(image='bluemarble',resolution=resolution)
 
- def warpimage(self,image="bluemarble",**kwargs):
+ def warpimage(self,image="bluemarble",resolution='high',**kwargs):
 """
 Display an image (filename given by ``image`` keyword) as a map background.
 If image is a URL (starts with 'http'), it is downloaded to a temp
@@ -3181,7 +3181,10 @@
 # default image file is blue marble next generation
 # from NASA (http://visibleearth.nasa.gov).
 if image == "bluemarble":
- file = os.path.join(basemap_datadir,'bmng.jpg')
+ if resolution == 'low':
+ file = os.path.join(basemap_datadir,'bmng_low.jpg')
+ else:
+ file = os.path.join(basemap_datadir,'bmng.jpg')
 else:
 file = image
 # if image is same as previous invocation, used cached data.
Added: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
___________________________________________________________________
Added: svn:mime-type
 + application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <js...@us...> - 2008年12月08日 12:52:33
Revision: 6508
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6508&view=rev
Author: jswhit
Date: 2008年12月08日 12:52:29 +0000 (2008年12月08日)
Log Message:
-----------
lat_ts now defaults to 0 for mercator.
Modified Paths:
--------------
 trunk/toolkits/basemap/Changelog
 trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog	2008年12月08日 12:44:41 UTC (rev 6507)
+++ trunk/toolkits/basemap/Changelog	2008年12月08日 12:52:29 UTC (rev 6508)
@@ -1,4 +1,5 @@
 version 0.99.2 (not yet released)
+ * Made lat_ts default to 0 for mercator.
 * Now can specify just lon_0 for all cylindrical projections
 (to produce global map centered on lon_0).
 * Added save_background.py example, showing how to re-use
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 12:44:41 UTC (rev 6507)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 12:52:29 UTC (rev 6508)
@@ -261,9 +261,10 @@
 ================ ====================================================
 Keyword Description
 ================ ====================================================
- lat_ts latitude of true scale.
- optional for stereographic projection.
- mandatory for mercator projection.
+ lat_ts latitude of true scale. Optional for stereographic
+ and mercator projections.
+ default is lat_0 for stereographic projection.
+ default is 0 for mercator projection.
 lat_1 first standard parallel for lambert conformal, 
 albers equal area and equidistant conic.
 Latitude of one of the two points on the projection 
@@ -285,7 +286,7 @@
 not be rotated to true North. Default is False
 (projection coordinates are automatically rotated).
 lat_0 central latitude (y-axis origin) - used by all 
- projections, Must be equator for mercator projection.
+ projections. 
 lon_0 central meridian (x-axis origin) - used by all
 projections.
 boundinglat bounding latitude for pole-centered projections
@@ -624,6 +625,10 @@
 self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
 self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
 elif projection in _cylproj:
+ if projection == 'merc':
+ if lat_ts is None: 
+ lat_ts = 0.
+ projparams['lat_ts']=lat_ts
 if not using_corners:
 llcrnrlat = -90.
 urcrnrlat = 90.
@@ -634,8 +639,7 @@
 llcrnrlon = -180.
 urcrnrlon = 180
 if projection == 'merc':
- if lat_ts is None:
- raise ValueError, 'must specify lat_ts for Mercator basemap'
+ if lat_ts is None: lat_ts = 0.
 # clip plot region to be within -89.99S to 89.99N
 # (mercator is singular at poles)
 if llcrnrlat < -89.99: llcrnrlat = -89.99
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <js...@us...> - 2008年12月08日 12:44:46
Revision: 6507
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6507&view=rev
Author: jswhit
Date: 2008年12月08日 12:44:41 +0000 (2008年12月08日)
Log Message:
-----------
now can specify just lon_0 to define global cylindrical projection 
centered on lon_0.
Modified Paths:
--------------
 trunk/toolkits/basemap/Changelog
 trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog	2008年12月08日 12:31:06 UTC (rev 6506)
+++ trunk/toolkits/basemap/Changelog	2008年12月08日 12:44:41 UTC (rev 6507)
@@ -1,4 +1,6 @@
 version 0.99.2 (not yet released)
+ * Now can specify just lon_0 for all cylindrical projections
+ (to produce global map centered on lon_0).
 * Added save_background.py example, showing how to re-use
 a map background without redrawing coastlines.
 * Added embedding_map_in_wx.py example (courtesy of
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 12:31:06 UTC (rev 6506)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py	2008年12月08日 12:44:41 UTC (rev 6507)
@@ -261,8 +261,9 @@
 ================ ====================================================
 Keyword Description
 ================ ====================================================
- lat_ts latitude of true scale for mercator projection,
+ lat_ts latitude of true scale.
 optional for stereographic projection.
+ mandatory for mercator projection.
 lat_1 first standard parallel for lambert conformal, 
 albers equal area and equidistant conic.
 Latitude of one of the two points on the projection 
@@ -532,24 +533,6 @@
 llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat = _choosecorners(width,height,**projparams)
 self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
 self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- elif projection == 'merc':
- if lat_ts is None:
- raise ValueError, 'must specify lat_ts for Mercator basemap'
- # clip plot region to be within -89.99S to 89.99N
- # (mercator is singular at poles)
- if not using_corners:
- llcrnrlon = -180.
- llcrnrlat = -90.
- urcrnrlon = 180
- urcrnrlat = 90.
- if llcrnrlat < -89.99: llcrnrlat = -89.99
- if llcrnrlat > 89.99: llcrnrlat = 89.99
- if urcrnrlat < -89.99: urcrnrlat = -89.99
- if urcrnrlat > 89.99: urcrnrlat = 89.99
- self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
- self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- if width is not None or height is not None:
- print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection]
 elif projection in ['tmerc','gnom','cass','poly'] :
 if projection == 'gnom' and not projparams.has_key('R'):
 raise ValueError, 'gnomonic projection only works for perfect spheres - not ellipsoids'
@@ -640,26 +623,29 @@
 llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat = _choosecorners(width,height,**projparams)
 self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
 self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- elif projection in ['mill','gall']:
+ elif projection in _cylproj:
 if not using_corners:
- llcrnrlon = -180.
 llcrnrlat = -90.
- urcrnrlon = 180
 urcrnrlat = 90.
+ if lon_0 is not None:
+ llcrnrlon = lon_0-180.
+ urcrnrlon = lon_0+180.
+ else:
+ llcrnrlon = -180.
+ urcrnrlon = 180
+ if projection == 'merc':
+ if lat_ts is None:
+ raise ValueError, 'must specify lat_ts for Mercator basemap'
+ # clip plot region to be within -89.99S to 89.99N
+ # (mercator is singular at poles)
+ if llcrnrlat < -89.99: llcrnrlat = -89.99
+ if llcrnrlat > 89.99: llcrnrlat = 89.99
+ if urcrnrlat < -89.99: urcrnrlat = -89.99
+ if urcrnrlat > 89.99: urcrnrlat = 89.99
 self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
 self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
 if width is not None or height is not None:
 print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection]
- elif projection == 'cyl':
- if not using_corners:
- llcrnrlon = -180.
- llcrnrlat = -90.
- urcrnrlon = 180
- urcrnrlat = 90.
- self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
- self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- if width is not None or height is not None:
- print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection]
 else:
 raise ValueError(_unsupported_projection % projection)
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jo...@us...> - 2008年12月08日 12:31:08
Revision: 6506
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6506&view=rev
Author: jouni
Date: 2008年12月08日 12:31:06 +0000 (2008年12月08日)
Log Message:
-----------
Other part of symlog bugfix (and deactivating an experimental type1font that slipped in by accident)
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/scale.py
 trunk/matplotlib/lib/matplotlib/type1font.py
Modified: trunk/matplotlib/lib/matplotlib/scale.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/scale.py	2008年12月08日 12:26:53 UTC (rev 6505)
+++ trunk/matplotlib/lib/matplotlib/scale.py	2008年12月08日 12:31:06 UTC (rev 6506)
@@ -329,6 +329,7 @@
 self._linadjust = linthresh / (np.log(linthresh) / self._log_base)
 
 def transform(self, a):
+ a = np.asarray(a)
 return np.where(a <= self._log_linthresh,
 np.where(a >= -self._log_linthresh,
 a * self._linadjust,
Modified: trunk/matplotlib/lib/matplotlib/type1font.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/type1font.py	2008年12月08日 12:26:53 UTC (rev 6505)
+++ trunk/matplotlib/lib/matplotlib/type1font.py	2008年12月08日 12:31:06 UTC (rev 6506)
@@ -29,7 +29,7 @@
 finally:
 file.close()
 self.parts = self._split(data)
- self._parse()
+ #self._parse()
 
 def _read(self, file):
 rawdata = file.read()
@@ -180,5 +180,5 @@
 font = Type1Font(sys.argv[1])
 parts = font.parts
 print len(parts[0]), len(parts[1]), len(parts[2])
- print parts[0][font.enc_starts:font.enc_ends]
+ #print parts[0][font.enc_starts:font.enc_ends]
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jo...@us...> - 2008年12月08日 12:26:58
Revision: 6505
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6505&view=rev
Author: jouni
Date: 2008年12月08日 12:26:53 +0000 (2008年12月08日)
Log Message:
-----------
Fix SymmetricalLogLocator bug that caused platform-specific behavior
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/scale.py
 trunk/matplotlib/lib/matplotlib/type1font.py
Modified: trunk/matplotlib/lib/matplotlib/scale.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/scale.py	2008年12月07日 20:52:13 UTC (rev 6504)
+++ trunk/matplotlib/lib/matplotlib/scale.py	2008年12月08日 12:26:53 UTC (rev 6505)
@@ -301,7 +301,8 @@
 self._linadjust = (np.log(linthresh) / self._log_base) / linthresh
 
 def transform(self, a):
- sign = np.sign(np.asarray(a))
+ a = np.asarray(a)
+ sign = np.sign(a)
 masked = ma.masked_inside(a, -self.linthresh, self.linthresh, copy=False)
 log = sign * ma.log(np.abs(masked)) / self._log_base
 if masked.mask.any():
Modified: trunk/matplotlib/lib/matplotlib/type1font.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/type1font.py	2008年12月07日 20:52:13 UTC (rev 6504)
+++ trunk/matplotlib/lib/matplotlib/type1font.py	2008年12月08日 12:26:53 UTC (rev 6505)
@@ -17,6 +17,7 @@
 Systems Incorporated, third printing, v1.1, 1993. ISBN 0-201-57044-0.
 """
 
+import re
 import struct
 
 class Type1Font(object):
@@ -28,6 +29,7 @@
 finally:
 file.close()
 self.parts = self._split(data)
+ self._parse()
 
 def _read(self, file):
 rawdata = file.read()
@@ -97,8 +99,86 @@
 
 return data[:len1], binary, data[idx:]
 
+ _whitespace = re.compile(r'[0円\t\r014円\n ]+')
+ _delim = re.compile(r'[()<>[]{}/%]')
+ _token = re.compile(r'/{0,2}[^]0円\t\r\v\n ()<>{}/%[]+')
+ _comment = re.compile(r'%[^\r\n\v]*')
+ _instring = re.compile(r'[()\\]')
+ def _parse(self):
+ """
+ A very limited kind of parsing to find the Encoding of the
+ font.
+ """
+ def tokens(text):
+ """
+ Yield pairs (position, token), ignoring comments and
+ whitespace. Numbers count as tokens.
+ """
+ pos = 0
+ while pos < len(text):
+ match = self._comment.match(text[pos:]) or self._whitespace.match(text[pos:])
+ if match:
+ pos += match.end()
+ elif text[pos] == '(':
+ start = pos
+ pos += 1
+ depth = 1
+ while depth:
+ match = self._instring.search(text[pos:])
+ if match is None: return
+ if match.group() == '(':
+ depth += 1
+ pos += 1
+ elif match.group() == ')':
+ depth -= 1
+ pos += 1
+ else:
+ pos += 2
+ yield (start, text[start:pos])
+ elif text[pos:pos+2] in ('<<', '>>'):
+ yield (pos, text[pos:pos+2])
+ pos += 2
+ elif text[pos] == '<':
+ start = pos
+ pos += text[pos:].index('>')
+ yield (start, text[start:pos])
+ else:
+ match = self._token.match(text[pos:])
+ if match:
+ yield (pos, match.group())
+ pos += match.end()
+ else:
+ yield (pos, text[pos])
+ pos += 1
+
+ enc_starts, enc_ends = None, None
+ state = 0
+ # State transitions:
+ # 0 -> /Encoding -> 1
+ # 1 -> StandardEncoding -> 2 -> def -> (ends)
+ # 1 -> dup -> 4 -> put -> 5
+ # 5 -> dup -> 4 -> put -> 5
+ # 5 -> def -> (ends)
+ for pos,token in tokens(self.parts[0]):
+ if state == 0 and token == '/Encoding':
+ enc_starts = pos
+ state = 1
+ elif state == 1 and token == 'StandardEncoding':
+ state = 2
+ elif state in (2,5) and token == 'def':
+ enc_ends = pos+3
+ break
+ elif state in (1,5) and token == 'dup':
+ state = 4
+ elif state == 4 and token == 'put':
+ state = 5
+ self.enc_starts, self.enc_ends = enc_starts, enc_ends
+ 
+ 
 if __name__ == '__main__':
 import sys
 font = Type1Font(sys.argv[1])
 parts = font.parts
 print len(parts[0]), len(parts[1]), len(parts[2])
+ print parts[0][font.enc_starts:font.enc_ends]
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 22 results of 22

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





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

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

More information about our ad policies

Ad destination/click URL:

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