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
(3) |
2
(3) |
3
|
4
(2) |
5
(9) |
6
(4) |
7
(9) |
8
(7) |
9
(2) |
10
(3) |
11
(2) |
12
|
13
(2) |
14
(10) |
15
(24) |
16
(17) |
17
(21) |
18
(3) |
19
(23) |
20
(6) |
21
(4) |
22
(14) |
23
(11) |
24
(15) |
25
(6) |
26
(1) |
27
(4) |
28
(3) |
29
(9) |
30
(6) |
31
(2) |
|
Revision: 6232 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6232&view=rev Author: efiring Date: 2008年10月16日 21:21:58 +0000 (2008年10月16日) Log Message: ----------- Make transforms.nonsingular handle inf and nan sensibly. Without this, trying to plot a line with all data masked would raise an exception via the autoscaling. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/transforms.py Modified: trunk/matplotlib/lib/matplotlib/transforms.py =================================================================== --- trunk/matplotlib/lib/matplotlib/transforms.py 2008年10月16日 20:58:07 UTC (rev 6231) +++ trunk/matplotlib/lib/matplotlib/transforms.py 2008年10月16日 21:21:58 UTC (rev 6232) @@ -2157,7 +2157,7 @@ def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True): ''' - Ensure the endpoints of a range are not too close together. + Ensure the endpoints of a range are finite and not too close together. "too close" means the interval is smaller than 'tiny' times the maximum absolute value. @@ -2165,7 +2165,11 @@ If they are too close, each will be moved by the 'expander'. If 'increasing' is True and vmin > vmax, they will be swapped, regardless of whether they are too close. + + If either is inf or -inf or nan, return - expander, expander. ''' + if (not np.isfinite(vmin)) or (not np.isfinite(vmax)): + return -expander, expander swapped = False if vmax < vmin: vmin, vmax = vmax, vmin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6231 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6231&view=rev Author: jdh2358 Date: 2008年10月16日 20:58:07 +0000 (2008年10月16日) Log Message: ----------- fix error in sidebar Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 20:52:08 UTC (rev 6230) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 20:58:07 UTC (rev 6231) @@ -18,7 +18,7 @@ <a href=http://www.nabble.com/matplotlib---users-f2906.html>archives</a>, and join the matplotlib mailing <a href="http://sourceforge.net/mail/?group_id=80706">lists</a>. -The <a href="{{ pathto('search') }}">search</a>| </li> tool +The <a href="{{ pathto('search') }}">search</a> tool searches all of the documentation, including full text search of almost 300 complete examples which exercise almost every corner of matplotlib. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6230 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6230&view=rev Author: jdh2358 Date: 2008年10月16日 20:52:08 +0000 (2008年10月16日) Log Message: ----------- finished the first cut at the examples for search support Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html trunk/matplotlib/doc/_templates/layout.html trunk/matplotlib/doc/examples/gen_rst.py trunk/matplotlib/doc/make.py Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 19:50:05 UTC (rev 6229) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 20:52:08 UTC (rev 6230) @@ -12,10 +12,16 @@ </p> <h3>Need help?</h3> -<p>Check the <a href="{{ pathto('users/index') }}">user</a> guide, the <a -href="{{ pathto('faq/index') }}">faq</a>, the <a href="{{ -pathto('api/index') }}"}>api</a> docs, <a href=http://www.nabble.com/matplotlib---users-f2906.html>archives</a>, and join the matplotlib mailing <a -href="http://sourceforge.net/mail/?group_id=80706">lists</a> +<p>Check the <a href="{{ pathto('users/index') }}">user</a> guide, +the <a href="{{ pathto('faq/index') }}">faq</a>, the <a href="{{ +pathto('api/index') }}"}>api</a> docs, +<a href=http://www.nabble.com/matplotlib---users-f2906.html>archives</a>, +and join the matplotlib +mailing <a href="http://sourceforge.net/mail/?group_id=80706">lists</a>. +The <a href="{{ pathto('search') }}">search</a>| </li> tool +searches all of the documentation, including full text search of +almost 300 complete examples which exercise almost every corner of +matplotlib. <p>You can file bugs, patches and feature requests on the sourceforge <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>, but it is a good idea to ping us on the mailing list too.</p> @@ -24,7 +30,7 @@ <a href="{{ pathto('users/screenshots') }}"><img align=center src="{{ pathto('_static/logo_sidebar.png', 1) }} "border="0"></a> -<a href="{{ pathto('users/screenshots') }}">screenshots</a> and <a href=examples>examples</a> +<a href="{{ pathto('users/screenshots') }}">screenshots</a> and <a href=examples/index.html>examples</a> <h3>Other stuff</h3> Modified: trunk/matplotlib/doc/_templates/layout.html =================================================================== --- trunk/matplotlib/doc/_templates/layout.html 2008年10月16日 19:50:05 UTC (rev 6229) +++ trunk/matplotlib/doc/_templates/layout.html 2008年10月16日 20:52:08 UTC (rev 6230) @@ -1,7 +1,8 @@ {% extends "!layout.html" %} {% block rootrellink %} - <li><a href="{{ pathto('index') }}">matplotlib home </a> | </li> + <li><a href="{{ pathto('index') }}">matplotlib home</a>| </li> + <li><a href="{{ pathto('search') }}">search</a>| </li> <li><a href="{{ pathto('contents') }}">documentation </a> »</li> {% endblock %} Modified: trunk/matplotlib/doc/examples/gen_rst.py =================================================================== --- trunk/matplotlib/doc/examples/gen_rst.py 2008年10月16日 19:50:05 UTC (rev 6229) +++ trunk/matplotlib/doc/examples/gen_rst.py 2008年10月16日 20:52:08 UTC (rev 6230) @@ -14,14 +14,13 @@ datad = {} for root, subFolders, files in os.walk(rootdir): for fname in files: - if ( fname.startswith('.') or fname.startswith('#') or + if ( fname.startswith('.') or fname.startswith('#') or fname.startswith('_') or fname.find('.svn')>=0 or not fname.endswith('.py') ): continue fullpath = os.path.join(root,fname) contents = file(fullpath).read() # indent - contents = '\n'.join([' %s'%row.rstrip() for row in contents.split('\n')]) relpath = os.path.split(root)[-1] datad.setdefault(relpath, []).append((fname, contents)) @@ -47,32 +46,77 @@ """) for subdir in subdirs: + if not os.path.exists(subdir): + os.makedirs(subdir) + + static_dir = os.path.join('..', '_static', 'examples') + if not os.path.exists(static_dir): + os.makedirs(static_dir) + + static_dir = os.path.join(static_dir, subdir) + if not os.path.exists(static_dir): + os.makedirs(static_dir) + + + subdirIndexFile = os.path.join(subdir, 'index.rst') + fhsubdirIndex = file(subdirIndexFile, 'w') + fhindex.write(' %s\n'%subdirIndexFile) + + + fhsubdirIndex.write("""\ +.. _%s-examples-index: + + +############################################## +%s Examples +############################################## + +.. htmlonly:: + + :Release: |version| + :Date: |today| + +.. toctree:: + :maxdepth: 1 + +"""%(subdir, subdir)) + print subdir - outfile = '%s.rst'%subdir - fh = file(outfile, 'w') - fhindex.write(' %s\n'%outfile) + + data = datad[subdir] + data.sort() + for fname, contents in data: - fh.write('.. _%s-examples:\n\n'%subdir) - title = '%s examples'%subdir + static_file = os.path.join(static_dir, fname) + fhstatic = file(static_file, 'w') + fhstatic.write(contents) + fhstatic.close() - fh.write('*'*len(title) + '\n') - fh.write(title + '\n') - fh.write('*'*len(title) + '\n\n') - - for fname, contents in datad[subdir]: - print ' ', fname basename, ext = os.path.splitext(fname) - fh.write('.. _%s-example:\n\n'%basename) - title = '%s example'%basename + rstfile = '%s.rst'%basename + outfile = os.path.join(subdir, rstfile) + fhsubdirIndex.write(' %s\n'%rstfile) + fh = file(outfile, 'w') + fh.write('.. _%s-%s:\n\n'%(subdir, basename)) + title = '%s example code: %s'%(subdir, fname) fh.write(title + '\n') fh.write('='*len(title) + '\n\n') - fh.write(fname + '::\n\n') + + + print ' %s'%fname + + linkname = os.path.join('..', '..', '_static', 'examples', subdir, fname) + fh.write('%s (`link to source <%s>`_)::\n\n'%(fname, linkname)) + + # indent the contents + contents = '\n'.join([' %s'%row.rstrip() for row in contents.split('\n')]) + fh.write(contents) fh.write('\n\n') - fh.close() + fh.close() + fhsubdirIndex.close() - fhindex.close() Modified: trunk/matplotlib/doc/make.py =================================================================== --- trunk/matplotlib/doc/make.py 2008年10月16日 19:50:05 UTC (rev 6229) +++ trunk/matplotlib/doc/make.py 2008年10月16日 20:52:08 UTC (rev 6230) @@ -17,7 +17,8 @@ def sf(): 'push a copy to the sf site' os.system('cd build/html; rsync -avz . jdh2358,mat...@we...:/home/groups/m/ma/matplotlib/htdocs/ -essh') - os.system('cd ~/mpl/examples; svn-clean; cd ..; rsync -avz examples jdh2358,mat...@we...:/home/groups/m/ma/matplotlib/htdocs/ -essh --cvs-exclude --delete') + # we are now doing this in the doc/examples build + #os.system('cd ~/mpl/examples; svn-clean; cd ..; rsync -avz examples jdh2358,mat...@we...:/home/groups/m/ma/matplotlib/htdocs/ -essh --cvs-exclude --delete') def sfpdf(): 'push a copy to the sf site' @@ -28,6 +29,11 @@ def html(): check_build() + # build the literal include examples for searchable examples + os.system('cd examples; python gen_rst.py') + + + #figs() if os.system('sphinx-build -b html -d build/doctrees . build/html'): raise SystemExit("Building HTML failed.") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6229 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6229&view=rev Author: mdboom Date: 2008年10月16日 19:50:05 +0000 (2008年10月16日) Log Message: ----------- More docs progress. Modified Paths: -------------- trunk/matplotlib/doc/devel/add_new_projection.rst trunk/matplotlib/doc/devel/outline.rst trunk/matplotlib/lib/matplotlib/colors.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/lib/matplotlib/path.py trunk/matplotlib/lib/matplotlib/projections/__init__.py trunk/matplotlib/lib/matplotlib/projections/polar.py trunk/matplotlib/lib/matplotlib/scale.py trunk/matplotlib/lib/matplotlib/transforms.py Modified: trunk/matplotlib/doc/devel/add_new_projection.rst =================================================================== --- trunk/matplotlib/doc/devel/add_new_projection.rst 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/doc/devel/add_new_projection.rst 2008年10月16日 19:50:05 UTC (rev 6229) @@ -108,3 +108,27 @@ :file:`examples/api/custom_projection_example.py`. The polar plot functionality in :mod:`matplotlib.projections.polar` may also be of interest. + +API documentation +================= + +matplotlib.scale +---------------- + +.. automodule:: matplotlib.scale + :members: + :show-inheritance: + +matplotlib.projections +---------------------- + +.. automodule:: matplotlib.projections + :members: + :show-inheritance: + +matplotlib.projections.polar +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. automodule:: matplotlib.projections.polar + :members: + :show-inheritance: Modified: trunk/matplotlib/doc/devel/outline.rst =================================================================== --- trunk/matplotlib/doc/devel/outline.rst 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/doc/devel/outline.rst 2008年10月16日 19:50:05 UTC (rev 6229) @@ -108,9 +108,9 @@ config/tconfig Darren needs conversion config/verbose Darren needs conversion numerix/__init__ needs conversion -projections/__init__ needs conversion -projections/geo needs conversion -projections/polar needs conversion +projections/__init__ Mike converted +projections/geo Mike converted (not included--experimental) +projections/polar Mike converted afm converted artist converted axes converted @@ -134,18 +134,18 @@ mathtext needs conversion mlab needs conversion mpl needs conversion -patches needs conversion -path needs conversion -pylab needs conversion +patches Mike converted +path Mike converted +pylab no docstrings pyplot converted quiver needs conversion rcsetup needs conversion -scale needs conversion +scale Mike converted table needs conversion texmanager Darren needs conversion text Mike converted ticker Mike needs conversion -transforms needs conversion +transforms Mike converted type1font needs conversion units needs conversion widgets needs conversion Modified: trunk/matplotlib/lib/matplotlib/colors.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colors.py 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/lib/matplotlib/colors.py 2008年10月16日 19:50:05 UTC (rev 6229) @@ -8,14 +8,14 @@ Commands which take color arguments can use several formats to specify the colors. For the basic builtin colors, you can use a single letter - b : blue - g : green - r : red - c : cyan - m : magenta - y : yellow - k : black - w : white + - b : blue + - g : green + - r : red + - c : cyan + - m : magenta + - y : yellow + - k : black + - w : white Gray shades can be given as a string encoding a float in the 0-1 range, e.g.:: Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008年10月16日 19:50:05 UTC (rev 6229) @@ -82,6 +82,9 @@ return inside, {} def update_from(self, other): + """ + Updates this :class:`Patch` from the properties of *other*. + """ artist.Artist.update_from(self, other) self.set_edgecolor(other.get_edgecolor()) self.set_facecolor(other.get_facecolor()) @@ -94,9 +97,17 @@ self.set_alpha(other.get_alpha()) def get_extents(self): + """ + Return a :class:`~matplotlib.transforms.Bbox` object defining + the axis-aligned extents of the :class:`Patch`. + """ return self.get_path().get_extents(self.get_transform()) def get_transform(self): + """ + Return the :class:`~matplotlib.transforms.Transform` applied + to the :class:`Patch`. + """ return self.get_patch_transform() + artist.Artist.get_transform(self) def get_data_transform(self): @@ -106,22 +117,38 @@ return transforms.IdentityTransform() def get_antialiased(self): + """ + Returns True if the :class:`Patch` is to be drawn with antialiasing. + """ return self._antialiased get_aa = get_antialiased def get_edgecolor(self): + """ + Return the edge color of the :class:`Patch`. + """ return self._edgecolor get_ec = get_edgecolor def get_facecolor(self): + """ + Return the face color of the :class:`Patch`. + """ return self._facecolor get_fc = get_facecolor def get_linewidth(self): + """ + Return the line width in points. + """ return self._linewidth get_lw = get_linewidth def get_linestyle(self): + """ + Return the linestyle. Will be one of ['solid' | 'dashed' | + 'dashdot' | 'dotted'] + """ return self._linestyle get_ls = get_linestyle @@ -133,8 +160,11 @@ """ if aa is None: aa = mpl.rcParams['patch.antialiased'] self._antialiased = aa - set_aa = set_antialiased + def set_aa(self, aa): + """alias for set_antialiased""" + return self.set_antialiased(aa) + def set_edgecolor(self, color): """ Set the patch edge color @@ -222,15 +252,18 @@ 2. Hatching is done with solid black lines of width 0. + + ACCEPTS: [ '/' | '\\' | '|' | '-' | '#' | 'x' ] """ self._hatch = h def get_hatch(self): - 'return the current hatching pattern' + 'Return the current hatching pattern' return self._hatch def draw(self, renderer): + 'Draw the :class:`Patch` to the given *renderer*.' if not self.get_visible(): return #renderer.open_group('patch') gc = renderer.new_gc() @@ -378,8 +411,8 @@ class Rectangle(Patch): """ - Draw a rectangle with lower left at *xy*=(*x*, *y*) with specified - width and height + Draw a rectangle with lower left at *xy* = (*x*, *y*) with + specified *width* and *height*. """ def __str__(self): @@ -1296,13 +1329,11 @@ class BboxTransmuterBase(object): """ - Bbox Transmuter Base class - - BBoxTransmuterBase and its derivatives are used to make a fancy box - around a given rectangle. The __call__ method returns the Path of - the fancy box. This class is not an artist and actual drawing of the - fancy box is done by the :class:`FancyBboxPatch` class. - + :class:`BBoxTransmuterBase` and its derivatives are used to make a + fancy box around a given rectangle. The :meth:`__call__` method + returns the :class:`~matplotlib.path.Path` of the fancy box. This + class is not an artist and actual drawing of the fancy box is done + by the :class:`FancyBboxPatch` class. """ # The derived classes are required to be able to be initialized @@ -1317,11 +1348,12 @@ def transmute(self, x0, y0, width, height, mutation_size): """ - The transmute method is a very core of the BboxTransmuter class - and must be overriden in the subclasses. It receives the - location and size of the rectangle, and the mutation_size, with - which the amound padding and etc. will be scaled. It returns a - Path instance. + The transmute method is a very core of the + :class:`BboxTransmuter` class and must be overriden in the + subclasses. It receives the location and size of the + rectangle, and the mutation_size, with which the amount of + padding and etc. will be scaled. It returns a + :class:`~matplotlib.path.Path` instance. """ raise NotImplementedError('Derived must override') @@ -1501,7 +1533,8 @@ mutation_aspect=None, **kwargs): """ - *xy*=lower left corner + *xy* = lower left corner + *width*, *height* *boxstyle* describes how the fancy box will be drawn. It @@ -1636,7 +1669,7 @@ """ Set the transmuter object - ACCEPTS: BboxTransmuterBase (or its derivatives) instance + ACCEPTS: :class:`BboxTransmuterBase` (or its derivatives) instance """ self._bbox_transmuter = bbox_transmuter Modified: trunk/matplotlib/lib/matplotlib/path.py =================================================================== --- trunk/matplotlib/lib/matplotlib/path.py 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/lib/matplotlib/path.py 2008年10月16日 19:50:05 UTC (rev 6229) @@ -15,8 +15,8 @@ class Path(object): """ - Path represents a series of possibly disconnected, possibly - closed, line and curve segments. + :class:`Path` represents a series of possibly disconnected, + possibly closed, line and curve segments. The underlying storage is made up of two parallel numpy arrays: - *vertices*: an Nx2 float array of vertices @@ -159,8 +159,7 @@ be simplified *only* if :attr:`should_simplify` is True, which is determined in the constructor by this criteria: - - No *codes* array - - No nonfinite values + - No curves - More than 128 vertices """ vertices = self.vertices @@ -219,8 +218,9 @@ .. seealso:: :class:`matplotlib.transforms.TransformedPath`: - A path class that will cache the transformed result - and automatically update when the transform changes. + A specialized path class that will cache the + transformed result and automatically update when the + transform changes. """ return Path(transform.transform(self.vertices), self.codes) @@ -265,8 +265,8 @@ Returns *True* if this path intersects another given path. *filled*, when True, treats the paths as if they were filled. - That is, if one path completely encloses the other, - :meth:`intersects_path` will return True. + That is, if one path completely encloses the other, + :meth:`intersects_path` will return True. """ return path_intersects_path(self, other, filled) Modified: trunk/matplotlib/lib/matplotlib/projections/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/__init__.py 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/lib/matplotlib/projections/__init__.py 2008年10月16日 19:50:05 UTC (rev 6229) @@ -3,18 +3,31 @@ from matplotlib import axes class ProjectionRegistry(object): + """ + Manages the set of projections available to the system. + """ def __init__(self): self._all_projection_types = {} def register(self, *projections): + """ + Register a new set of projection(s). + """ for projection in projections: name = projection.name self._all_projection_types[name] = projection def get_projection_class(self, name): + """ + Get a projection class from its *name*. + """ return self._all_projection_types[name] def get_projection_names(self): + """ + Get a list of the names of all projections currently + registered. + """ names = self._all_projection_types.keys() names.sort() return names @@ -31,7 +44,13 @@ def register_projection(cls): projection_registry.register(cls) -def get_projection_class(projection): +def get_projection_class(projection=None): + """ + Get a projection class from its name. + + If *projection* is None, a standard rectilinear projection is + returned. + """ if projection is None: projection = 'rectilinear' @@ -41,7 +60,24 @@ raise ValueError("Unknown projection '%s'" % projection) def projection_factory(projection, figure, rect, **kwargs): + """ + Get a new projection instance. + + *projection* is a projection name. + + *figure* is a figure to add the axes to. + + *rect* is a :class:`~matplotlib.transforms.Bbox` object specifying + the location of the axes within the figure. + + Any other kwargs are passed along to the specific projection + constructor being used. + """ + return get_projection_class(projection)(figure, rect, **kwargs) def get_projection_names(): + """ + Get a list of acceptable projection names. + """ return projection_registry.get_projection_names() Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/polar.py 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2008年10月16日 19:50:05 UTC (rev 6229) @@ -15,7 +15,7 @@ class PolarAxes(Axes): """ - A polar graph projection, where the input dimensions are theta, r. + A polar graph projection, where the input dimensions are *theta*, *r*. Theta starts pointing east and goes anti-clockwise. """ @@ -23,9 +23,10 @@ class PolarTransform(Transform): """ - The base polar transform. This handles projection theta and r into - Cartesian coordinate space, but does not perform the ultimate affine - transformation into the correct position. + The base polar transform. This handles projection *theta* and + *r* into Cartesian coordinate space *x* and *y*, but does not + perform the ultimate affine transformation into the correct + position. """ input_dims = 2 output_dims = 2 @@ -77,9 +78,10 @@ that maximum radius rests on the edge of the axes circle. """ def __init__(self, scale_transform, limits): - """ - limits is the view limit of the data. The only part of + u""" + *limits* is the view limit of the data. The only part of its bounds that is used is ymax (for the radius maximum). + The theta range is always fixed to (0, 2\u03c0). """ Affine2DBase.__init__(self) self._scale_transform = scale_transform @@ -103,7 +105,7 @@ class InvertedPolarTransform(Transform): """ The inverse of the polar transform, mapping Cartesian - coordinate space back to t and r. + coordinate space *x* and *y* back to *theta* and *r*. """ input_dims = 2 output_dims = 2 @@ -127,10 +129,11 @@ inverted.__doc__ = Transform.inverted.__doc__ class ThetaFormatter(Formatter): + u""" + Used to format the *theta* tick labels. Converts the + native unit of radians into degrees and adds a degree symbol + (\u00b0). """ - Used to format the theta tick labels. Converts the native - unit of radians into degrees and adds a degree symbol. - """ def __call__(self, x, pos=None): # \u00b0 : degree symbol return u"%d\u00b0" % ((x / npy.pi) * 180.0) @@ -140,8 +143,9 @@ Used to locate radius ticks. Ensures that all ticks are strictly positive. For all other - tasks, it delegates to the base Locator (which may be - different depending on the scale of the r-axis. + tasks, it delegates to the base + :class:`~matplotlib.ticker.Locator` (which may be different + depending on the scale of the *r*-axis. """ def __init__(self, base): self.base = base @@ -290,24 +294,26 @@ **kwargs): """ Set the angles at which to place the theta grids (these - gridlines are equal along the theta dimension). angles is in - degrees + gridlines are equal along the theta dimension). *angles* is in + degrees. - labels, if not None, is a len(angles) list of strings of the - labels to use at each angle. + *labels*, if not None, is a ``len(angles)`` list of strings of + the labels to use at each angle. - if labels is None, the labels with be fmt%%angle + If *labels* is None, the labels will be ``fmt %% angle`` - frac is the fraction of the polar axes radius at which to - place the label (1 is the edge).Eg 1.05 isd outside the axes - and 0.95 is inside the axes + *frac* is the fraction of the polar axes radius at which to + place the label (1 is the edge). Eg. 1.05 is outside the axes + and 0.95 is inside the axes. - Return value is a list of lines, labels where the lines are - lines.Line2D instances and the labels are Text - instances: + Return value is a list of tuples (*line*, *label*), where + *line* is :class:`~matplotlib.lines.Line2D` instances and the + *label* is :class:`~matplotlib.text.Text` instances. - kwargs are optional text properties for the labels + kwargs are optional text properties for the labels: + %(Text)s + ACCEPTS: sequence of floats """ angles = npy.asarray(angles, npy.float_) @@ -324,23 +330,25 @@ def set_rgrids(self, radii, labels=None, angle=None, rpad=None, **kwargs): """ - set the radial locations and labels of the r grids + Set the radial locations and labels of the *r* grids. - The labels will appear at radial distances radii at angle + The labels will appear at radial distances *radii* at the + given *angle* in degrees. - labels, if not None, is a len(radii) list of strings of the - labels to use at each angle. + *labels*, if not None, is a ``len(radii)`` list of strings of the + labels to use at each radius. - if labels is None, the self.rformatter will be used + If *labels* is None, the built-in formatter will be used. - rpad is a fraction of the max of radii which will pad each of + *rpad* is a fraction of the max of *radii* which will pad each of the radial labels in the radial direction. - Return value is a list of lines, labels where the lines are - lines.Line2D instances and the labels are text.Text - instances + Return value is a list of tuples (*line*, *label*), where + *line* is :class:`~matplotlib.lines.Line2D` instances and the + *label* is :class:`~matplotlib.text.Text` instances. - kwargs control the rgrid Text label properties: + kwargs are optional text properties for the labels: + %(Text)s ACCEPTS: sequence of floats @@ -375,7 +383,10 @@ self.viewLim.intervalx = (0.0, npy.pi * 2.0) def format_coord(self, theta, r): - 'return a format string formatting the coordinate' + """ + Return a format string formatting the coordinate using Unicode + characters. + """ theta /= math.pi # \u03b8: lower-case theta # \u03c0: lower-case pi Modified: trunk/matplotlib/lib/matplotlib/scale.py =================================================================== --- trunk/matplotlib/lib/matplotlib/scale.py 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/lib/matplotlib/scale.py 2008年10月16日 19:50:05 UTC (rev 6229) @@ -9,50 +9,99 @@ from transforms import Transform, IdentityTransform class ScaleBase(object): + """ + The base class for all scales. + + Scales are separable transformations, working on a single dimension. + + Any subclasses will want to override: + + - :attr:`name` + - :meth:`get_transform` + + And optionally: + - :meth:`set_default_locators_and_formatters` + - :meth:`limit_range_for_scale` + """ def get_transform(self): """ - Return the transform object associated with this scale. + Return the :class:`~matplotlib.transforms.Transform` object + associated with this scale. """ raise NotImplementedError def set_default_locators_and_formatters(self, axis): """ - Set the locators and formatters that go with this scale. + Set the :class:`~matplotlib.ticker.Locator` and + :class:`~matplotlib.ticker.Formatter` objects on the given + axis to match this scale. """ raise NotImplementedError def limit_range_for_scale(self, vmin, vmax, minpos): """ - Returns the range vmin, vmax, limited to the domain supported - by this scale. + Returns the range *vmin*, *vmax*, possibly limited to the + domain supported by this scale. + + *minpos* should be the minimum positive value in the data. + This is used by log scales to determine a minimum value. """ return vmin, vmax class LinearScale(ScaleBase): + """ + The default linear scale. + """ + name = 'linear' def __init__(self, axis, **kwargs): - """ - """ pass def set_default_locators_and_formatters(self, axis): + """ + Set the locators and formatters to reasonable defaults for + linear scaling. + """ axis.set_major_locator(AutoLocator()) axis.set_major_formatter(ScalarFormatter()) axis.set_minor_locator(NullLocator()) axis.set_minor_formatter(NullFormatter()) def get_transform(self): + """ + The transform for linear scaling is just the + :class:`~matplotlib.transforms.IdentityTransform`. + """ return IdentityTransform() def _mask_non_positives(a): + """ + Return a Numpy masked array where all non-positive values are + masked. If there are no non-positive values, the original array + is returned. + """ mask = a <= 0.0 if mask.any(): return ma.MaskedArray(a, mask=mask) return a class LogScale(ScaleBase): + """ + A standard logarithmic scale. Care is taken so non-positive + values are not plotted. + + For computational efficiency (to push as much as possible to Numpy + C code in the common cases), this scale provides different + transforms depending on the base of the logarithm: + + - base 10 (:class:`Log10Transform`) + - base 2 (:class:`Log2Transform`) + - base e (:class:`NaturalLogTransform`) + - arbitrary base (:class:`LogTransform`) + """ + name = 'log' class Log10Transform(Transform): @@ -203,15 +252,26 @@ self.subs = subs def set_default_locators_and_formatters(self, axis): + """ + Set the locators and formatters to specialized versions for + log scaling. + """ axis.set_major_locator(LogLocator(self.base)) axis.set_major_formatter(LogFormatterMathtext(self.base)) axis.set_minor_locator(LogLocator(self.base, self.subs)) axis.set_minor_formatter(NullFormatter()) def get_transform(self): + """ + Return a :class:`~matplotlib.transforms.Transform` instance + appropriate for the given logarithm base. + """ return self._transform def limit_range_for_scale(self, vmin, vmax, minpos): + """ + Limit the domain to positive values. + """ return (vmin <= 0.0 and minpos or vmin, vmax <= 0.0 and minpos or vmax) @@ -221,10 +281,10 @@ The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin. - Since the values close to zero tend toward infinity, there is - usually need to have a range around zero that is linear. The - parameter "linthresh" allows the user to specify the size of this - range (-linthresh, linthresh). + Since the values close to zero tend toward infinity, there is a + need to have a range around zero that is linear. The parameter + *linthresh* allows the user to specify the size of this range + (-*linthresh*, *linthresh*). """ name = 'symlog' @@ -310,12 +370,19 @@ self.subs = subs def set_default_locators_and_formatters(self, axis): + """ + Set the locators and formatters to specialized versions for + symmetrical log scaling. + """ axis.set_major_locator(SymmetricalLogLocator(self.get_transform())) axis.set_major_formatter(LogFormatterMathtext(self.base)) axis.set_minor_locator(SymmetricalLogLocator(self.get_transform(), self.subs)) axis.set_minor_formatter(NullFormatter()) def get_transform(self): + """ + Return a :class:`SymmetricalLogTransform` instance. + """ return self._transform @@ -325,7 +392,17 @@ 'log' : LogScale, 'symlog' : SymmetricalLogScale } +def get_scale_names(): + names = _scale_mapping.keys() + names.sort() + return names + def scale_factory(scale, axis, **kwargs): + """ + Return a scale class by name. + + ACCEPTS: [ %s ] + """ scale = scale.lower() if scale is None: scale = 'linear' @@ -334,19 +411,20 @@ raise ValueError("Unknown scale type '%s'" % scale) return _scale_mapping[scale](axis, **kwargs) +scale_factory.__doc__ = scale_factory.__doc__ % " | ".join(get_scale_names()) def register_scale(scale_class): """ Register a new kind of scale. + + *scale_class* must be a subclass of :class:`ScaleBase`. """ _scale_mapping[scale_class.name] = scale_class -def get_scale_names(): - names = _scale_mapping.keys() - names.sort() - return names - def get_scale_docs(): + """ + Helper function for generating docstrings related to scales. + """ docs = [] for name in get_scale_names(): scale_class = _scale_mapping[name] Modified: trunk/matplotlib/lib/matplotlib/transforms.py =================================================================== --- trunk/matplotlib/lib/matplotlib/transforms.py 2008年10月16日 19:35:12 UTC (rev 6228) +++ trunk/matplotlib/lib/matplotlib/transforms.py 2008年10月16日 19:50:05 UTC (rev 6229) @@ -79,7 +79,7 @@ def __init__(self): """ - Creates a new TransformNode. + Creates a new :class:`TransformNode`. """ # Parents are stored in a WeakKeyDictionary, so that if the # parents are deleted, references from the children won't keep @@ -98,8 +98,8 @@ def invalidate(self): """ - Invalidate this transform node and all of its ancestors. - Should be called any time the transform changes. + Invalidate this :class:`TransformNode` and all of its + ancestors. Should be called any time the transform changes. """ # If we are an affine transform being changed, we can set the # flag to INVALID_AFFINE_ONLY @@ -145,8 +145,8 @@ """ Returns a frozen copy of this transform node. The frozen copy will not update when its children change. Useful for storing - a previously known state of a transform where copy.deepcopy() - might normally be used. + a previously known state of a transform where + ``copy.deepcopy()`` might normally be used. """ return self @@ -162,7 +162,7 @@ Affine transforms are marked in blue. Bounding boxes are marked in yellow. - fobj: A Python file-like object + *fobj*: A Python file-like object """ seen = set() @@ -242,8 +242,8 @@ def is_unit(self): """ - Returns True if the Bbox is the unit bounding box from (0, 0) - to (1, 1). + Returns True if the :class:`Bbox` is the unit bounding box + from (0, 0) to (1, 1). """ return list(self.get_points().flatten()) == [0., 0., 1., 1.] @@ -370,7 +370,7 @@ def containsx(self, x): """ - Returns True if x is between or equal to :attr:`x0` and + Returns True if *x* is between or equal to :attr:`x0` and :attr:`x1`. """ x0, x1 = self.intervalx @@ -380,7 +380,7 @@ def containsy(self, y): """ - Returns True if y is between or equal to :attr:`y0` and + Returns True if *y* is between or equal to :attr:`y0` and :attr:`y1`. """ y0, y1 = self.intervaly @@ -390,8 +390,8 @@ def contains(self, x, y): """ - Returns True if (x, y) is a coordinate inside the bounding - box or on its edge. + Returns *True* if (*x*, *y*) is a coordinate inside the + bounding box or on its edge. """ return self.containsx(x) and self.containsy(y) @@ -419,7 +419,7 @@ def fully_containsx(self, x): """ - Returns True if x is between but not equal to :attr:`x0` and + Returns True if *x* is between but not equal to :attr:`x0` and :attr:`x1`. """ x0, x1 = self.intervalx @@ -429,7 +429,7 @@ def fully_containsy(self, y): """ - Returns True if y is between but not equal to :attr:`y0` and + Returns True if *y* is between but not equal to :attr:`y0` and :attr:`y1`. """ y0, y1 = self.intervaly @@ -439,7 +439,7 @@ def fully_contains(self, x, y): """ - Returns True if (x, y) is a coordinate inside the bounding + Returns True if (*x*, *y*) is a coordinate inside the bounding box, but not on its edge. """ return self.fully_containsx(x) \ @@ -448,7 +448,8 @@ def fully_overlaps(self, other): """ Returns True if this bounding box overlaps with the given - bounding box *other*, but not on its edge alone.""" + bounding box *other*, but not on its edge alone. + """ ax1, ay1, ax2, ay2 = self._get_extents() bx1, by1, bx2, by2 = other._get_extents() @@ -491,23 +492,24 @@ 'W': (0, 0.5)} def anchored(self, c, container = None): """ - Return a copy of the Bbox, shifted to position c within a - container. + Return a copy of the :class:`Bbox`, shifted to position *c* + within a container. - c: may be either: + *c*: may be either: - * a sequence (cx, cy) where cx, cy range - from 0 to 1, where 0 is left or bottom and 1 is right or top + * a sequence (*cx*, *cy*) where *cx* and *cy* range from 0 + to 1, where 0 is left or bottom and 1 is right or top * a string: - - C for centered - - S for bottom-center - - SE for bottom-left - - E for left + - 'C' for centered + - 'S' for bottom-center + - 'SE' for bottom-left + - 'E' for left - etc. - Optional argument *container* is the box within which the :class:`Bbox` - is positioned; it defaults to the initial :class:`Bbox`. + Optional argument *container* is the box within which the + :class:`Bbox` is positioned; it defaults to the initial + :class:`Bbox`. """ if container is None: container = self @@ -523,10 +525,10 @@ def shrunk(self, mx, my): """ - Return a copy of the :class:`Bbox`, shurnk by the factor mx in - the *x* direction and the factor my in the *y* direction. The - lower left corner of the box remains unchanged. Normally mx - and my will be less than 1, but this is not enforced. + Return a copy of the :class:`Bbox`, shrunk by the factor *mx* + in the *x* direction and the factor *my* in the *y* direction. + The lower left corner of the box remains unchanged. Normally + *mx* and *my* will be less than 1, but this is not enforced. """ w, h = self.size return Bbox([self._points[0], @@ -589,9 +591,9 @@ def count_contains(self, vertices): """ - Count the number of vertices contained in the Bbox. + Count the number of vertices contained in the :class:`Bbox`. - vertices is a Nx2 numpy array. + *vertices* is a Nx2 Numpy array. """ if len(vertices) == 0: return 0 @@ -636,7 +638,7 @@ def translated(self, tx, ty): """ Return a copy of the :class:`Bbox`, statically translated by - tx and ty. + *tx* and *ty*. """ return Bbox(self._points + (tx, ty)) @@ -697,11 +699,11 @@ def __init__(self, points): """ - points: a 2x2 numpy array of the form [[x0, y0], [x1, y1]] + *points*: a 2x2 numpy array of the form [[x0, y0], [x1, y1]] If you need to create a :class:`Bbox` object from another form - of data, consider the static methods unit, from_bounds and - from_extents. + of data, consider the static methods :meth:`unit`, + :meth:`from_bounds` and :meth:`from_extents`. """ BboxBase.__init__(self) self._points = np.asarray(points, np.float_) @@ -731,10 +733,10 @@ #@staticmethod def from_bounds(x0, y0, width, height): """ - (staticmethod) Create a new :class:`Bbox` from x0, y0, width - and height. + (staticmethod) Create a new :class:`Bbox` from *x0*, *y0*, + *width* and *height*. - width and height may be negative. + *width* and *height* may be negative. """ return Bbox.from_extents(x0, y0, x0 + width, y0 + height) from_bounds = staticmethod(from_bounds) @@ -742,10 +744,10 @@ #@staticmethod def from_extents(*args): """ - (staticmethod) Create a new Bbox from left, bottom, right and - top. + (staticmethod) Create a new Bbox from *left*, *bottom*, + *right* and *top*. - The y-axis increases upwards. + The *y*-axis increases upwards. """ points = np.array(args, dtype=np.float_).reshape(2, 2) return Bbox(points) @@ -761,7 +763,7 @@ by subsequent calls to :meth:`update_from_data` or :meth:`update_from_data_xy`. - value: + *value*: - When True, subsequent calls to :meth:`update_from_data` will ignore the existing bounds of the :class:`Bbox`. @@ -776,13 +778,13 @@ Update the bounds of the :class:`Bbox` based on the passed in data. - x: a numpy array of x-values + *x*: a numpy array of *x*-values - y: a numpy array of y-values + *y*: a numpy array of *y*-values - ignore: - - when True, ignore the existing bounds of the Bbox. - - when False, include the existing bounds of the Bbox. + *ignore*: + - when True, ignore the existing bounds of the :class:`Bbox`. + - when False, include the existing bounds of the :class:`Bbox`. - when None, use the last value passed to :meth:`ignore`. """ warnings.warn("update_from_data requires a memory copy -- please replace with update_from_data_xy") @@ -794,11 +796,11 @@ Update the bounds of the :class:`Bbox` based on the passed in data. - *path*: a Path instance + *path*: a :class:`~matplotlib.path.Path` instance *ignore*: - - when True, ignore the existing bounds of the Bbox. - - when False, include the existing bounds of the Bbox. + - when True, ignore the existing bounds of the :class:`Bbox`. + - when False, include the existing bounds of the :class:`Bbox`. - when None, use the last value passed to :meth:`ignore`. """ if ignore is None: @@ -821,11 +823,11 @@ Update the bounds of the :class:`Bbox` based on the passed in data. - xy: a numpy array of 2D points + *xy*: a numpy array of 2D points - ignore: - - when True, ignore the existing bounds of the Bbox. - - when False, include the existing bounds of the Bbox. + *ignore*: + - when True, ignore the existing bounds of the :class:`Bbox`. + - when False, include the existing bounds of the :class:`Bbox`. - when None, use the last value passed to :meth:`ignore`. """ if len(xy) == 0: @@ -905,8 +907,8 @@ def set_points(self, points): """ Set the points of the bounding box directly from a numpy array - of the form: [[x0, y0], [x1, y1]]. No error checking - is performed, as this method is mainly for internal use. + of the form: [[x0, y0], [x1, y1]]. No error checking is + performed, as this method is mainly for internal use. """ if np.any(self._points != points): self._points = points @@ -914,7 +916,8 @@ def set(self, other): """ - Set this bounding box from the "frozen" bounds of another Bbox. + Set this bounding box from the "frozen" bounds of another + :class:`Bbox`. """ if np.any(self._points != other.get_points()): self._points = other.get_points() @@ -929,9 +932,9 @@ """ def __init__(self, bbox, transform): """ - bbox: a child bbox + *bbox*: a child :class:`Bbox` - transform: a 2D transform + *transform*: a 2D :class:`Transform` """ assert bbox.is_bbox assert isinstance(transform, Transform) @@ -968,8 +971,8 @@ class Transform(TransformNode): """ - The base class of all TransformNodes that actually perform a - transformation. + The base class of all :class:`TransformNode`s that actually + perform a transformation. All non-affine transformations should be subclasses of this class. New affine transformations should be subclasses of @@ -1009,7 +1012,8 @@ def __add__(self, other): """ - Composes two transforms together such that self is followed by other. + Composes two transforms together such that *self* is followed + by *other*. """ if isinstance(other, Transform): return composite_transform_factory(self, other) @@ -1018,7 +1022,8 @@ def __radd__(self, other): """ - Composes two transforms together such that self is followed by other. + Composes two transforms together such that *self* is followed + by *other*. """ if isinstance(other, Transform): return composite_transform_factory(other, self) @@ -1095,7 +1100,7 @@ """ Returns a transformed copy of path. - path: a Path instance. + *path*: a :class:`~matplotlib.path.Path` instance. In some cases, this transform may insert curves into the path that began as line segments. @@ -1107,7 +1112,7 @@ Returns a copy of path, transformed only by the affine part of this transform. - path: a Path instance + *path*: a :class:`~matplotlib.path.Path` instance. ``transform_path(path)`` is equivalent to ``transform_path_affine(transform_path_non_affine(values))``. @@ -1119,7 +1124,7 @@ Returns a copy of path, transformed only by the non-affine part of this transform. - path: a Path instance + *path*: a :class:`~matplotlib.path.Path` instance. ``transform_path(path)`` is equivalent to ``transform_path_affine(transform_path_non_affine(values))``. @@ -1131,7 +1136,7 @@ Return the corresponding inverse transformation. The return value of this method should be treated as - temporary. An update to 'self' does not cause a corresponding + temporary. An update to *self* does not cause a corresponding update to its inverted copy. ``x === self.inverted().transform(self.transform(x))`` @@ -1157,8 +1162,8 @@ def __init__(self, child): """ - child: A Transform instance. This child may later be replaced - with :meth:`set`. + *child*: A class:`Transform` instance. This child may later + be replaced with :meth:`set`. """ assert isinstance(child, Transform) @@ -1278,7 +1283,7 @@ affine transformation, use :class:`Affine2D`. Subclasses of this class will generally only need to override a - constructor and 'get_matrix' that generates a custom 3x3 matrix. + constructor and :meth:`get_matrix` that generates a custom 3x3 matrix. """ input_dims = 2 @@ -1373,7 +1378,7 @@ b d f 0 0 1 - If matrix is None, initialize with the identity transform. + If *matrix* is None, initialize with the identity transform. """ Affine2DBase.__init__(self) if matrix is None: @@ -1464,8 +1469,8 @@ """ Add a rotation (in radians) to this transform in place. - Returns self, so this method can easily be chained with more - calls to :meth:`rotate`, :meth:`rotate_deg, :meth:`translate` + Returns *self*, so this method can easily be chained with more + calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`. """ a = np.cos(theta) @@ -1481,8 +1486,8 @@ """ Add a rotation (in degrees) to this transform in place. - Returns self, so this method can easily be chained with more - calls to :meth:`rotate`, :meth:`rotate_deg, :meth:`translate` + Returns *self*, so this method can easily be chained with more + calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`. """ return self.rotate(degrees*np.pi/180.) @@ -1491,8 +1496,8 @@ """ Add a rotation (in radians) around the point (x, y) in place. - Returns self, so this method can easily be chained with more - calls to :meth:`rotate`, :meth:`rotate_deg, :meth:`translate` + Returns *self*, so this method can easily be chained with more + calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`. """ return self.translate(-x, -y).rotate(theta).translate(x, y) @@ -1501,8 +1506,8 @@ """ Add a rotation (in degrees) around the point (x, y) in place. - Returns self, so this method can easily be chained with more - calls to :meth:`rotate`, :meth:`rotate_deg, :meth:`translate` + Returns *self*, so this method can easily be chained with more + calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`. """ return self.translate(-x, -y).rotate_deg(degrees).translate(x, y) @@ -1511,8 +1516,8 @@ """ Adds a translation in place. - Returns self, so this method can easily be chained with more - calls to :meth:`rotate`, :meth:`rotate_deg, :meth:`translate` + Returns *self*, so this method can easily be chained with more + calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`. """ translate_mtx = np.array( @@ -1526,11 +1531,11 @@ """ Adds a scale in place. - If sy is None, the same scale is applied in both the x- and - y-directions. + If *sy* is None, the same scale is applied in both the *x*- and + *y*-directions. - Returns self, so this method can easily be chained with more - calls to :meth:`rotate`, :meth:`rotate_deg, :meth:`translate` + Returns *self*, so this method can easily be chained with more + calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`. """ if sy is None: @@ -1597,11 +1602,11 @@ class BlendedGenericTransform(Transform): """ - A "blended" transform uses one transform for the x-direction, and - another transform for the y-direction. + A "blended" transform uses one transform for the *x*-direction, and + another transform for the *y*-direction. This "generic" version can handle any given child transform in the - x- and y-directions. + *x*- and *y*-directions. """ input_dims = 2 output_dims = 2 @@ -1610,8 +1615,9 @@ def __init__(self, x_transform, y_transform): """ - Create a new "blended" transform using x_transform to - transform the x-axis and y_transform to transform the y_axis. + Create a new "blended" transform using *x_transform* to + transform the *x*-axis and *y_transform* to transform the + *y*-axis. You will generally not call this constructor directly but use the :func:`blended_transform_factory` function instead, which @@ -1699,20 +1705,22 @@ class BlendedAffine2D(Affine2DBase): """ - A "blended" transform uses one transform for the x-direction, and - another transform for the y-direction. + A "blended" transform uses one transform for the *x*-direction, and + another transform for the *y*-direction. This version is an optimization for the case where both child - transforms are of type Affine2DBase. + transforms are of type :class:`Affine2DBase`. """ is_separable = True def __init__(self, x_transform, y_transform): """ - Create a new "blended" transform using x_transform to - transform the x-axis and y_transform to transform the y_axis. + Create a new "blended" transform using *x_transform* to + transform the *x*-axis and *y_transform* to transform the + *y*-axis. - Both x_transform and y_transform must be 2D affine transforms. + Both *x_transform* and *y_transform* must be 2D affine + transforms. You will generally not call this constructor directly but use the :func:`blended_transform_factory` function instead, which @@ -1755,8 +1763,8 @@ def blended_transform_factory(x_transform, y_transform): """ - Create a new "blended" transform using x_transform to - transform the x-axis and y_transform to transform the y_axis. + Create a new "blended" transform using *x_transform* to transform + the *x*-axis and *y_transform* to transform the *y*-axis. A faster version of the blended transform is returned for the case where both child transforms are affine. @@ -1769,16 +1777,18 @@ class CompositeGenericTransform(Transform): """ - A composite transform formed by applying transform a then transform b. + A composite transform formed by applying transform *a* then + transform *b*. - This "generic" version can handle any two arbitrary transformations. + This "generic" version can handle any two arbitrary + transformations. """ pass_through = True def __init__(self, a, b): """ Create a new composite transform that is the result of - applying transform a then transform b. + applying transform *a* then transform *b*. You will generally not call this constructor directly but use the :func:`composite_transform_factory` function instead, @@ -1862,17 +1872,17 @@ class CompositeAffine2D(Affine2DBase): """ - A composite transform formed by applying transform a then transform b. + A composite transform formed by applying transform *a* then transform *b*. - This version is an optimization that handles the case where both a - and b are 2D affines. + This version is an optimization that handles the case where both *a* + and *b* are 2D affines. """ def __init__(self, a, b): """ Create a new composite transform that is the result of - applying transform a then transform b. + applying transform *a* then transform *b*. - Both a and b must be instances of :class:`Affine2DBase`. + Both *a* and *b* must be instances of :class:`Affine2DBase`. You will generally not call this constructor directly but use the :func:`composite_transform_factory` function instead, @@ -1916,7 +1926,7 @@ is the identity transform. Composite transforms may also be created using the '+' operator, - e.g.: + e.g.:: c = a + b """ @@ -1931,14 +1941,15 @@ class BboxTransform(Affine2DBase): """ - BboxTransform linearly transforms points from one Bbox to another Bbox. + :class:`BboxTransform` linearly transforms points from one + :class:`Bbox` to another :class:`Bbox`. """ is_separable = True def __init__(self, boxin, boxout): """ - Create a new BboxTransform that linearly transforms points - from boxin to boxout. + Create a new :class:`BboxTransform` that linearly transforms + points from *boxin* to *boxout*. """ assert boxin.is_bbox assert boxout.is_bbox @@ -1974,15 +1985,16 @@ class BboxTransformTo(Affine2DBase): """ - BboxTransformTo is a transformation that linearly transforms - points from the unit bounding box to a given :class:`Bbox`. + :class:`BboxTransformTo` is a transformation that linearly + transforms points from the unit bounding box to a given + :class:`Bbox`. """ is_separable = True def __init__(self, boxout): """ Create a new :class:`BboxTransformTo` that linearly transforms - points from the unit bounding box to boxout. + points from the unit bounding box to *boxout*. """ assert boxout.is_bbox @@ -2013,7 +2025,7 @@ class BboxTransformFrom(Affine2DBase): """ - BboxTransform linearly transforms points from a given + :class:`BboxTransformFrom` linearly transforms points from a given :class:`Bbox` to the unit bounding box. """ is_separable = True @@ -2050,8 +2062,8 @@ class ScaledTranslation(Affine2DBase): """ - A transformation that translates by xt and yt, after xt and yt - have been transformaed by the given transform scale_trans. + A transformation that translates by *xt* and *yt*, after *xt* and *yt* + have been transformad by the given transform *scale_trans*. """ def __init__(self, xt, yt, scale_trans): Affine2DBase.__init__(self) @@ -2080,13 +2092,15 @@ class TransformedPath(TransformNode): """ - A TransformedPath caches a non-affine transformed copy of the - path. This cached copy is automatically updated when the - non-affine part of the transform changes. + A :class:`TransformedPath` caches a non-affine transformed copy of + the :class:`~matplotlib.path.Path`. This cached copy is + automatically updated when the non-affine part of the transform + changes. """ def __init__(self, path, transform): """ - Create a new TransformedPath from the given path and transform. + Create a new :class:`TransformedPath` from the given + :class:`~matplotlib.path.Path` and :class:`Transform`. """ assert isinstance(transform, Transform) TransformNode.__init__(self) @@ -2111,8 +2125,8 @@ Return a copy of the child path, with the non-affine part of the transform already applied, along with the affine part of the path necessary to complete the transformation. Unlike - get_transformed_path_and_affine, no interpolation will be - performed. + :meth:`get_transformed_path_and_affine`, no interpolation will + be performed. """ self._revalidate() return self._transformed_points, self.get_affine() @@ -2201,82 +2215,3 @@ raise ValueError('units must be dots, points, or inches') return trans + ScaledTranslation(x, y, fig.dpi_scale_trans) -if __name__ == '__main__': - import copy - from random import random - import timeit - - bbox = Bbox.from_extents(10., 15., 20., 25.) - assert bbox.x0 == 10 - assert bbox.y0 == 15 - assert bbox.x1 == 20 - assert bbox.y1 == 25 - - assert np.all(bbox.min == [10, 15]) - assert np.all(bbox.max == [20, 25]) - assert np.all(bbox.intervalx == (10, 20)) - assert np.all(bbox.intervaly == (15, 25)) - - assert bbox.width == 10 - assert bbox.height == 10 - - assert bbox.bounds == (10, 15, 10, 10) - - assert tuple(np.asarray(bbox).flatten()) == (10, 15, 20, 25) - - bbox.intervalx = (11, 21) - bbox.intervaly = (16, 26) - - assert bbox.bounds == (11, 16, 10, 10) - - bbox.x0 = 12 - bbox.y0 = 17 - bbox.x1 = 22 - bbox.y1 = 27 - - assert bbox.bounds == (12, 17, 10, 10) - - bbox = Bbox.from_bounds(10, 11, 12, 13) - assert bbox.bounds == (10, 11, 12, 13) - - bbox_copy = copy.deepcopy(bbox) - assert (bbox.extents == bbox_copy.extents).all() - bbox_copy.p1 = (14, 15) - assert bbox.bounds == (10, 11, 12, 13) - assert bbox_copy.bounds == (10, 11, 4, 4) - - bbox1 = Bbox([[10., 15.], [20., 25.]]) - bbox2 = Bbox([[30., 35.], [40., 45.]]) - trans = BboxTransform(bbox1, bbox2) - bbox3 = bbox1.transformed(trans) - assert (bbox3.extents == bbox2.extents).all() - - translation = Affine2D().translate(10, 20) - assert translation.to_values() == (1, 0, 0, 1, 10, 20) - scale = Affine2D().scale(10, 20) - assert scale.to_values() == (10, 0, 0, 20, 0, 0) - rotation = Affine2D().rotate_deg(30) - assert rotation.to_values() == (0.86602540378443871, 0.49999999999999994, - -0.49999999999999994, 0.86602540378443871, - 0.0, 0.0) - - points = np.array([[1, 2], [3, 4], [5, 6], [7, 8]], np.float_) - translated_points = translation.transform(points) - assert (translated_points == [[11., 22.], [13., 24.], [15., 26.], [17., 28.]]).all() - scaled_points = scale.transform(points) - print scaled_points - rotated_points = rotation.transform(points) - print rotated_points - - tpoints1 = rotation.transform(translation.transform(scale.transform(points))) - trans_sum = scale + translation + rotation - tpoints2 = trans_sum.transform(points) - # Need to do some sort of fuzzy comparison here? - assert (tpoints1.round() == tpoints2.round()).all() - - print points - - # Here are some timing tests - points = np.asarray([(random(), random()) for i in xrange(10000)]) - t = timeit.Timer("trans_sum.transform(points)", "from __main__ import trans_sum, points") - print "Time to transform 10000 x 10 points:", t.timeit(10) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6228 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6228&view=rev Author: jdh2358 Date: 2008年10月16日 19:35:12 +0000 (2008年10月16日) Log Message: ----------- fixed sidebar confict Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 19:19:24 UTC (rev 6227) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 19:35:12 UTC (rev 6228) @@ -12,22 +12,10 @@ </p> <h3>Need help?</h3> -<<<<<<< .mine -<<<<<<< .mine -<p>Check the <a href="{{ pathto('contents') }}"}>docs</a>, -the <a href="{{ pathto('faq/index') }}">faq</a>, and join the -matplotlib -mailing <a href="http://sourceforge.net/project/showfiles.php?group_id=80706">lists</a>. -There is a also community wiki <a href=http://www.scipy.org/Cookbook/Matplotlib>cookbook</a></p> -======= -<p>Check the <a href="{{ pathto('users/index') }}"}>user</a> guide, the <a -======= <p>Check the <a href="{{ pathto('users/index') }}">user</a> guide, the <a ->>>>>>> .r6222 href="{{ pathto('faq/index') }}">faq</a>, the <a href="{{ pathto('api/index') }}"}>api</a> docs, <a href=http://www.nabble.com/matplotlib---users-f2906.html>archives</a>, and join the matplotlib mailing <a href="http://sourceforge.net/mail/?group_id=80706">lists</a> ->>>>>>> .r6221 <p>You can file bugs, patches and feature requests on the sourceforge <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>, but it is a good idea to ping us on the mailing list too.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6227 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6227&view=rev Author: mdboom Date: 2008年10月16日 19:19:24 +0000 (2008年10月16日) Log Message: ----------- Fix encoding in these files. unicode_demo.py was in latin-1, though the coding marker said utf-8 (someone's editor didn't listen... ;) tex_unicode_demo.py was converted to utf-8 to be Sphinx compatible. Modified Paths: -------------- trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py trunk/matplotlib/examples/pylab_examples/unicode_demo.py Modified: trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py 2008年10月16日 19:00:21 UTC (rev 6226) +++ trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py 2008年10月16日 19:19:24 UTC (rev 6227) @@ -1,5 +1,5 @@ #!/usr/bin/env python -# -*- coding: latin-1 -*- +# -*- coding: utf-8 -*- """ This demo is tex_demo.py modified to have unicode. See that file for more information. @@ -18,7 +18,7 @@ plot(t, s) xlabel(r'\textbf{time (s)}') -ylabel(unicode(r'\textit{Velocity (\xB0/sec)}','latin-1'),fontsize=16) +ylabel(unicode(r'\textit{Velocity (°/sec)}','latin-1'),fontsize=16) title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", fontsize=16, color='r') grid(True) Modified: trunk/matplotlib/examples/pylab_examples/unicode_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/unicode_demo.py 2008年10月16日 19:00:21 UTC (rev 6226) +++ trunk/matplotlib/examples/pylab_examples/unicode_demo.py 2008年10月16日 19:19:24 UTC (rev 6227) @@ -3,10 +3,10 @@ from pylab import * plot([1,2,4]) -title( unicode('D\xE9velopp\xE9s et fabriqu\xE9s', 'latin-1') ) -xlabel( unicode("r\xE9activit\xE9 nous permettent d'\xEAtre s\xE9lectionn\xE9s et adopt\xE9s", 'latin-1') ) +title( unicode('Développés et fabriqués', 'latin-1') ) +xlabel( unicode("réactivité nous permettent d'être sélectionnés et adoptés", 'latin-1') ) ylabel( unicode('Andr\xc3\xa9 was here!', 'utf-8') ) -text( 0.5, 2.5, unicode('Institut f\xFCr Festk\xF6rperphysik', 'latin-1'), rotation=45) +text( 0.5, 2.5, unicode('Institut für Festkörperphysik', 'latin-1'), rotation=45) text( 1, 1.5, u'AVA (check kerning)') savefig('test') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Manuel, Although it doesn't hurt, I don't think it is worthwhile changing range to xrange. From the 2.5 docs: xrange( [start,] stop[, step]) This function is very similar to range(), but returns an ``xrange object'' instead of a list. This is an opaque sequence type which yields the same values as the corresponding list, without actually storing them all simultaneously. The advantage of xrange() over range() is minimal (since xrange() still has to create the values when asked for them) except when a very large range is used on a memory-starved machine or when all of the range's elements are never used (such as when the loop is usually terminated with break). Note "minimal" advantage. xrange was intended for special-case use, not general use. And from Python 3.0, http://docs.python.org/dev/3.0/whatsnew/3.0.html xrange() renamed to range(), so range() will no longer produce a list but an iterable yielding integers when iterated over. This implies to me that range is the preferred form, and xrange is intended to go away. Eric mme...@us... wrote: > Revision: 6217 > http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6217&view=rev > Author: mmetz_bn > Date: 2008年10月16日 11:15:25 +0000 (2008年10月16日) > > Log Message: > ----------- > minor optimizations: replacing range by xrange in for loops > > Modified Paths: > -------------- > trunk/matplotlib/lib/matplotlib/axes.py > > Modified: trunk/matplotlib/lib/matplotlib/axes.py > =================================================================== > --- trunk/matplotlib/lib/matplotlib/axes.py 2008年10月15日 20:53:09 UTC (rev 6216) > +++ trunk/matplotlib/lib/matplotlib/axes.py 2008年10月16日 11:15:25 UTC (rev 6217) > @@ -243,7 +243,7 @@ > x, y, multicol = self._xy_from_y(y) > > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > color = self._get_next_cycle_color() > seg = mlines.Line2D(x, y[:,j], > color = color, > @@ -285,7 +285,7 @@ > ret.append(seg) > > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > makeline(x[:,j], y[:,j]) > else: > makeline(x, y) > @@ -324,7 +324,7 @@ > closed = kwargs.get('closed', True) > func = makefill > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > func(x[:,j], y[:,j]) > else: > func(x, y) > @@ -372,7 +372,7 @@ > func = makefill > > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > func(x[:,j], y[:,j]) > else: > func(x, y) > @@ -3897,9 +3897,9 @@ > pass > elif align == 'center': > if orientation == 'vertical': > - left = [left[i] - width[i]/2. for i in range(len(left))] > + left = [left[i] - width[i]/2. for i in xrange(len(left))] > elif orientation == 'horizontal': > - bottom = [bottom[i] - height[i]/2. for i in range(len(bottom))] > + bottom = [bottom[i] - height[i]/2. for i in xrange(len(bottom))] > > else: > raise ValueError, 'invalid alignment: %s' % align > @@ -4571,7 +4571,7 @@ > elif nc == 1: > x = [x.ravel()] > else: > - x = [x[:,i] for i in range(nc)] > + x = [x[:,i] for i in xrange(nc)] > else: > raise ValueError, "input x can have no more than 2 dimensions" > if not hasattr(x[0], '__len__'): > @@ -4665,7 +4665,7 @@ > else: > def doplot(*args): > shuffled = [] > - for i in range(0, len(args), 3): > + for i in xrange(0, len(args), 3): > shuffled.extend([args[i+1], args[i], args[i+2]]) > return self.plot(*shuffled) > > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-checkins mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
Revision: 6226 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6226&view=rev Author: jdh2358 Date: 2008年10月16日 19:00:21 +0000 (2008年10月16日) Log Message: ----------- fixed gen_rst header Modified Paths: -------------- trunk/matplotlib/doc/contents.rst trunk/matplotlib/doc/examples/gen_rst.py Modified: trunk/matplotlib/doc/contents.rst =================================================================== --- trunk/matplotlib/doc/contents.rst 2008年10月16日 18:51:51 UTC (rev 6225) +++ trunk/matplotlib/doc/contents.rst 2008年10月16日 19:00:21 UTC (rev 6226) @@ -21,6 +21,7 @@ glossary/index.rst .. htmlonly:: + examples/index.rst * :ref:`genindex` * :ref:`modindex` Modified: trunk/matplotlib/doc/examples/gen_rst.py =================================================================== --- trunk/matplotlib/doc/examples/gen_rst.py 2008年10月16日 18:51:51 UTC (rev 6225) +++ trunk/matplotlib/doc/examples/gen_rst.py 2008年10月16日 19:00:21 UTC (rev 6226) @@ -14,10 +14,10 @@ datad = {} for root, subFolders, files in os.walk(rootdir): for fname in files: - if ( fname.startswith('.') or fname.startswith('#') or - fname.find('.svn')>=0 or not fname.endswith('.py') ): + if ( fname.startswith('.') or fname.startswith('#') or + fname.find('.svn')>=0 or not fname.endswith('.py') ): continue - + fullpath = os.path.join(root,fname) contents = file(fullpath).read() # indent @@ -28,13 +28,13 @@ subdirs = datad.keys() subdirs.sort() -fhindex = file('index.rst') -fh.index.write("""\ +fhindex = file('index.rst', 'w') +fhindex.write("""\ .. _examples-index: #################### Matplotlib Examples -################### +#################### .. htmlonly:: @@ -59,7 +59,7 @@ fh.write('*'*len(title) + '\n') fh.write(title + '\n') fh.write('*'*len(title) + '\n\n') - + for fname, contents in datad[subdir]: print ' ', fname basename, ext = os.path.splitext(fname) @@ -73,6 +73,6 @@ fh.write('\n\n') fh.close() - + fhindex.close() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6225 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6225&view=rev Author: jdh2358 Date: 2008年10月16日 18:51:51 +0000 (2008年10月16日) Log Message: ----------- added script to autogenerate example files Modified Paths: -------------- trunk/matplotlib/doc/_templates/index.html trunk/matplotlib/doc/_templates/indexsidebar.html trunk/matplotlib/doc/faq/installing_faq.rst trunk/matplotlib/doc/make.py trunk/matplotlib/doc/users/installing.rst trunk/matplotlib/doc/users/toolkits.rst Added Paths: ----------- trunk/matplotlib/doc/examples/ trunk/matplotlib/doc/examples/gen_rst.py Modified: trunk/matplotlib/doc/_templates/index.html =================================================================== --- trunk/matplotlib/doc/_templates/index.html 2008年10月16日 18:32:13 UTC (rev 6224) +++ trunk/matplotlib/doc/_templates/index.html 2008年10月16日 18:51:51 UTC (rev 6225) @@ -5,15 +5,15 @@ {% block body %} <h1>Welcome</h1> - matplotlib is a python 2D plotting library which produces + <p>matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. matplotlib can be used in python scripts, the python and <a href=http://ipython.scipy.org>ipython</a> shell (ala matlab or mathematica), web application servers, and six graphical user - interface toolkits. <p> + interface toolkits.</p> - matplotlib tries to make easy things easy and hard things possible. + <p>matplotlib tries to make easy things easy and hard things possible. You can generate plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc, with just a few lines of code. For example, to generate 10,000 gaussian random numbers and make a @@ -22,19 +22,20 @@ <pre> >>> from pylab import randn, hist >>> x = randn(10000) - >>> hist(x, 100) - </pre> + >>> hist(x, 100)</pre> For the power user, you have full control of line styles, font properties, axes properties, etc, via an object oriented interface - or via a handle graphics interface familiar to Matlab® users. + or via a handle graphics interface familiar to Matlab® users.</p> - The plotting functions in the <a href=api/pyplot_api.html>pyplot</a> - interface have a high degree of Matlab® compatibility.<p> + <p>The plotting functions in the <a href=api/pyplot_api.html>pyplot</a> + interface have a high degree of Matlab® compatibility.</p> - <br> + <h3>Plotting commands</h3> + <br> + <table border=1 cellpadding=3 cellspacing=2> - <caption><h3>Plotting commands</h3></caption> + <tr><th>Function</th><th>Description</th></tr> <tr> <th align="left"> Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 18:32:13 UTC (rev 6224) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 18:51:51 UTC (rev 6225) @@ -12,10 +12,22 @@ </p> <h3>Need help?</h3> +<<<<<<< .mine +<<<<<<< .mine +<p>Check the <a href="{{ pathto('contents') }}"}>docs</a>, +the <a href="{{ pathto('faq/index') }}">faq</a>, and join the +matplotlib +mailing <a href="http://sourceforge.net/project/showfiles.php?group_id=80706">lists</a>. +There is a also community wiki <a href=http://www.scipy.org/Cookbook/Matplotlib>cookbook</a></p> +======= +<p>Check the <a href="{{ pathto('users/index') }}"}>user</a> guide, the <a +======= <p>Check the <a href="{{ pathto('users/index') }}">user</a> guide, the <a +>>>>>>> .r6222 href="{{ pathto('faq/index') }}">faq</a>, the <a href="{{ pathto('api/index') }}"}>api</a> docs, <a href=http://www.nabble.com/matplotlib---users-f2906.html>archives</a>, and join the matplotlib mailing <a href="http://sourceforge.net/mail/?group_id=80706">lists</a> +>>>>>>> .r6221 <p>You can file bugs, patches and feature requests on the sourceforge <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>, but it is a good idea to ping us on the mailing list too.</p> Added: trunk/matplotlib/doc/examples/gen_rst.py =================================================================== --- trunk/matplotlib/doc/examples/gen_rst.py (rev 0) +++ trunk/matplotlib/doc/examples/gen_rst.py 2008年10月16日 18:51:51 UTC (rev 6225) @@ -0,0 +1,78 @@ +""" +generate the rst files for the examples by iterating over the pylab examples +""" +import os, glob + +import matplotlib.cbook as cbook + + +import os +import sys +fileList = [] +rootdir = '../mpl_examples' + +datad = {} +for root, subFolders, files in os.walk(rootdir): + for fname in files: + if ( fname.startswith('.') or fname.startswith('#') or + fname.find('.svn')>=0 or not fname.endswith('.py') ): + continue + + fullpath = os.path.join(root,fname) + contents = file(fullpath).read() + # indent + contents = '\n'.join([' %s'%row.rstrip() for row in contents.split('\n')]) + relpath = os.path.split(root)[-1] + datad.setdefault(relpath, []).append((fname, contents)) + +subdirs = datad.keys() +subdirs.sort() + +fhindex = file('index.rst') +fh.index.write("""\ +.. _examples-index: + +#################### +Matplotlib Examples +################### + +.. htmlonly:: + + :Release: |version| + :Date: |today| + +.. toctree:: + :maxdepth: 2 + +""") + +for subdir in subdirs: + print subdir + outfile = '%s.rst'%subdir + fh = file(outfile, 'w') + + fhindex.write(' %s\n'%outfile) + + fh.write('.. _%s-examples:\n\n'%subdir) + title = '%s examples'%subdir + + fh.write('*'*len(title) + '\n') + fh.write(title + '\n') + fh.write('*'*len(title) + '\n\n') + + for fname, contents in datad[subdir]: + print ' ', fname + basename, ext = os.path.splitext(fname) + fh.write('.. _%s-example:\n\n'%basename) + title = '%s example'%basename + + fh.write(title + '\n') + fh.write('='*len(title) + '\n\n') + fh.write(fname + '::\n\n') + fh.write(contents) + fh.write('\n\n') + fh.close() + + + +fhindex.close() Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008年10月16日 18:32:13 UTC (rev 6224) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008年10月16日 18:51:51 UTC (rev 6225) @@ -1,9 +1,10 @@ .. _installing-faq: -************* - Installation -************* +***************** + Installation FAQ +***************** + .. contents:: Modified: trunk/matplotlib/doc/make.py =================================================================== --- trunk/matplotlib/doc/make.py 2008年10月16日 18:32:13 UTC (rev 6224) +++ trunk/matplotlib/doc/make.py 2008年10月16日 18:51:51 UTC (rev 6225) @@ -17,10 +17,11 @@ def sf(): 'push a copy to the sf site' os.system('cd build/html; rsync -avz . jdh2358,mat...@we...:/home/groups/m/ma/matplotlib/htdocs/ -essh') + os.system('cd ~/mpl/examples; svn-clean; cd ..; rsync -avz examples jdh2358,mat...@we...:/home/groups/m/ma/matplotlib/htdocs/ -essh --cvs-exclude --delete') def sfpdf(): 'push a copy to the sf site' - os.system('cd build/latex; scp Matplotlib.pdf jd...@we...:/home/groups/m/ma/matplotlib/htdocs/') + os.system('cd build/latex; scp Matplotlib.pdf jdh2358,mat...@we...:/home/groups/m/ma/matplotlib/htdocs/') def figs(): os.system('cd users/figures/ && python make.py') Modified: trunk/matplotlib/doc/users/installing.rst =================================================================== --- trunk/matplotlib/doc/users/installing.rst 2008年10月16日 18:32:13 UTC (rev 6224) +++ trunk/matplotlib/doc/users/installing.rst 2008年10月16日 18:51:51 UTC (rev 6225) @@ -45,7 +45,7 @@ requirement to use matplotlib, we strongly encourage you to install `ipython <http://ipython.scipy.org/dist>`_, which is an interactive shell for python that is matplotlib aware. Once you have ipython, -numpy and matplotlib installed, ipython's "pylab" mode you have a +numpy and matplotlib installed, in ipython's "pylab" mode you have a matlab-like environment that automatically handles most of the configuration details for you, so you can get up and running quickly:: @@ -83,7 +83,7 @@ If you are interested perhaps in contributing to matplotlib development, or just like to build everything yourself, it is not -difficult to build matplotlib from source. Grab the lattest *tar.gz* +difficult to build matplotlib from source. Grab the latest *tar.gz* release file from `sourceforge <http://sourceforge.net/project/showfiles.php?group_id=80706>`_, or if you want to develop matplotlib or just need the latest bugfixed Modified: trunk/matplotlib/doc/users/toolkits.rst =================================================================== --- trunk/matplotlib/doc/users/toolkits.rst 2008年10月16日 18:32:13 UTC (rev 6224) +++ trunk/matplotlib/doc/users/toolkits.rst 2008年10月16日 18:51:51 UTC (rev 6225) @@ -35,12 +35,12 @@ .. _toolkit_natgrid: -Natrgrid +Natgrid ======== - + mpl_toolkits.natgrid is an interface to natgrid C library for gridding irregularly spaced data. This requires a separate installation of the natgrid toolkit from the sourceforge `download <http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=142792>`_ page. - + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6224 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6224&view=rev Author: jdh2358 Date: 2008年10月16日 18:32:13 +0000 (2008年10月16日) Log Message: ----------- minor formatting tweaks Modified Paths: -------------- trunk/matplotlib/examples/api/logo2.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/examples/api/logo2.py =================================================================== --- trunk/matplotlib/examples/api/logo2.py 2008年10月16日 17:32:39 UTC (rev 6223) +++ trunk/matplotlib/examples/api/logo2.py 2008年10月16日 18:32:13 UTC (rev 6224) @@ -9,8 +9,8 @@ import matplotlib.mlab as mlab from pylab import rand -mpl.rcParams['xtick.labelsize'] = 6 -mpl.rcParams['ytick.labelsize'] = 6 +mpl.rcParams['xtick.labelsize'] = 10 +mpl.rcParams['ytick.labelsize'] = 12 mpl.rcParams['axes.edgecolor'] = 'gray' @@ -18,7 +18,7 @@ #figcolor = '#EFEFEF' figcolor = 'white' dpi = 80 -fig = plt.figure(figsize=(6, 1.),dpi=dpi) +fig = plt.figure(figsize=(6, 1.1),dpi=dpi) fig.figurePatch.set_edgecolor(figcolor) fig.figurePatch.set_facecolor(figcolor) @@ -43,29 +43,40 @@ return ax def add_matplotlib_text(ax): - ax.text(0.975, 0.5, 'matplotlib', color='#11557c', fontsize=65, + ax.text(0.95, 0.5, 'matplotlib', color='#11557c', fontsize=65, ha='right', va='center', alpha=1.0, transform=ax.transAxes) def add_polar_bar(): - ax = fig.add_axes([0.05, 0.1, 0.2, 0.8], polar=True) + ax = fig.add_axes([0.025, 0.075, 0.2, 0.85], polar=True) + + ax.axesPatch.set_alpha(axalpha) + ax.set_axisbelow(True) N = 7 arc = 2. * np.pi theta = np.arange(0.0, arc, arc/N) - radii = 10 * np.array([0.2, 0.6, 1.0, 0.7, 0.4, 0.5, 0.8]) + radii = 10 * np.array([0.2, 0.6, 0.8, 0.7, 0.4, 0.5, 0.8]) width = np.pi / 4 * np.array([0.4, 0.4, 0.6, 0.8, 0.2, 0.5, 0.3]) bars = ax.bar(theta, radii, width=width, bottom=0.0) for r, bar in zip(radii, bars): bar.set_facecolor(cm.jet(r/10.)) bar.set_alpha(0.6) + for label in ax.get_xticklabels() + ax.get_yticklabels(): + label.set_visible(False) + + for line in ax.get_ygridlines() + ax.get_xgridlines(): + line.set_lw(0.8) + line.set_alpha(0.9) + line.set_ls('-') + line.set_color('0.5') + + ax.set_yticks(np.arange(1, 9, 2)) + ax.set_rmax(9) + if __name__ == '__main__': main_axes = add_math_background() add_polar_bar() -# add_histogram() -# add_scatter() -# add_pcolor() - #add_pcolor2() add_matplotlib_text(main_axes) fig.savefig('logo2.png', facecolor=figcolor, edgecolor=figcolor, dpi=dpi) plt.show() Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008年10月16日 17:32:39 UTC (rev 6223) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008年10月16日 18:32:13 UTC (rev 6224) @@ -3414,7 +3414,7 @@ *maxlags* is a positive integer detailing the number of lags to show. The default value of *None* will return all - :math:`2 \mathrm{len}(x) - 1`` lags. + :math:`2 \mathrm{len}(x) - 1` lags. The return value is a tuple (*lags*, *c*, *linecol*, *b*) where @@ -3425,9 +3425,8 @@ - *b* is the *x*-axis. .. seealso:: - :meth:`~matplotlib.axes.Axes.plot` or - :meth:`~matplotlib.axes.Axes.vlines`: - For documentation on valid kwargs. + :meth:`~matplotlib.axes.Axes.plot` or :meth:`~matplotlib.axes.Axes.vlines`: + For documentation on valid kwargs. **Example:** Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2008年10月16日 17:32:39 UTC (rev 6223) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2008年10月16日 18:32:13 UTC (rev 6224) @@ -1271,7 +1271,7 @@ dtype, the array will have this dtype. default: numpy.float_ .. seealso:: - See :file:`examples/load_demo.py` in the source tree: + See :file:`examples/pylab_examples/load_converter.py` in the source tree: Exercises many of these options. """ @@ -2414,7 +2414,7 @@ files is automatic, if the filename ends in .gz .. seealso:: - :func:`csv2rec` and :func:`rec2csv`: + :func:`csv2rec`: For information about *missing* and *missingd*, which can be used to fill in masked values into your CSV file. """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6223 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6223&view=rev Author: mdboom Date: 2008年10月16日 17:32:39 +0000 (2008年10月16日) Log Message: ----------- Improve auto-generated property tables to have links from the name of the property to the setter method. This is useful since many properties are not self-explanatory from their "ACCEPTS" list alone. Parse multi-line "ACCEPTS" statements in docstrings. Clean-up markup in FancyBoxPatch and related classes. Syntax highlight ipython session example. Judicious use of "seealso::" Lots of grammatical and capitalization clean-up Modified Paths: -------------- trunk/matplotlib/doc/devel/outline.rst trunk/matplotlib/doc/users/shell.rst trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/collections.py trunk/matplotlib/lib/matplotlib/colors.py trunk/matplotlib/lib/matplotlib/dates.py trunk/matplotlib/lib/matplotlib/image.py trunk/matplotlib/lib/matplotlib/lines.py trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/lib/matplotlib/mlab.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/lib/matplotlib/path.py trunk/matplotlib/lib/matplotlib/pyplot.py trunk/matplotlib/lib/matplotlib/text.py trunk/matplotlib/lib/matplotlib/ticker.py trunk/matplotlib/lib/matplotlib/transforms.py Modified: trunk/matplotlib/doc/devel/outline.rst =================================================================== --- trunk/matplotlib/doc/devel/outline.rst 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/doc/devel/outline.rst 2008年10月16日 17:32:39 UTC (rev 6223) @@ -75,7 +75,7 @@ there. ==================== =========== =================== -Module Author Status +Module Author Status ==================== =========== =================== backend_agg needs conversion backend_cairo needs conversion @@ -143,7 +143,7 @@ scale needs conversion table needs conversion texmanager Darren needs conversion -text Mike needs conversion +text Mike converted ticker Mike needs conversion transforms needs conversion type1font needs conversion Modified: trunk/matplotlib/doc/users/shell.rst =================================================================== --- trunk/matplotlib/doc/users/shell.rst 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/doc/users/shell.rst 2008年10月16日 17:32:39 UTC (rev 6223) @@ -25,8 +25,9 @@ Fortunately, `ipython <http://ipython.scipy.org/dist>`_, an enhanced interactive python shell, has figured out all of these tricks, and is -matplotlib aware, so when you start ipython in the *pylab* mode:: +matplotlib aware, so when you start ipython in the *pylab* mode. +.. sourcecode:: ipython johnh@flag:~> ipython -pylab Python 2.4.5 (#4, Apr 12 2008, 09:09:16) Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/artist.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -81,14 +81,14 @@ # TODO: add legend support def have_units(self): - 'return *True* if units are set on the x or y axes' + 'Return *True* if units are set on the *x* or *y* axes' ax = self.axes if ax is None or ax.xaxis is None: return False return ax.xaxis.have_units() or ax.yaxis.have_units() def convert_xunits(self, x): - """for artists in an axes, if the xaxis as units support, + """For artists in an axes, if the xaxis has units support, convert *x* using xaxis unit type """ ax = getattr(self, 'axes', None) @@ -98,7 +98,7 @@ return ax.xaxis.convert_units(x) def convert_yunits(self, y): - """for artists in an axes, if the yaxis as units support, + """For artists in an axes, if the yaxis has units support, convert *y* using yaxis unit type """ ax = getattr(self, 'axes', None) @@ -107,39 +107,64 @@ def set_axes(self, axes): """ - set the axes instance in which the artist resides, if any + Set the :class:`~matplotlib.axes.Axes` instance in which the + artist resides, if any. - ACCEPTS: an axes instance + ACCEPTS: an :class:`~matplotlib.axes.Axes` instance """ self.axes = axes def get_axes(self): - 'return the axes instance the artist resides in, or *None*' + """ + Return the :class:`~matplotlib.axes.Axes` instance the artist + resides in, or *None* + """ return self.axes def add_callback(self, func): + """ + Adds a callback function that will be called whenever one of + the :class:`Artist`'s properties changes. + + Returns an *id* that is useful for removing the callback with + :meth:`remove_callback` later. + """ oid = self._oid self._propobservers[oid] = func self._oid += 1 return oid def remove_callback(self, oid): + """ + Remove a callback based on its *id*. + + .. seealso:: + :meth:`add_callback` + """ try: del self._propobservers[oid] except KeyError: pass def pchanged(self): - 'fire event when property changed' + """ + Fire an event when property changed, calling all of the + registered callbacks. + """ for oid, func in self._propobservers.items(): func(self) def is_transform_set(self): - 'Artist has transform explicity let' + """ + Returns *True* if :class:`Artist` has a transform explicitly + set. + """ return self._transformSet def set_transform(self, t): """ Set the :class:`~matplotlib.transforms.Transform` instance used by this artist. + + ACCEPTS: :class:`~matplotlib.transforms.Transform` instance """ self._transform = t self._transformSet = True @@ -154,8 +179,10 @@ self._transform = IdentityTransform() return self._transform - def hitlist(self,event): - """List the children of the artist which contain the mouse event""" + def hitlist(self, event): + """ + List the children of the artist which contain the mouse event *event*. + """ import traceback L = [] try: @@ -172,7 +199,10 @@ return L def get_children(self): - 'return a list of the child artist this artist contains' + """ + Return a list of the child :class:`Artist`s this + :class:`Artist` contains. + """ return [] def contains(self, mouseevent): @@ -188,23 +218,29 @@ return False,{} def set_contains(self,picker): - """Replace the contains test used by this artist. The new picker should - be a callable function which determines whether the artist is hit by the - mouse event:: + """ + Replace the contains test used by this artist. The new picker + should be a callable function which determines whether the + artist is hit by the mouse event:: hit, props = picker(artist, mouseevent) - If the mouse event is over the artist, return *hit=True* and *props* - is a dictionary of properties you want returned with the contains test. + If the mouse event is over the artist, return *hit* = *True* + and *props* is a dictionary of properties you want returned + with the contains test. + + ACCEPTS: a callable function """ self._contains = picker def get_contains(self): - 'return the _contains test used by the artist, or *None* for default.' + """ + Return the _contains test used by the artist, or *None* for default. + """ return self._contains def pickable(self): - 'return *True* if self is pickable' + 'Return *True* if :class:`Artist` is pickable.' return (self.figure is not None and self.figure.canvas is not None and self._picker is not None) @@ -234,7 +270,7 @@ def set_picker(self, picker): """ - set the epsilon for picking used by this artist + Set the epsilon for picking used by this artist *picker* can be one of the following: @@ -267,10 +303,14 @@ self._picker = picker def get_picker(self): - 'return the Pickeration instance used by this artist' + 'Return the picker object used by this artist' return self._picker def is_figure_set(self): + """ + Returns True if the artist is assigned to a + :class:`~matplotlib.figure.Figure`. + """ return self.figure is not None def get_figure(self): @@ -292,9 +332,9 @@ def set_clip_box(self, clipbox): """ - Set the artist's clip Bbox + Set the artist's clip :class:`~matplotlib.transforms.Bbox`. - ACCEPTS: a :class:`matplotlib.transform.Bbox` instance + ACCEPTS: a :class:`matplotlib.transforms.Bbox` instance """ self.clipbox = clipbox self.pchanged() @@ -316,9 +356,9 @@ rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to *None*. - ACCEPTS: a :class:`~matplotlib.path.Path` instance and a - :class:`~matplotlib.transforms.Transform` instance, a - :class:`~matplotlib.patches.Patch` instance, or *None*. + ACCEPTS: [ (:class:`~matplotlib.path.Path`, + :class:`~matplotlib.transforms.Transform`) | + :class:`~matplotlib.patches.Patch` | None ] """ from patches import Patch, Rectangle @@ -355,11 +395,11 @@ return self._alpha def get_visible(self): - "return the artist's visiblity" + "Return the artist's visiblity" return self._visible def get_animated(self): - "return the artist's animated state" + "Return the artist's animated state" return self._animated def get_clip_on(self): @@ -386,7 +426,7 @@ def set_clip_on(self, b): """ - Set whether artist uses clipping + Set whether artist uses clipping. ACCEPTS: [True | False] """ @@ -394,7 +434,7 @@ self.pchanged() def _set_gc_clip(self, gc): - 'set the clip properly for the gc' + 'Set the clip properly for the gc' if self._clipon: if self.clipbox is not None: gc.set_clip_rectangle(self.clipbox) @@ -412,7 +452,7 @@ Set the alpha value used for blending - not supported on all backends - ACCEPTS: float + ACCEPTS: float (0.0 transparent through 1.0 opaque) """ self._alpha = alpha self.pchanged() @@ -430,7 +470,7 @@ def set_visible(self, b): """ - set the artist's visiblity + Set the artist's visiblity. ACCEPTS: [True | False] """ @@ -440,7 +480,7 @@ def set_animated(self, b): """ - set the artist's animation state + Set the artist's animation state. ACCEPTS: [True | False] """ @@ -448,6 +488,10 @@ self.pchanged() def update(self, props): + """ + Update the properties of this :class:`Artist` from the + dictionary *prop*. + """ store = self.eventson self.eventson = False changed = False @@ -462,11 +506,14 @@ def get_label(self): + """ + Get the label used for this artist in the legend. + """ return self._label def set_label(self, s): """ - Set the line label to *s* for auto legend + Set the label to *s* for auto legend. ACCEPTS: any string """ @@ -475,11 +522,16 @@ - def get_zorder(self): return self.zorder + def get_zorder(self): + """ + Return the :class:`Artist`'s zorder. + """ + return self.zorder def set_zorder(self, level): """ - Set the zorder for the artist + Set the zorder for the artist. Artists with lower zorder + values are drawn first. ACCEPTS: any number """ @@ -600,7 +652,7 @@ aliases[fullname[4:]] = name[4:] return aliases - _get_valid_values_regex = re.compile(r"\n\s*ACCEPTS:\s*(.*)\n") + _get_valid_values_regex = re.compile(r"\n\s*ACCEPTS:\s*((?:.|\n)*?)(?:$|(?:\n\n))") def get_valid_values(self, attr): """ Get the legal arguments for the setter associated with *attr*. @@ -625,25 +677,38 @@ match = self._get_valid_values_regex.search(docstring) if match is not None: - return match.group(1) + return match.group(1).replace('\n', ' ') return 'unknown' - def get_setters(self): + def _get_setters_and_targets(self): """ - Get the attribute strings with setters for object. Eg., for a line, - return ``['markerfacecolor', 'linewidth', ....]``. + Get the attribute strings and a full path to where the setter + is defined for all setters in an object. """ setters = [] for name in dir(self.o): if not name.startswith('set_'): continue - o = getattr(self.o,name) + o = getattr(self.o, name) if not callable(o): continue func = o if self.is_alias(func): continue - setters.append(name[4:]) + source_class = self.o.__module__ + "." + self.o.__name__ + for cls in self.o.mro(): + if name in cls.__dict__: + source_class = cls.__module__ + "." + cls.__name__ + break + setters.append((name[4:], source_class + "." + name)) return setters + def get_setters(self): + """ + Get the attribute strings with setters for object. Eg., for a line, + return ``['markerfacecolor', 'linewidth', ....]``. + """ + + return [prop for prop, target in self._get_setters_and_targets()] + def is_alias(self, o): """ Return *True* if method object *o* is an alias for another @@ -653,7 +718,7 @@ if ds is None: return False return ds.startswith('alias for ') - def aliased_name(self, s): + def aliased_name(self, s, target): """ return 'PROPNAME or alias' if *s* has an alias, else return PROPNAME. @@ -662,9 +727,10 @@ alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform' """ + if s in self.aliasd: - return '%s or %s' % (s, self.aliasd[s]) - else: return s + return ':meth:`%s <%s>` or %s' % (s, target, self.aliasd[s]) + else: return ':meth:`%s <%s>`' % (s, target) def pprint_setters(self, prop=None, leadingspace=2): """ @@ -683,13 +749,13 @@ accepts = self.get_valid_values(prop) return '%s%s: %s' %(pad, prop, accepts) - attrs = self.get_setters() + attrs = self._get_setters_and_targets() attrs.sort() lines = [] ######## - names = [self.aliased_name(prop) for prop in attrs] - accepts = [self.get_valid_values(prop) for prop in attrs] + names = [self.aliased_name(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]) col1_len = max([len(a) for a in accepts]) @@ -709,9 +775,9 @@ return lines ######## - for prop in attrs: + for prop, path in attrs: accepts = self.get_valid_values(prop) - name = self.aliased_name(prop) + name = self.aliased_name(prop, path) lines.append('%s%s: %s' %(pad, name, accepts)) return lines @@ -792,17 +858,17 @@ getp(o, 'linestyle') # get the linestyle property - o is a :class:`Artist` instance, eg + *o* is a :class:`Artist` instance, eg :class:`~matplotllib.lines.Line2D` or an instance of a :class:`~matplotlib.axes.Axes` or :class:`matplotlib.text.Text`. If the *property* is 'somename', this function returns o.get_somename() - getp can be used to query all the gettable properties with getp(o) - Many properties have aliases for shorter typing, eg 'lw' is an - alias for 'linewidth'. In the output, aliases and full property - names will be listed as:: + :func:`getp` can be used to query all the gettable properties with + ``getp(o)``. Many properties have aliases for shorter typing, e.g. + 'lw' is an alias for 'linewidth'. In the output, aliases and full + property names will be listed as:: property or alias = value Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -41,10 +41,10 @@ * '.b': blue dots * 'r--': red dashed lines - See :func:`~matplotlib.Line2D.lineStyles` and - :func:`~matplotlib.pyplot.colors` for all possible styles and - color format string. - + .. seealso:: + :func:`~matplotlib.Line2D.lineStyles` and + :func:`~matplotlib.pyplot.colors`: + for all possible styles and color format string. """ linestyle = None @@ -419,12 +419,11 @@ :class:`~matplotlib.patches.Polygon`, etc., and sets the coordinate system. - The :class:`Axes` instance supports callbacks through a callbacks attribute - which is a :class:`~matplotlib.cbook.CallbackRegistry` instance. - The events you can connect to are :meth:`xlim_changed` and - :meth:`ylim_changed` and the callback will be called with - func(*ax() where *ax* is the :class:`Axes` instance. - + The :class:`Axes` instance supports callbacks through a callbacks + attribute which is a :class:`~matplotlib.cbook.CallbackRegistry` + instance. The events you can connect to are 'xlim_changed' and + 'ylim_changed' and the callback will be called with func(*ax*) + where *ax* is the :class:`Axes` instance. """ name = "rectilinear" @@ -2493,13 +2492,16 @@ set_title(label, fontdict=None, **kwargs): - Set the title for the axes. See the :meth:`text` for - information of how override and the optional args work + Set the title for the axes. kwargs are Text properties: %(Text)s ACCEPTS: str + + .. seealso:: + :meth:`text`: + for information on how override and the optional args work """ default = { 'fontsize':rcParams['axes.titlesize'], @@ -2527,12 +2529,15 @@ set_xlabel(xlabel, fontdict=None, **kwargs) - Set the label for the xaxis. See the :meth:`text` docstring - for information of how override and the optional args work. + Set the label for the xaxis. Valid kwargs are Text properties: %(Text)s ACCEPTS: str + + .. seealso:: + :meth:`text`: + for information on how override and the optional args work """ label = self.xaxis.get_label() @@ -2557,12 +2562,13 @@ Set the label for the yaxis - See the :meth:`text` doctstring for information of how - override and the optional args work - Valid kwargs are Text properties: %(Text)s ACCEPTS: str + + .. seealso:: + :meth:`text`: + for information on how override and the optional args work """ label = self.yaxis.get_label() label.set_text(ylabel) @@ -2711,7 +2717,9 @@ %(Line2D)s - See :meth:`axhspan` for example plot and source code + .. seealso:: + :meth:`axhspan`: + for example plot and source code """ ymin, ymax = self.get_ybound() @@ -2765,7 +2773,9 @@ %(Line2D)s - See :meth:`axhspan` for example plot and source code + .. seealso:: + :meth:`axhspan`: + for example plot and source code """ xmin, xmax = self.get_xbound() @@ -2863,7 +2873,9 @@ %(Polygon)s - See :meth:`axhspan` for example plot and source code + .. seealso:: + :meth:`axhspan`: + for example plot and source code """ # convert x axis units trans = mtransforms.blended_transform_factory( @@ -3166,12 +3178,6 @@ *x* and/or *y* can be a sequence of dates represented as float days since 0001年01月01日 UTC. - See :mod:`~matplotlib.dates` for helper functions - :func:`~matplotlib.dates.date2num`, - :func:`~matplotlib.dates.num2date` and - :func:`~matplotlib.dates.drange` for help on creating the - required floating point dates. - Keyword arguments: *fmt*: string @@ -3203,6 +3209,15 @@ %(Line2D)s + .. seealso:: + :mod:`~matplotlib.dates`: + for helper functions + + :func:`~matplotlib.dates.date2num`, + :func:`~matplotlib.dates.num2date` and + :func:`~matplotlib.dates.drange`: + for help on creating the required floating point + dates. """ if not self._hold: self.cla() @@ -3302,7 +3317,9 @@ %(Line2D)s - See :meth:`loglog` for example code and figure + .. seealso:: + :meth:`loglog`: + For example code and figure """ if not self._hold: self.cla() d = {'basex': kwargs.pop( 'basex', 10), @@ -3345,7 +3362,9 @@ %(Line2D)s - See :meth:`loglog` for example code and figure + .. seealso:: + :meth:`loglog`: + For example code and figure """ if not self._hold: self.cla() d = {'basey': kwargs.pop('basey', 10), @@ -3365,7 +3384,7 @@ call signature:: acorr(x, normed=False, detrend=mlab.detrend_none, usevlines=False, - maxlags=None, **kwargs) + maxlags=None, **kwargs) Plot the autocorrelation of *x*. If *normed* = *True*, normalize the data but the autocorrelation at 0-th lag. *x* is @@ -3375,38 +3394,41 @@ Return value is a tuple (*lags*, *c*, *line*) where: - - *lags* are a length 2*maxlags+1 lag vector + - *lags* are a length 2*maxlags+1 lag vector - - *c* is the 2*maxlags+1 auto correlation vector + - *c* is the 2*maxlags+1 auto correlation vector - - *line* is a :class:`~matplotlib.lines.Line2D` instance - returned by :meth:`plot` + - *line* is a :class:`~matplotlib.lines.Line2D` instance + returned by :meth:`plot` The default *linestyle* is None and the default *marker* is ``'o'``, though these can be overridden with keyword args. - The cross correlation is performed with :func:`numpy.correlate` with - *mode* = 2. + The cross correlation is performed with + :func:`numpy.correlate` with *mode* = 2. If *usevlines* is *True*, :meth:`~matplotlib.axes.Axes.vlines` rather than :meth:`~matplotlib.axes.Axes.plot` is used to draw vertical lines from the origin to the acorr. Otherwise, the plot style is determined by the kwargs, which are - :class:`~matplotlib.lines.Line2D` properties. The return - value is a tuple (*lags*, *c*, *linecol*, *b*) where + :class:`~matplotlib.lines.Line2D` properties. + *maxlags* is a positive integer detailing the number of lags + to show. The default value of *None* will return all + :math:`2 \mathrm{len}(x) - 1`` lags. + + The return value is a tuple (*lags*, *c*, *linecol*, *b*) + where + - *linecol* is the :class:`~matplotlib.collections.LineCollection` - *b* is the *x*-axis. - *maxlags* is a positive integer detailing the number of lags - to show. The default value of *None* will return all - ``(2*len(x)-1)`` lags. + .. seealso:: + :meth:`~matplotlib.axes.Axes.plot` or + :meth:`~matplotlib.axes.Axes.vlines`: + For documentation on valid kwargs. - See the respective :meth:`~matplotlib.axes.Axes.plot` or - :meth:`~matplotlib.axes.Axes.vlines` functions for - documentation on valid kwargs. - **Example:** :func:`~matplotlib.pyplot.xcorr` above, and @@ -4095,9 +4117,13 @@ Return value is a tuple (*markerline*, *stemlines*, *baseline*). - See `this document - <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html>`_ - for details and :file:`examples/pylab_examples/stem_plot.py` for a demo. + .. seealso:: + `this document + <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html>`_: + for details + + :file:`examples/pylab_examples/stem_plot.py`: + for a demo """ remember_hold=self._hold if not self._hold: self.cla() @@ -5359,8 +5385,6 @@ xs, ys = poly_between(x, 0, y) axes.fill(xs, ys, facecolor='red', alpha=0.5) - See :file:`examples/pylab_examples/fill_between.py` for more examples. - The *closed* kwarg will close the polygon when *True* (default). kwargs control the Polygon properties: @@ -5370,6 +5394,10 @@ **Example:** .. plot:: ../mpl_examples/pylab_examples/fill_demo.py + + .. seealso:: + :file:`examples/pylab_examples/fill_between.py`: + For more examples. """ if not self._hold: self.cla() @@ -5805,15 +5833,16 @@ Return value is a :class:`matplotlib.collection.QuadMesh` object. - See :func:`~matplotlib.pyplot.pcolor` for an explanation of - the grid orientation and the expansion of 1-D *X* and/or *Y* - to 2-D arrays. - kwargs can be used to control the :class:`matplotlib.collections.QuadMesh` properties: %(QuadMesh)s + + .. seealso:: + :func:`~matplotlib.pyplot.pcolor`: + For an explanation of the grid orientation and the + expansion of 1-D *X* and/or *Y* to 2-D arrays. """ if not self._hold: self.cla() @@ -6519,8 +6548,6 @@ to compute :math:`P_{xy}`, with a scaling to correct for power loss due to windowing. - See :meth:`psd` for a description of the optional parameters. - Returns the tuple (*Pxy*, *freqs*). *P* is the cross spectrum (complex valued), and :math:`10\log_{10}|P_{xy}|` is plotted. @@ -6536,6 +6563,10 @@ **Example:** .. plot:: ../mpl_examples/pylab_examples/csd_demo.py + + .. seealso: + :meth:`psd` + For a description of the optional parameters. """ if not self._hold: self.cla() pxy, freqs = mlab.csd(x, y, NFFT, Fs, detrend, window, noverlap) @@ -6576,8 +6607,6 @@ The return value is a tuple (*Cxy*, *f*), where *f* are the frequencies of the coherence vector. - See the :meth:`psd` for a description of the optional parameters. - kwargs are applied to the lines. References: @@ -6593,6 +6622,10 @@ **Example:** .. plot:: ../mpl_examples/pylab_examples/cohere_demo.py + + .. seealso: + :meth:`psd` + For a description of the optional parameters. """ if not self._hold: self.cla() cxy, freqs = mlab.cohere(x, y, NFFT, Fs, detrend, window, noverlap) @@ -6633,9 +6666,6 @@ default 0, max(bins), 0, max(freqs) where bins is the return value from mlab.specgram - See :meth:`~matplotlib.axes.Axes.psd` for information on the - other keyword arguments. - Return value is (*Pxx*, *freqs*, *bins*, *im*): - *bins* are the time points the spectrogram is calculated over @@ -6646,6 +6676,10 @@ Note: If *x* is real (i.e. non-complex), only the positive spectrum is shown. If *x* is complex, both positive and negative parts of the spectrum are shown. + + .. seealso: + :meth:`psd` + For a description of the optional parameters. """ if not self._hold: self.cla() @@ -6709,7 +6743,8 @@ * *cmap* * *alpha* - See documentation for :func:`~matplotlib.pyplot.imshow` for details. + .. seealso:: + :func:`~matplotlib.pyplot.imshow` For controlling colors, e.g. cyan background and red marks, use:: @@ -6722,8 +6757,6 @@ * *markersize* * *color* - See documentation for :func:`~matplotlib.pyplot.plot` for details. - Useful values for *marker* include: * 's' square (default) @@ -6731,6 +6764,8 @@ * '.' point * ',' pixel + .. seealso:: + :func:`~matplotlib.pyplot.plot` """ if precision is None: precision = 0 Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -483,11 +483,14 @@ def get_dashes(self): """ - Return the dash information as an offset dashlist tuple The - dash list is a even size list that gives the ink on, ink off - in pixels. See p107 of to postscript `BLUEBOOK + Return the dash information as an offset dashlist tuple. + + The dash list is a even size list that gives the ink on, ink + off in pixels. + + See p107 of to PostScript `BLUEBOOK <http://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF>`_ - for more info + for more info. Default value is None """ Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -262,7 +262,9 @@ def set_linestyles(self, ls): """ Set the linestyles(s) for the collection. - ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ] + + ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | + (offset, on-off-dash-seq) ] """ try: dashd = backend_bases.GraphicsContextBase.dashd @@ -314,9 +316,11 @@ def set_color(self, c): """ Set both the edgecolor and the facecolor. - See :meth:`set_facecolor` and :meth:`set_edgecolor`. ACCEPTS: matplotlib color arg or sequence of rgba tuples + + .. seealso:: + :meth:`set_facecolor`, :meth:`set_edgecolor` """ self.set_facecolor(c) self.set_edgecolor(c) Modified: trunk/matplotlib/lib/matplotlib/colors.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colors.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/colors.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -530,7 +530,9 @@ segmentdata argument is a dictionary with a red, green and blue entries. Each entry should be a list of x, y0, y1 tuples. - See makeMappingArray for details + + .. seealso:: + :func:`makeMappingArray` """ self.monochrome = False # True only if all colors in map are identical; # needed for contouring. Modified: trunk/matplotlib/lib/matplotlib/dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dates.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/dates.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -9,9 +9,9 @@ conversion to and from datetime and numeric ranges. A wide range of specific and general purpose date tick locators and -formatters are provided in this module. See matplotlib.tickers for -general information on tick locators and formatters. These are -described below. +formatters are provided in this module. See +:module:`matplotlib.ticker` for general information on tick locators +and formatters. These are described below. All the matplotlib date converters, tickers and formatters are timezone aware, and the default timezone is given by the timezone Modified: trunk/matplotlib/lib/matplotlib/image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/image.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/image.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -330,7 +330,9 @@ """ Set the interpolation method the image uses when resizing. - ACCEPTS: ['bicubic' | 'bilinear' | 'blackman100' | 'blackman256' | 'blackman64', 'nearest' | 'sinc144' | 'sinc256' | 'sinc64' | 'spline16' | 'spline36'] + ACCEPTS: ['bicubic' | 'bilinear' | 'blackman100' | 'blackman256' | + 'blackman64', 'nearest' | 'sinc144' | 'sinc256' | 'sinc64' | + 'spline16' | 'spline36'] """ if s is None: s = rcParams['image.interpolation'] s = s.lower() Modified: trunk/matplotlib/lib/matplotlib/lines.py =================================================================== --- trunk/matplotlib/lib/matplotlib/lines.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/lines.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -299,14 +299,15 @@ def set_pickradius(self,d): """Sets the pick radius used for containment tests - Accepts: float distance in points. + ACCEPTS: float distance in points """ self.pickradius = d def set_picker(self,p): """Sets the event picker details for the line. - Accepts: float distance in points or callable pick function fn(artist,event) + ACCEPTS: float distance in points or callable pick function + ``fn(artist, event)`` """ if callable(p): self._contains = p @@ -330,12 +331,13 @@ self._xcid = ax.xaxis.callbacks.connect('units', self.recache) if ax.yaxis is not None: self._ycid = ax.yaxis.callbacks.connect('units', self.recache) + set_axes.__doc__ = Artist.set_axes.__doc__ def set_data(self, *args): """ Set the x and y data - ACCEPTS: (np.array xdata, np.array ydata) + ACCEPTS: 2D array """ if len(args)==1: x, y = args[0] @@ -401,7 +403,7 @@ """ set the Transformation instance used by this artist - ACCEPTS: a matplotlib.transforms.Transform instance + ACCEPTS: a :class:`matplotlib.transforms.Transform` instance """ Artist.set_transform(self, t) self._invalid = True @@ -673,7 +675,7 @@ """ Set the data np.array for x - ACCEPTS: np.array + ACCEPTS: 1D array """ x = np.asarray(x) self.set_data(x, self._yorig) @@ -682,7 +684,7 @@ """ Set the data np.array for y - ACCEPTS: np.array + ACCEPTS: 1D array """ y = np.asarray(y) self.set_data(self._xorig, y) Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -60,8 +60,8 @@ USAGE: - See http://matplotlib.sourceforge.net/tutorial.html#mathtext for a - tutorial introduction. + See http://matplotlib.sf.net/users/mathtext.html for a tutorial + introduction. Any text element (xlabel, ylabel, title, text, etc) can use TeX markup, as in Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -330,21 +330,25 @@ window vectors see numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window etc. - See psd for more info. (psd differs in the default overlap; - in returning the mean of the segment periodograms; and in not - returning times.) + If *x* is real (i.e. non-complex) only the positive spectrum is + given. If *x* is complex then the complete spectrum is given. - If x is real (i.e. non-Complex) only the positive spectrum is - given. If x is Complex then the complete spectrum is given. + Returns a tuple (*Pxx*, *freqs*, *t*): - returns: - Pxx - 2-D array, columns are the periodograms of - successive segments - freqs - 1-D array of frequencies corresponding to - the rows in Pxx - t - 1-D array of times corresponding to midpoints of - segments. + - *Pxx*: 2-D array, columns are the periodograms of + successive segments + - *freqs*: 1-D array of frequencies corresponding to the rows + in Pxx + + - *t*: 1-D array of times corresponding to midpoints of + segments. + + .. seealso:: + :func:`psd`: + :func:`psd` differs in the default overlap; in returning + the mean of the segment periodograms; and in not returning + times. """ x = np.asarray(x) assert(NFFT>noverlap) @@ -407,15 +411,19 @@ The coherence between x and y. Coherence is the normalized cross spectral density - Cxy = |Pxy|^2/(Pxx*Pyy) + .. math:: - The return value is (Cxy, f), where f are the frequencies of the - coherence vector. See the docs for psd and csd for information - about the function arguments NFFT, detrend, window, noverlap, as - well as the methods used to compute Pxy, Pxx and Pyy. + C_{xy} = \frac{|P_{xy}|^2}/{P_{xx}P_{yy}} - Returns the tuple Cxy, freqs + The return value is the tuple (*Cxy*, *f*), where *f* are the + frequencies of the coherence vector. + .. seealso:: + :func:`psd` and :func:`csd`: + For information about the function arguments *NFFT*, + *detrend*, *window*, *noverlap*, as well as the methods + used to compute :math:`P_{xy}`, :math:`P_{xx}` and + :math:`P_{yy}`. """ if len(x)<2*NFFT: @@ -483,8 +491,8 @@ but note that the k's and n's in the superscripts and subscripts on that page. The linear algebra is correct, however. - See also polyval - + .. seealso:: + :func:`polyval` """ warnings.warn("use numpy.poyfit", DeprecationWarning) return np.polyfit(*args, **kwargs) @@ -505,8 +513,8 @@ trend = polyval(p, x) resid = y - trend - See also polyfit - + .. seealso:: + :func:`polyfit` """ warnings.warn("use numpy.polyval", DeprecationWarning) return np.polyval(*args, **kwargs) @@ -590,10 +598,11 @@ 10x faster than naievly crunching all possible pairs through cohere. - See test/cohere_pairs_test.py in the src tree for an example - script that shows that this cohere_pairs and cohere give the same - results for a given pair. - + .. seealso:: + :file:`test/cohere_pairs_test.py` in the src tree: + For an example script that shows that this + :func:`cohere_pairs` and :func:`cohere` give the same + results for a given pair. """ numRows, numCols = X.shape @@ -1062,13 +1071,22 @@ def liaupunov(x, fprime): """ - x is a very long trajectory from a map, and fprime returns the - derivative of x. Return lambda = 1/n\sum ln|fprime(x_i)|. See Sec - 10.5 Strogatz (1994)"Nonlinear Dynamics and Chaos". - See also http://en.wikipedia.org/wiki/Lyapunov_exponent. - What the function here calculates may not be what you really want; - caveat emptor. - It also seems that this function's name is badly misspelled. + *x* is a very long trajectory from a map, and *fprime* returns the + derivative of *x*. + + Returns :math:`\lambda = \frac{1}{n}\sum \ln|f^'(x_i)|` + + .. seealso:: + Sec 10.5 Strogatz (1994) "Nonlinear Dynamics and Chaos". + + `Wikipedia article on Lyapunov Exponent + http://en.wikipedia.org/wiki/Lyapunov_exponent`_. + + .. note:: + What the function here calculates may not be what you really want; + *caveat emptor*. + + It also seems that this function's name is badly misspelled. """ return np.mean(np.log(np.absolute(fprime(x)))) @@ -1252,7 +1270,9 @@ dtype, the array will have this dtype. default: numpy.float_ - See examples/load_demo.py which exeercises many of these options. + .. seealso:: + See :file:`examples/load_demo.py` in the source tree: + Exercises many of these options. """ if converters is None: converters = {} @@ -2393,9 +2413,10 @@ fname - can be a filename or a file handle. Support for gzipped files is automatic, if the filename ends in .gz - See csv2rec and rec2csv for information about missing and - missingd, which can be used to fill in masked values into your CSV - file. + .. seealso:: + :func:`csv2rec` and :func:`rec2csv`: + For information about *missing* and *missingd*, which can + be used to fill in masked values into your CSV file. """ if missingd is None: Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -51,39 +51,6 @@ def __str__(self): return str(self.__class__).split('.')[-1] - def __init__(self, - edgecolor=None, - facecolor=None, - linewidth=None, - linestyle=None, - antialiased = None, - hatch = None, - fill=True, - **kwargs - ): - """ - The following kwarg properties are supported - %(Patch)s - """ - artist.Artist.__init__(self) - - if linewidth is None: linewidth = mpl.rcParams['patch.linewidth'] - if linestyle is None: linestyle = "solid" - if antialiased is None: antialiased = mpl.rcParams['patch.antialiased'] - - self.set_edgecolor(edgecolor) - self.set_facecolor(facecolor) - self.set_linewidth(linewidth) - self.set_linestyle(linestyle) - self.set_antialiased(antialiased) - self.set_hatch(hatch) - self.fill = fill - self._combined_transform = transforms.IdentityTransform() - - if len(kwargs): artist.setp(self, **kwargs) - __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd - - def get_verts(self): """ Return a copy of the vertices used in this patch @@ -176,8 +143,11 @@ """ if color is None: color = mpl.rcParams['patch.edgecolor'] self._edgecolor = color - set_ec = set_edgecolor + def set_ec(self, color): + """alias for set_edgecolor""" + return self.set_edgecolor(color) + def set_facecolor(self, color): """ Set the patch face color @@ -186,8 +156,11 @@ """ if color is None: color = mpl.rcParams['patch.facecolor'] self._facecolor = color - set_fc = set_facecolor + def set_fc(self, color): + """alias for set_facecolor""" + return self.set_facecolor(color) + def set_linewidth(self, w): """ Set the patch linewidth in points @@ -196,8 +169,11 @@ """ if w is None: w = mpl.rcParams['patch.linewidth'] self._linewidth = w - set_lw = set_linewidth + def set_lw(self, lw): + """alias for set_linewidth""" + return self.set_linewidth(lw) + def set_linestyle(self, ls): """ Set the patch linestyle @@ -206,8 +182,11 @@ """ if ls is None: ls = "solid" self._linestyle = ls - set_ls = set_linestyle + def set_ls(self, ls): + """alias for set_linestyle""" + return self.set_linestyle(ls) + def set_fill(self, b): """ Set whether to fill the patch @@ -297,7 +276,49 @@ def get_window_extent(self, renderer=None): return self.get_path().get_extents(self.get_transform()) +artist.kwdocd['Patch'] = patchdoc = artist.kwdoc(Patch) +for k in ('Rectangle', 'Circle', 'RegularPolygon', 'Polygon', 'Wedge', 'Arrow', + 'FancyArrow', 'YAArrow', 'CirclePolygon', 'Ellipse', 'Arc', + 'FancyBboxPatch'): + artist.kwdocd[k] = patchdoc +# define Patch.__init__ after the class so that the docstring can be +# auto-generated. +def __patch__init__(self, + edgecolor=None, + facecolor=None, + linewidth=None, + linestyle=None, + antialiased = None, + hatch = None, + fill=True, + **kwargs + ): + """ + The following kwarg properties are supported + + %(Patch)s + """ + artist.Artist.__init__(self) + + if linewidth is None: linewidth = mpl.rcParams['patch.linewidth'] + if linestyle is None: linestyle = "solid" + if antialiased is None: antialiased = mpl.rcParams['patch.antialiased'] + + self.set_edgecolor(edgecolor) + self.set_facecolor(facecolor) + self.set_linewidth(linewidth) + self.set_linestyle(linestyle) + self.set_antialiased(antialiased) + self.set_hatch(hatch) + self.fill = fill + self._combined_transform = transforms.IdentityTransform() + + if len(kwargs): artist.setp(self, **kwargs) + +__patch__init__.__doc__ = cbook.dedent(__patch__init__.__doc__) % artist.kwdocd +Patch.__init__ = __patch__init__ + class Shadow(Patch): def __str__(self): return "Shadow(%s)"%(str(self.patch)) @@ -571,7 +592,10 @@ Valid kwargs are: %(Patch)s - See Patch documentation for additional kwargs + + .. seealso:: + :class:`Patch`: + For additional kwargs """ Patch.__init__(self, **kwargs) self._path = path @@ -596,7 +620,10 @@ Valid kwargs are: %(Patch)s - See Patch documentation for additional kwargs + + .. seealso:: + :class:`Patch`: + For additional kwargs """ Patch.__init__(self, **kwargs) xy = np.asarray(xy, np.float_) @@ -1019,7 +1046,7 @@ can not be filled. The arc must be used in an :class:`~matplotlib.axes.Axes` - instance---it cannot be added directly to a + instance---it can not be added directly to a :class:`~matplotlib.figure.Figure`---because it is optimized to only render the segments that are inside the axes bounding box with high resolution. @@ -1266,17 +1293,7 @@ r.set_clip_on( False ) r.draw(renderer) -artist.kwdocd['Patch'] = patchdoc = artist.kwdoc(Patch) -for k in ('Rectangle', 'Circle', 'RegularPolygon', 'Polygon', 'Wedge', 'Arrow', - 'FancyArrow', 'YAArrow', 'CirclePolygon', 'Ellipse', 'Arc'): - artist.kwdocd[k] = patchdoc - - - - - - class BboxTransmuterBase(object): """ Bbox Transmuter Base class @@ -1284,7 +1301,7 @@ BBoxTransmuterBase and its derivatives are used to make a fancy box around a given rectangle. The __call__ method returns the Path of the fancy box. This class is not an artist and actual drawing of the - fancy box is done by the FancyBboxPatch class. + fancy box is done by the :class:`FancyBboxPatch` class. """ @@ -1428,7 +1445,7 @@ def _list_available_boxstyles(transmuters): - """ a helper function of the FancyBboxPatch to list the available + """ a helper function of the :class:`FancyBboxPatch` to list the available box styles. It inspects the arguments of the __init__ methods of each classes and report them """ @@ -1450,18 +1467,23 @@ Draw a fancy box around a rectangle with lower left at *xy*=(*x*, *y*) with specified width and height. - FancyBboxPatch class is similar to Rectangle class, but it draws a - fancy box around the rectangle. The transfomation of the rectangle - box to the fancy box is delgated to the BoxTransmuterBase and its - derived classes. The "boxstyle" argument determins what kind of - fancy box will be drawn. In other words, it selects the - BboxTransmuter class to use, and sets optional attributes. A - custom BboxTransmuter can be used with bbox_transmuter argument - (should be an instance, not a class). mutation_scale determines - the overall size of the mutation (by which I mean the - transformation of the rectangle to the fancy path) and the - mutation_aspect determines the aspect-ratio of the mutation. + :class:`FancyBboxPatch` class is similar to :class:`Rectangle` + class, but it draws a fancy box around the rectangle. The + transformation of the rectangle box to the fancy box is delegated + to the :class:`BoxTransmuterBase` and its derived classes. + *boxstyle* determines what kind of fancy box will be drawn. In + other words, it selects the :class:`BboxTransmuter` class to use, + and sets optional attributes. + + *bbox_transmuter* can specify a custom :class:`BboxTransmuter` + instance. + + *mutation_scale* determines the overall size of the mutation (by + which I mean the transformation of the rectangle to the fancy + path) + + *mutation_aspect* determines the aspect-ratio of the mutation. """ _fancy_bbox_transmuters = {"square":SquareBoxTransmuter, @@ -1482,7 +1504,7 @@ *xy*=lower left corner *width*, *height* - The *boxstyle* describes how the fancy box will be drawn. It + *boxstyle* describes how the fancy box will be drawn. It should be one of the available boxstyle names, with optional comma-separated attributes. These attributes are meant to be scaled with the *mutation_scale*. Following box styles are @@ -1490,16 +1512,16 @@ %(AvailableBoxstyles)s - The boxstyle name can be "custom", in which case the - bbox_transmuter needs to be set, which should be an instance - of BboxTransmuterBase (or its derived). + The *boxstyle* name can be "custom", in which case the + *bbox_transmuter* argument needs to be set, which should be an + instance of :class:`BboxTransmuterBase` (or its derived). *mutation_scale* : a value with which attributes of boxstyle - (e.g., pad) will be scaled. default=1. + (e.g., pad) will be scaled. default=1. *mutation_aspect* : The height of the rectangle will be - squeezed by this value before the mutation and the mutated - box will be stretched by the inverse of it. default=None. + squeezed by this value before the mutation and the mutated + box will be stretched by the inverse of it. default=None. Valid kwargs are: %(Patch)s @@ -1539,16 +1561,18 @@ Set the box style. *boxstyle* can be a string with boxstyle name with optional - comma-separated attributes. Alternatively, the attrs can - be probided as kewords. + comma-separated attributes. Alternatively, the attrs can + be provided as keywords:: set_boxstyle("round,pad=0.2") set_boxstyle("round", pad=0.2) - Olf attrs simply are forgotten. + Old attrs simply are forgotten. - Without argument (or with boxstyle=None), it prints out + Without argument (or with *boxstyle* = None), it prints out available box styles. + + ACCEPTS: [ %(AvailableBoxstyles)s ] """ if boxstyle==None: @@ -1573,8 +1597,13 @@ boxstyle_args.update(kw) self._bbox_transmuter = bbox_transmuter_cls(**boxstyle_args) + kwdoc = dict() + kwdoc["AvailableBoxstyles"]=" | ".join([l \ + for l in _list_available_boxstyles(_fancy_bbox_transmuters)]) + kwdoc.update(artist.kwdocd) + set_boxstyle.__doc__ = set_boxstyle.__doc__ % kwdoc + del kwdoc - def set_mutation_scale(self, scale): """ Set the mutation scale. Modified: trunk/matplotlib/lib/matplotlib/path.py =================================================================== --- trunk/matplotlib/lib/matplotlib/path.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/path.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -217,9 +217,10 @@ """ Return a transformed copy of the path. - See :class:`matplotlib.transforms.TransformedPath` for a path - that will cache the transformed result and automatically - update when the transform changes. + .. seealso:: + :class:`matplotlib.transforms.TransformedPath`: + A path class that will cache the transformed result + and automatically update when the transform changes. """ return Path(transform.transform(self.vertices), self.codes) Modified: trunk/matplotlib/lib/matplotlib/pyplot.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyplot.py 2008年10月16日 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/pyplot.py 2008年10月16日 17:32:39 UTC (rev 6223) @@ -416,16 +416,17 @@ can be a string or an integer specifying the legend location + A :class:`matplotlib.legend.Legend` instance is returned. + Example:: figlegend( (line1, line2, line3), ('label1', 'label2', 'label3'), 'upper right' ) - See :func:`~matplotlib.pyplot.legend` for information about the - location codes - - A :class:`matplotlib.legend.Legend` instance is returned. + .. seealso:: + :func:`~matplotlib.pyplot.legend`: + For information about the location codes """ l = gcf().legend(handles, labels, loc, **kwargs) draw_if_interactive() @@ -592,9 +593,6 @@ subplot(211, axisbg='y') - See :func:`~matplotlib.pyplot.axes` for additional information on - :func:`axes` and :func:`subplot` keyword arguments. - New subplots that overlap old will delete the old axes. If you do not want this behavior, use :meth:`matplotlib.figure.Figure.add_subplot` or the @@ -605,6 +603,10 @@ subplot(211) # overlaps, subplot(111) is killed plot(rand(12), rand(12)) + .. seealso:: + :func:`~matplotlib.pyplot.axes`: + For additional information on :func:`axes` and + :func:`subplot` keyword arguments. """ @@ -628,7 +630,8 @@ *None*) sharing the xaxis. The ticks for *ax2* will be placed on the right, and the *ax2* instance is returned. - See :file:`examples/pylab_examples/two_scales.py` + .. seealso:: + :file:`examples/pylab_examples/two_scales.py` """ if ax is None: ax=gca() @@ -721,8 +724,9 @@ 'verticalalignment': 'bottom', 'horizontalalignment': 'center'} - See the :func:`~matplotlib.pyplot.text` docstring for information - of how override and the optional args work. + .. seealso:: + :func:`~matplotlib.pyplot.text`: + for information on how override and the optional args work. """ l = gca().set_title(s, *args, **kwargs) draw_if_interactive() @@ -782,10 +786,12 @@ if ``len(*v)==0``, you can pass in *xmin*, *xmax*, *ymin*, *ymax* as kwargs selectively to alter just those limits without changing - the others. See :func:`xlim` and :func:`ylim` for more information + the others. The xmin, xmax, ymin, ymax tuple is returned + .. seealso:: + :func:`xlim`, :func:`ylim` """ ax = gca() v = ax.axis(*v, **kwargs) @@ -804,9 +810,9 @@ 'horizontalalignment' : 'center' } - See :func:`~matplotlib.pyplot.text` for information of how - override and the optional args work - + .. seealso:: + :func:`~matplotlib.pyplot.text`: + For information on how override and the optional args work """ l = gca().set_xlabel(s, *args, **kwargs) draw_if_interactive() @@ -824,9 +830,10 @@ 'horizontalalignment' : 'right', 'rotation'='vertical' : } - See :func:`~matplotlib.pyplot.text` for information on how - override and the optional args work. - + .. seealso:: + :func:`~matplotlib.pyplot.text`: + For information on how override and the optional args + work. """ l = gca().set_ylabel(s, *args, **kwargs) draw_if_interactive() @@ -2430,7 +2437,9 @@ def autumn(): ''' Set the default colormap to *autumn* and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='autumn') im = gci() @@ -2445,7 +2454,9 @@ def bone(): ''' Set the default colormap to bone and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='bone') im = gci() @@ -2460,7 +2471,9 @@ def cool(): ''' Set the default colormap to cool and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='cool') im = gci() @@ -2475,7 +2488,9 @@ def copper(): ''' Set the default colormap to copper and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='copper') im = gci() @@ -2490,7 +2505,9 @@ def flag(): ''' Set the default colormap to flag and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='flag') im = gci() @@ -2505,7 +2522,9 @@ def gray(): ''' Set the default colormap to gray and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='gray') im = gci() @@ -2520,7 +2539,9 @@ def hot(): ''' Set the default colormap to hot and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cm... [truncated message content]
Revision: 6222 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6222&view=rev Author: jdh2358 Date: 2008年10月16日 17:23:18 +0000 (2008年10月16日) Log Message: ----------- updated licensing template Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html trunk/matplotlib/doc/users/license.rst Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 17:08:13 UTC (rev 6221) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 17:23:18 UTC (rev 6222) @@ -6,11 +6,13 @@ href="{{ pathto('users/installing') }}">installing</a> page). <p> -There are also optional <a href="{{ pathto('users/toolkits') }}">toolkits</a> for matplotlib. +There are several matplotlib addon <a href="{{ +pathto('users/toolkits') }}">toolkits</a>, including the +projection and mapping toolkit <a href=http://matplotlib.sf.net/basemap/doc/html>basemap</a>. </p> <h3>Need help?</h3> -<p>Check the <a href="{{ pathto('users/index') }}"}>user</a> guide, the <a +<p>Check the <a href="{{ pathto('users/index') }}">user</a> guide, the <a href="{{ pathto('faq/index') }}">faq</a>, the <a href="{{ pathto('api/index') }}"}>api</a> docs, <a href=http://www.nabble.com/matplotlib---users-f2906.html>archives</a>, and join the matplotlib mailing <a href="http://sourceforge.net/mail/?group_id=80706">lists</a> Modified: trunk/matplotlib/doc/users/license.rst =================================================================== --- trunk/matplotlib/doc/users/license.rst 2008年10月16日 17:08:13 UTC (rev 6221) +++ trunk/matplotlib/doc/users/license.rst 2008年10月16日 17:23:18 UTC (rev 6222) @@ -14,8 +14,8 @@ behind the licencing choice, see :ref:`license-discussion`. -License agreement for matplotlib 0.98 -===================================== +License agreement for matplotlib |version| +============================================== 1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the Individual or Organization ("Licensee") accessing and otherwise using @@ -25,30 +25,30 @@ 2. Subject to the terms and conditions of this License Agreement, JDH hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare -derivative works, distribute, and otherwise use matplotlib 0.98 +derivative works, distribute, and otherwise use matplotlib |version| alone or in any derivative version, provided, however, that JDH's License Agreement and JDH's notice of copyright, i.e., "Copyright (c) 2002-2008 John D. Hunter; All Rights Reserved" are retained in -matplotlib 0.98 alone or in any derivative version prepared by +matplotlib |version| alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or -incorporates matplotlib 0.98 or any part thereof, and wants to +incorporates matplotlib |version| or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of -the changes made to matplotlib 0.98. +the changes made to matplotlib |version|. -4. JDH is making matplotlib 0.98 available to Licensee on an "AS +4. JDH is making matplotlib |version| available to Licensee on an "AS IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.98 +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB |version| WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB -0.98 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR +|version| FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING -MATPLOTLIB 0.98, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF +MATPLOTLIB |version|, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material @@ -60,7 +60,7 @@ trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. -8. By copying, installing or otherwise using matplotlib 0.98, +8. By copying, installing or otherwise using matplotlib |version|, Licensee agrees to be bound by the terms and conditions of this License Agreement. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6221 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6221&view=rev Author: jdh2358 Date: 2008年10月16日 17:08:13 +0000 (2008年10月16日) Log Message: ----------- more nav links Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html trunk/matplotlib/doc/contents.rst trunk/matplotlib/doc/users/pyplot_tutorial.rst trunk/matplotlib/doc/users/screenshots.rst trunk/matplotlib/doc/users/toolkits.rst Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 16:18:39 UTC (rev 6220) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 17:08:13 UTC (rev 6221) @@ -10,9 +10,10 @@ </p> <h3>Need help?</h3> -<p>Check the <a href="{{ pathto('contents') }}"}>docs</a>, the <a -href="{{ pathto('faq/index') }}">faq</a>, and join the matplotlib mailing <a -href="http://sourceforge.net/project/showfiles.php?group_id=80706">lists</a> +<p>Check the <a href="{{ pathto('users/index') }}"}>user</a> guide, the <a +href="{{ pathto('faq/index') }}">faq</a>, the <a href="{{ +pathto('api/index') }}"}>api</a> docs, <a href=http://www.nabble.com/matplotlib---users-f2906.html>archives</a>, and join the matplotlib mailing <a +href="http://sourceforge.net/mail/?group_id=80706">lists</a> <p>You can file bugs, patches and feature requests on the sourceforge <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>, but it is a good idea to ping us on the mailing list too.</p> Modified: trunk/matplotlib/doc/contents.rst =================================================================== --- trunk/matplotlib/doc/contents.rst 2008年10月16日 16:18:39 UTC (rev 6220) +++ trunk/matplotlib/doc/contents.rst 2008年10月16日 17:08:13 UTC (rev 6221) @@ -10,6 +10,7 @@ Download `PDF <http://matplotlib.sf.net/doc/Matplotlib.pdf>`_ + .. toctree:: :maxdepth: 2 Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst =================================================================== --- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008年10月16日 16:18:39 UTC (rev 6220) +++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008年10月16日 17:08:13 UTC (rev 6221) @@ -1,7 +1,7 @@ .. _pyplot-tutorial: *************** -pyplot tutorial +Pyplot tutorial *************** :mod:`matplotlib.pyplot` is a collection of command style functions Modified: trunk/matplotlib/doc/users/screenshots.rst =================================================================== --- trunk/matplotlib/doc/users/screenshots.rst 2008年10月16日 16:18:39 UTC (rev 6220) +++ trunk/matplotlib/doc/users/screenshots.rst 2008年10月16日 17:08:13 UTC (rev 6221) @@ -1,7 +1,7 @@ .. _matplotlibscreenshots: ********************** -matplotlib screenshots +Screenshots ********************** Here you will find a host of example figures with the code that Modified: trunk/matplotlib/doc/users/toolkits.rst =================================================================== --- trunk/matplotlib/doc/users/toolkits.rst 2008年10月16日 16:18:39 UTC (rev 6220) +++ trunk/matplotlib/doc/users/toolkits.rst 2008年10月16日 17:08:13 UTC (rev 6221) @@ -1,7 +1,7 @@ .. _toolkits: ******************* -matplotlib toolkits +Toolkits ******************* Toolkits are collections of application-specific functions that extend matplotlib. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6220 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6220&view=rev Author: jdh2358 Date: 2008年10月16日 16:18:39 +0000 (2008年10月16日) Log Message: ----------- added license and credits Modified Paths: -------------- trunk/matplotlib/doc/_templates/indexsidebar.html trunk/matplotlib/doc/devel/coding_guide.rst trunk/matplotlib/doc/users/index.rst Added Paths: ----------- trunk/matplotlib/doc/users/credits.rst trunk/matplotlib/doc/users/license.rst Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 14:15:50 UTC (rev 6219) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 16:18:39 UTC (rev 6220) @@ -23,6 +23,11 @@ <a href="{{ pathto('users/screenshots') }}">screenshots</a> and <a href=examples>examples</a> +<h3>Other stuff</h3> - +<p>The matplotlib <a href="{{ pathto('users/license') }}">license</a> is based on the Python Software Foundation +<a href=http://www.python.org/psf/license>(PSF)</a> license.</p> +<p>There is an active developer community and a long list of people +who have made significant <a href="{{ pathto('users/credits') }}">contributions</a>.</p> + Modified: trunk/matplotlib/doc/devel/coding_guide.rst =================================================================== --- trunk/matplotlib/doc/devel/coding_guide.rst 2008年10月16日 14:15:50 UTC (rev 6219) +++ trunk/matplotlib/doc/devel/coding_guide.rst 2008年10月16日 16:18:39 UTC (rev 6220) @@ -353,7 +353,7 @@ ``artist.kwdocd['Patch']`` setting in :mod:`matplotlib.patches`. -.. _licenses: +.. _license-discussion: Licenses ======== Added: trunk/matplotlib/doc/users/credits.rst =================================================================== --- trunk/matplotlib/doc/users/credits.rst (rev 0) +++ trunk/matplotlib/doc/users/credits.rst 2008年10月16日 16:18:39 UTC (rev 6220) @@ -0,0 +1,169 @@ +.. _credits: + +******* +Credits +******* + + +matplotlib was written by John Hunter and is now developed and +maintained by a number of +`active <http://www.ohloh.net/projects/matplotlib/contributors>`_ +developers. + +Special thanks to those who have made valuable contributions +(roughly in order of first contribution by date) + +Jeremy O'Donoghue + wrote the wx backend + +Andrew Straw + provided much of the log scaling architecture, the fill command, PIL + support for imshow, and provided many examples + +Charles Twardy + provided the impetus code for the legend class and has made + countless bug reports and suggestions for improvement. + +Gary Ruben + made many enhancements to errorbar to support x and y + errorbar plots, and added a number of new marker types to plot. + + +John Gill + wrote the table class and examples, helped with support for + auto-legend placement, and added support for legending scatter + plots. + +David Moore + wrote the paint backend (no longer used) + +Todd Miller + supported by `STSCI <http://www.stsci.edu>`_ contributed the TkAgg + backend and the numerix module, which allows matplotlib to work with + either numeric or numarray. He also ported image support to the + postscript backend, with much pain and suffering. + +Paul Barrett + supported by `STSCI <http://www.stsci.edu>`_ overhauled font + management to provide an improved, free-standing, platform + independent font manager with a WC3 compliant font finder and cache + mechanism and ported truetype and mathtext to PS. + +Perry Greenfield + supported by `STSCI <http://www.stsci.edu>`_ overhauled and + modernized the goals and priorities page, implemented an improved + colormap framework, and has provided many suggestions and a lot of + insight to the overall design and organization of matplotlib. + +Jared Wahlstrand + wrote the initial SVG backend. + +Steve Chaplin + served as the GTK maintainer and wrote the Cairo and + GTKCairo backends. + +Jim Benson + provided the patch to handle vertical mathttext. + +Gregory Lielens + provided the FltkAgg backend and several patches for the frontend, + including contributions to toolbar2, and support for log ticking + with alternate bases and major and minor log ticking. + +Darren Dale + + did the work to do mathtext exponential labeling for log plots, + added improved support for scalar formatting, and did the lions + share of the `psfrag + <" rel=nofollow>http://www.ctan.org/tex-archive/help/Catalogue/entries/psfrag.html?action=/tex-archive/macros/latex/contrib/supported/psfrag>`_ + LaTeX support for postscript. He has made substantial contributions + to extending and maintaining the PS and Qt backends, and wrote the + site.cfg and matplotlib.conf build and runtime configuration + support. He setup the infrastructure for the sphinx documentation + that powers the mpl docs. + +Paul Mcguire + provided the pyparsing module on which mathtext relies, and made a + number of optimizations to the matplotlib mathtext grammar. + + +Fernando Perez + has provided numerous bug reports and patches for cleaning up + backend imports and expanding pylab functionality, and provided + matplotlib support in the pylab mode for `ipython + <http://ipython.scipy.org>`_. He also provided the + :func:`~matplotlib.pyplot.matshow` command, and wrote TConfig, which + is the basis for the experimental traited mpl configuration. + +Andrew Dalke + of `Dalke Scientific Software <http://www.dalkescientific.com/>`_ contributed the + strftime formatting code to handle years earlier than 1900. + +Jochen Voss + served as PS backend maintainer and has contributed several + bugfixes. + +Nadia Dencheva + + supported by `STSCI <http://www.stsci.edu>`_ provided the contouring and + contour labeling code. + +Baptiste Carvello + provided the key ideas in a patch for proper + shared axes support that underlies ganged plots and multiscale + plots. + +Jeffrey Whitaker + at `NOAA <http://www.boulder.noaa.gov>`_ wrote the + :ref:`toolkit_basemap` tookit + +Sigve Tjoraand, Ted Drain + and colleagues at the `JPL <http://www.jpl.nasa.gov>`_ collaborated + on the QtAgg backend and sponsored development of a number of + features including custom unit types, datetime support, scale free + ellipses, broken bar plots and more. + +James Amundson + did the initial work porting the qt backend to qt4 + +Eric Firing + has contributed significantly to contouring, masked + array, pcolor, image and quiver support, in addition to ongoing + support and enhancements in performance, design and code quality in + most aspects of matplotlib. + +Daishi Harada + added support for "Dashed Text". See ` dashpointlabel.py + <examples/pylab_examples/dashpointlabel.py>`_ and + :class:`~matplotlib.text.TextWithDash`. + +Nicolas Young + added support for byte images to imshow, which are + more efficient in CPU and memory, and added support for irregularly + sampled images. + +The `brainvisa <http://brainvisa.info>`_ Orsay team and Fernando Perez + added Qt support to `ipython <http://ipython.scipy.org>`_ in pylab mode. + + +Charlie Moad + contributed work to matplotlib's Cocoa support and does the binary + builds and releases. + +Jouni K. Seppaenen + wrote the PDF backend. + +Paul Kienzle + improved the picking infrastruture for interactive plots, and with + Alex Mont contributed fast rendering code for quadrilateral meshes. + +Michael Droettboom + supported by `STSCI <http://www.stsci.edu>`_ wrote the enhanced + mathtext support, implementing Knuth's box layout algorithms, saving + to file-like objects across backends, and is responsible for + numerous bug-fixes, much better font and unicode support, and + feature and performance enhancements across the matplotlib code + base. He also rewrote the transformation infrastructure to support + custom projections and scales. + + Modified: trunk/matplotlib/doc/users/index.rst =================================================================== --- trunk/matplotlib/doc/users/index.rst 2008年10月16日 14:15:50 UTC (rev 6219) +++ trunk/matplotlib/doc/users/index.rst 2008年10月16日 16:18:39 UTC (rev 6220) @@ -23,6 +23,7 @@ event_handling.rst toolkits.rst screenshots.rst + license.rst + credits.rst - Added: trunk/matplotlib/doc/users/license.rst =================================================================== --- trunk/matplotlib/doc/users/license.rst (rev 0) +++ trunk/matplotlib/doc/users/license.rst 2008年10月16日 16:18:39 UTC (rev 6220) @@ -0,0 +1,70 @@ +.. _license: + +*********************************************** +License +*********************************************** + + +Matplotlib only uses BSD compatible code, and its license is based on +the `PSF <http://www.python.org/psf/license>`_ license. See the Open +Source Initiative `licenses page +<http://www.opensource.org/licenses>`_ for details on individual +licenses. Non-BSD compatible licenses (eg LGPL) are acceptable in +matplotlib :ref:`toolkits`. For a discussion of the motivations +behind the licencing choice, see :ref:`license-discussion`. + + +License agreement for matplotlib 0.98 +たす=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ +たす +たす1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the +Individual or Organization ("Licensee") accessing and otherwise using +matplotlib software in source or binary form and its associated +documentation. + +2. Subject to the terms and conditions of this License Agreement, JDH +hereby grants Licensee a nonexclusive, royalty-free, world-wide license +to reproduce, analyze, test, perform and/or display publicly, prepare +derivative works, distribute, and otherwise use matplotlib 0.98 +alone or in any derivative version, provided, however, that JDH's +License Agreement and JDH's notice of copyright, i.e., "Copyright (c) +2002-2008 John D. Hunter; All Rights Reserved" are retained in +matplotlib 0.98 alone or in any derivative version prepared by +Licensee. + +3. In the event Licensee prepares a derivative work that is based on or +incorporates matplotlib 0.98 or any part thereof, and wants to +make the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to matplotlib 0.98. + +4. JDH is making matplotlib 0.98 available to Licensee on an "AS +IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.98 +WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + +5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB +0.98 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR +LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING +MATPLOTLIB 0.98, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF +THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between JDH and +Licensee. This License Agreement does not grant permission to use JDH +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using matplotlib 0.98, +Licensee agrees to be bound by the terms and conditions of this License +Agreement. + + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6219 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6219&view=rev Author: jdh2358 Date: 2008年10月16日 14:15:50 +0000 (2008年10月16日) Log Message: ----------- small tweaks to logo -- make it clickable to take you home Modified Paths: -------------- trunk/matplotlib/doc/_static/logo2.png trunk/matplotlib/doc/_templates/indexsidebar.html trunk/matplotlib/doc/_templates/layout.html Modified: trunk/matplotlib/doc/_static/logo2.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/doc/_templates/indexsidebar.html =================================================================== --- trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 11:43:33 UTC (rev 6218) +++ trunk/matplotlib/doc/_templates/indexsidebar.html 2008年10月16日 14:15:50 UTC (rev 6219) @@ -19,7 +19,7 @@ <h3>Screenshots</h3> <a href="{{ pathto('users/screenshots') }}"><img align=center src="{{ -pathto('_static/logo_sidebar.png', 1) }}"></a> +pathto('_static/logo_sidebar.png', 1) }} "border="0"></a> <a href="{{ pathto('users/screenshots') }}">screenshots</a> and <a href=examples>examples</a> Modified: trunk/matplotlib/doc/_templates/layout.html =================================================================== --- trunk/matplotlib/doc/_templates/layout.html 2008年10月16日 11:43:33 UTC (rev 6218) +++ trunk/matplotlib/doc/_templates/layout.html 2008年10月16日 14:15:50 UTC (rev 6219) @@ -8,7 +8,8 @@ {% block relbar1 %} <div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px"> -<img src="{{ pathto("_static/logo2.png", 1) }}"> +<a href="{{ pathto('index') }}"><img src="{{ +pathto("_static/logo2.png", 1) }}" border="0"></a> </div> {{ super() }} {% endblock %} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6218 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6218&view=rev Author: jdh2358 Date: 2008年10月16日 11:43:33 +0000 (2008年10月16日) Log Message: ----------- added load and csv2rec followups to recarray demo Added Paths: ----------- trunk/py4science/examples/recarray_demo2.py trunk/py4science/examples/recarray_demo3.py Added: trunk/py4science/examples/recarray_demo2.py =================================================================== --- trunk/py4science/examples/recarray_demo2.py (rev 0) +++ trunk/py4science/examples/recarray_demo2.py 2008年10月16日 11:43:33 UTC (rev 6218) @@ -0,0 +1,51 @@ +""" +parse and load ge.csv into a record array +""" +import time, datetime, csv +import dateutil.parser +import matplotlib.mlab as mlab +import matplotlib.dates as mdates +import matplotlib.cbook as cbook +import numpy as np + +# this is how you can use the function np.loadtxt to do the same +# JDH TODO: this isn't working in mlab.load or np.loadtxt. Fix +#rows = np.loadtxt('data/ge.csv', skiprows=1, converters={0:mdates.date2num}, delimiter=',') +rows = mlab.load('data/ge.csv', skiprows=1, converters={0:mdates.date2num}, delimiter=',') +r = np.rec.fromrecords(rows, names='date,open,high,low,close,volume,adjclose') + +# compute the average approximate dollars traded over the last 10 days +# hint: closing price * volume trades approx equals dollars trades +recent = r[-10:] +dollars = (recent.close * recent.volume).mean() +print '$%1.2fM'%(dollars/1e6) + +# plot the adjusted closing price vs time since 2003 - hint, you must +# use date2num to convert the date to a float for mpl. Make two axes, +# one for price and one for volume. Use a bar chart for volume + +import matplotlib.pyplot as plt +dates = mdates.num2date(r.date) # convert these to native datetime.date objects +mask = dates > datetime.date(2003,1,1) +price = r.adjclose[mask] +volume = r.volume[mask] + +fig = plt.figure() +fig.subplots_adjust(hspace=0) +ax1 = fig.add_subplot(211) +ax1.plot(dates, price, '-'); + +ax1.grid() +for label in ax1.get_xticklabels(): + label.set_visible(False) + +ax2 = fig.add_subplot(212, sharex=ax1) +ax2.bar(dates, volume); + +ax2.grid() +for label in ax2.get_xticklabels(): + label.set_rotation(30) + label.set_horizontalalignment('right') + +fig.autofmt_xdate() +plt.show() Added: trunk/py4science/examples/recarray_demo3.py =================================================================== --- trunk/py4science/examples/recarray_demo3.py (rev 0) +++ trunk/py4science/examples/recarray_demo3.py 2008年10月16日 11:43:33 UTC (rev 6218) @@ -0,0 +1,47 @@ +""" +parse and load ge.csv into a record array +""" +import time, datetime, csv +import dateutil.parser +import matplotlib.mlab as mlab +import matplotlib.dates as mdates +import matplotlib.cbook as cbook +import numpy as np + +# this is how you can use the function mlab.csv2rec to do the same +r = mlab.csv2rec('data/ge.csv') +r.sort() #sort by date, the first column + +# compute the average approximate dollars traded over the last 10 days +# hint: closing price * volume trades approx equals dollars trades +recent = r[-10:] +dollars = (recent.close * recent.volume).mean() +print '$%1.2fM'%(dollars/1e6) + +# plot the adjusted closing price vs time since 2003 - hint, you must +# use date2num to convert the date to a float for mpl. Make two axes, +# one for price and one for volume. Use a bar chart for volume + +import matplotlib.pyplot as plt +# filter to get dates since 2003 +r = r[r.date > datetime.date(2003,1,1)] + +fig = plt.figure() +fig.subplots_adjust(hspace=0) +ax1 = fig.add_subplot(211) +ax1.plot(r.date, r.adj_close, '-'); + +ax1.grid() +for label in ax1.get_xticklabels(): + label.set_visible(False) + +ax2 = fig.add_subplot(212, sharex=ax1) +ax2.bar(r.date, r.volume); + +ax2.grid() +for label in ax2.get_xticklabels(): + label.set_rotation(30) + label.set_horizontalalignment('right') + +fig.autofmt_xdate() +plt.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6217 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6217&view=rev Author: mmetz_bn Date: 2008年10月16日 11:15:25 +0000 (2008年10月16日) Log Message: ----------- minor optimizations: replacing range by xrange in for loops Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008年10月15日 20:53:09 UTC (rev 6216) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008年10月16日 11:15:25 UTC (rev 6217) @@ -243,7 +243,7 @@ x, y, multicol = self._xy_from_y(y) if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): color = self._get_next_cycle_color() seg = mlines.Line2D(x, y[:,j], color = color, @@ -285,7 +285,7 @@ ret.append(seg) if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): makeline(x[:,j], y[:,j]) else: makeline(x, y) @@ -324,7 +324,7 @@ closed = kwargs.get('closed', True) func = makefill if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): func(x[:,j], y[:,j]) else: func(x, y) @@ -372,7 +372,7 @@ func = makefill if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): func(x[:,j], y[:,j]) else: func(x, y) @@ -3897,9 +3897,9 @@ pass elif align == 'center': if orientation == 'vertical': - left = [left[i] - width[i]/2. for i in range(len(left))] + left = [left[i] - width[i]/2. for i in xrange(len(left))] elif orientation == 'horizontal': - bottom = [bottom[i] - height[i]/2. for i in range(len(bottom))] + bottom = [bottom[i] - height[i]/2. for i in xrange(len(bottom))] else: raise ValueError, 'invalid alignment: %s' % align @@ -4571,7 +4571,7 @@ elif nc == 1: x = [x.ravel()] else: - x = [x[:,i] for i in range(nc)] + x = [x[:,i] for i in xrange(nc)] else: raise ValueError, "input x can have no more than 2 dimensions" if not hasattr(x[0], '__len__'): @@ -4665,7 +4665,7 @@ else: def doplot(*args): shuffled = [] - for i in range(0, len(args), 3): + for i in xrange(0, len(args), 3): shuffled.extend([args[i+1], args[i], args[i+2]]) return self.plot(*shuffled) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.