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
(6) |
2
(17) |
3
(11) |
4
(12) |
5
(16) |
6
(6) |
7
(5) |
8
(8) |
9
(24) |
10
(15) |
11
(12) |
12
(22) |
13
(30) |
14
(16) |
15
(6) |
16
(15) |
17
(20) |
18
(4) |
19
(11) |
20
(16) |
21
(2) |
22
(17) |
23
(16) |
24
(18) |
25
(4) |
26
(9) |
27
(12) |
28
(2) |
29
|
30
(4) |
|
|
|
|
|
Revision: 5566 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5566&view=rev Author: jswhit Date: 2008年06月16日 14:11:57 -0700 (2008年6月16日) Log Message: ----------- add tabularcolumns sphinx directive so tables look nice in pdf. Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008年06月16日 21:11:11 UTC (rev 5565) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008年06月16日 21:11:57 UTC (rev 5566) @@ -129,6 +129,8 @@ For most map projections, the map projection region can either be specified by setting these keywords: + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -144,6 +146,8 @@ or these + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -175,6 +179,8 @@ Other keyword arguments: + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -241,6 +247,8 @@ The module variable ``projection_params`` is a dictionary which lists which parameters apply to which projections. + .. tabularcolumns:: |l|L| + ================ ==================================================== Keyword Description ================ ==================================================== @@ -284,6 +292,8 @@ Useful instance variables: + .. tabularcolumns:: |l|L| + ================ ==================================================== Variable Name Description ================ ==================================================== @@ -1125,6 +1135,8 @@ draw boundary around map projection region, optionally filling interior of region. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -1238,6 +1250,8 @@ """ Fill continents. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -1307,6 +1321,8 @@ """ Draw coastlines. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -1347,6 +1363,8 @@ """ Draw country boundaries. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -1392,6 +1410,8 @@ """ Draw state boundaries in Americas. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -1437,6 +1457,8 @@ """ Draw major rivers. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -1490,6 +1512,8 @@ Mandatory Arguments: + .. tabularcolumns:: |l|L| + ============== ==================================================== Argument Description ============== ==================================================== @@ -1516,6 +1540,8 @@ and Polygon shape types, for Point and MultiPoint shapes they are ignored. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -1625,13 +1651,14 @@ dashes=[1,1],labels=[0,0,0,0],labelstyle=None, \ fmt='%g',xoffset=None,yoffset=None,ax=None,**kwargs): """ - Draw and label parallels (latitude lines). + Draw and label parallels (latitude lines) for values (in degrees) + given in the sequence ``circles``. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== - circles sequence containing latitude values to draw (in - degrees). color color to draw parallels (default black). linewidth line width for parallels (default 1.) zorder sets the zorder for parallels (if not specified, @@ -1880,13 +1907,14 @@ dashes=[1,1],labels=[0,0,0,0],labelstyle=None,\ fmt='%g',xoffset=None,yoffset=None,ax=None,**kwargs): """ - Draw and label meridians (longitude lines). + Draw and label meridians (longitude lines) for values (in degrees) + given in the sequence ``meridians``. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== - meridians sequence containing longitude values to draw (in - degrees). color color to draw meridians (default black). linewidth line width for meridians (default 1.) zorder sets the zorder for meridians (if not specified, @@ -2138,6 +2166,8 @@ """ Draw a great circle on the map. + .. tabularcolumns:: |l|L| + ============== ======================================================= Keyword Description ============== ======================================================= @@ -2177,6 +2207,8 @@ map projection coordinates for plotting on a map with the :meth:`imshow`. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -2237,6 +2269,8 @@ vector field is rotated to map projection coordinates (relative to x and y). The magnitude of the vector is preserved. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -2298,6 +2332,8 @@ vector field is rotated to map projection coordinates (relative to x and y). The magnitude of the vector is preserved. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keyword Description ============== ==================================================== @@ -2801,6 +2837,8 @@ of other images, due to limitations in matplotlib image handling (you can't specify the zorder of an image). + .. tabularcolumns:: |l|L| + ============== ==================================================== Arguments Description ============== ==================================================== @@ -2815,6 +2853,8 @@ rgba_ocean = (0,0,255,0). ============== ==================================================== + .. tabularcolumns:: |l|L| + ============== ==================================================== Keywords Description ============== ==================================================== @@ -3028,6 +3068,8 @@ representing distance in the map projection coordinates at ``lon0,lat0``. + .. tabularcolumns:: |l|L| + ============== ==================================================== Keywords Description ============== ==================================================== @@ -3233,6 +3275,8 @@ Interpolate data (``datain``) on a rectilinear grid (with x = ``xin`` y = ``yin``) to a grid with x = ``xout``, y= ``yout``. + .. tabularcolumns:: |l|L| + ============== ==================================================== Arguments Description ============== ==================================================== @@ -3244,6 +3288,8 @@ grid. ============== ==================================================== + .. tabularcolumns:: |l|L| + ============== ==================================================== Keywords Description ============== ==================================================== @@ -3361,6 +3407,8 @@ Shift global lat/lon grid east or west. assumes wraparound (or cyclic point) is included. + .. tabularcolumns:: |l|L| + ============== ==================================================== Arguments Description ============== ==================================================== @@ -3371,6 +3419,8 @@ lonsin original longitudes. ============== ==================================================== + .. tabularcolumns:: |l|L| + ============== ==================================================== Keywords Description ============== ==================================================== @@ -3468,12 +3518,16 @@ but the reference time and calendar can be changed via the ``units`` and ``calendar`` keywords. + .. tabularcolumns:: |l|L| + ============== ==================================================== Arguments Description ============== ==================================================== times numeric time values. Maximum resolution is 1 second. ============== ==================================================== + .. tabularcolumns:: |l|L| + ============== ==================================================== Keywords Description ============== ==================================================== @@ -3521,6 +3575,8 @@ but the reference time and calendar can be changed via the ``units`` and ``calendar`` keywords. + .. tabularcolumns:: |l|L| + ============== ==================================================== Arguments Description ============== ==================================================== @@ -3529,6 +3585,8 @@ time-zone offset. ============== ==================================================== + .. tabularcolumns:: |l|L| + ============== ==================================================== Keywords Description ============== ==================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5565 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5565&view=rev Author: jswhit Date: 2008年06月16日 14:11:11 -0700 (2008年6月16日) Log Message: ----------- delete extra line Modified Paths: -------------- trunk/toolkits/basemap/doc/index.rst Modified: trunk/toolkits/basemap/doc/index.rst =================================================================== --- trunk/toolkits/basemap/doc/index.rst 2008年06月16日 17:38:08 UTC (rev 5564) +++ trunk/toolkits/basemap/doc/index.rst 2008年06月16日 21:11:11 UTC (rev 5565) @@ -1,10 +1,6 @@ -.. basemap documentation master file - Welcome to the Matplotlib Basemap Toolkit documentation! ======================================================== -Contents: - .. toctree:: :maxdepth: 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5564 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5564&view=rev Author: mdboom Date: 2008年06月16日 10:38:08 -0700 (2008年6月16日) Log Message: ----------- Support using STIX fonts in math expressions. Use this functionality to generate a png that used to be static. Modified Paths: -------------- trunk/matplotlib/doc/sphinxext/mathpng.py trunk/matplotlib/doc/users/mathtext.rst Removed Paths: ------------- trunk/matplotlib/doc/_static/stix_fonts.png Deleted: trunk/matplotlib/doc/_static/stix_fonts.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/doc/sphinxext/mathpng.py =================================================================== --- trunk/matplotlib/doc/sphinxext/mathpng.py 2008年06月16日 17:21:39 UTC (rev 5563) +++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008年06月16日 17:38:08 UTC (rev 5564) @@ -5,6 +5,7 @@ from md5 import md5 from docutils import nodes +from docutils.parsers.rst import directives from docutils.writers.html4css1 import HTMLTranslator from sphinx.latexwriter import LaTeXTranslator @@ -12,14 +13,27 @@ class latex_math(nodes.General, nodes.Element): pass +def fontset_choice(arg): + return directives.choice(arg, ['cm', 'stix', 'stixsans']) + +options_spec = {'fontset': fontset_choice} + def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]): i = rawtext.find('`') latex = rawtext[i+1:-1] node = latex_math(rawtext) node['latex'] = latex + node['fontset'] = options.get('fontset', 'cm') return [node], [] +math_role.options = options_spec +def math_directive_run(content, block_text, options): + latex = ''.join(content) + node = latex_math(block_text) + node['latex'] = latex + node['fontset'] = options.get('fontset', 'cm') + return [node] try: from docutils.parsers.rst import Directive @@ -28,22 +42,19 @@ from docutils.parsers.rst.directives import _directives def math_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): - latex = ''.join(content) - node = latex_math(block_text) - node['latex'] = latex - return [node] + return math_directive_run(content, block_text, options) math_directive.arguments = None - math_directive.options = {} + math_directive.options = options_spec math_directive.content = 1 _directives['math'] = math_directive else: class math_directive(Directive): has_content = True + option_spec = options_spec + def run(self): - latex = ' '.join(self.content) - node = latex_math(self.block_text) - node['latex'] = latex - return [node] + return math_directive_run(self.content, self.block_text, + self.options) from docutils.parsers.rst import directives directives.register_directive('math', math_directive) @@ -100,12 +111,14 @@ # This uses mathtext to render the expression -def latex2png(latex, filename): +def latex2png(latex, filename, fontset='cm'): if os.path.exists(filename): return + orig_fontset = rcParams['mathtext.fontset'] + rcParams['mathtext.fontset'] = fontset mathtext_parser.to_png(filename, "$%s$" % latex, dpi=120) + rcParams['mathtext.fontset'] = orig_fontset - # LaTeX to HTML translation stuff: def latex2html(node, source): inline = isinstance(node.parent, nodes.TextElement) @@ -114,7 +127,7 @@ name = 'math-%s' % md5(latex).hexdigest()[-10:] dest = '_static/%s.png' % name if not isfile(dest): - latex2png(latex, dest) + latex2png(latex, dest, node['fontset']) path = '_static' count = source.split('/doc/')[-1].count('/') Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008年06月16日 17:21:39 UTC (rev 5563) +++ trunk/matplotlib/doc/users/mathtext.rst 2008年06月16日 17:38:08 UTC (rev 5564) @@ -147,22 +147,39 @@ The choices available with all fonts are: - =============== ================================= - Command Result - =============== ================================= - ``\mathrm`` :math:`\mathrm{Roman}` - ``\mathit`` :math:`\mathit{Italic}` - ``\mathtt`` :math:`\mathtt{Typewriter}` - ``\mathcal`` :math:`\mathcal{CALLIGRAPHY}` - =============== ================================= + ============================ ================================== + Command Result + ============================ ================================== + ``\mathrm{Roman}`` :math:`\mathrm{Roman}` + ``\mathit{Italic}`` :math:`\mathit{Italic}` + ``\mathtt{Typewriter}`` :math:`\mathtt{Typewriter}` + ``\mathcal{CALLIGRAPHY}`` :math:`\mathcal{CALLIGRAPHY}` + ============================ ================================== +.. role:: math-stix(math) + :fontset: stix + When using the STIX fonts, you also have the choice of: -.. image:: ../_static/stix_fonts.png + ====================================== ========================================= + Command Result + ====================================== ========================================= + ``\mathbb{blackboard}`` :math-stix:`\mathbb{blackboard}` + ``\mathrm{\mathbb{blackboard}}`` :math-stix:`\mathrm{\mathbb{blackboard}}` + ``\mathfrak{Fraktur}`` :math-stix:`\mathfrak{Fraktur}` + ``\mathsf{sansserif}`` :math-stix:`\mathsf{sansserif}` + ``\mathrm{\mathsf{sansserif}}`` :math-stix:`\mathrm{\mathsf{sansserif}}` + ====================================== ========================================= +.. htmlonly:: + + ====================================== ========================================= + ``\mathcircled{circled}`` :math-stix:`\mathcircled{circled}` + ====================================== ========================================= + There are also three global "font sets" to choose from, which are selected using the ``mathtext.fontset`` parameter in -::ref:`matplotlibrc <matplotlibrc-sample>`. +:ref:`matplotlibrc <matplotlibrc-sample>`. ``cm``: **Computer Modern (TeX)** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5563 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5563&view=rev Author: jswhit Date: 2008年06月16日 10:21:39 -0700 (2008年6月16日) Log Message: ----------- no basemap.py anymore, include docs. Modified Paths: -------------- trunk/toolkits/basemap/MANIFEST.in Modified: trunk/toolkits/basemap/MANIFEST.in =================================================================== --- trunk/toolkits/basemap/MANIFEST.in 2008年06月16日 16:42:49 UTC (rev 5562) +++ trunk/toolkits/basemap/MANIFEST.in 2008年06月16日 17:21:39 UTC (rev 5563) @@ -71,7 +71,6 @@ include examples/README include lib/mpl_toolkits/__init__.py include lib/mpl_toolkits/basemap/__init__.py -include lib/mpl_toolkits/basemap/basemap.py include lib/mpl_toolkits/basemap/proj.py include lib/mpl_toolkits/basemap/pyproj.py include lib/mpl_toolkits/basemap/cm.py @@ -82,6 +81,14 @@ include pyshapelib/*.shp pyshapelib/*.shx pyshapelib/*.dbf include pyshapelib/shapelib/*.c pyshapelib/shapelib/*.h include MANIFEST.in +include doc/users/figures/*py +include doc/users/figures/*png +include doc/users/*rst +include doc/api/*rst +include doc/README.txt +include doc/make.py +include doc/conf.py +include doc/index.rst recursive-include geos-2.2.3 * recursive-include lib/dap * recursive-include lib/httplib2 * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5562 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5562&view=rev Author: jswhit Date: 2008年06月16日 09:42:49 -0700 (2008年6月16日) Log Message: ----------- make figures. Modified Paths: -------------- trunk/toolkits/basemap/doc/make.py Modified: trunk/toolkits/basemap/doc/make.py =================================================================== --- trunk/toolkits/basemap/doc/make.py 2008年06月16日 16:40:09 UTC (rev 5561) +++ trunk/toolkits/basemap/doc/make.py 2008年06月16日 16:42:49 UTC (rev 5562) @@ -15,8 +15,7 @@ pass def figs(): - #os.system('cd users/figures/ && python make.py') - os.system('cd users/figures') + os.system('cd users/figures/ && python make.py') def html(): check_build() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5561 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5561&view=rev Author: jswhit Date: 2008年06月16日 09:40:09 -0700 (2008年6月16日) Log Message: ----------- new file Added Paths: ----------- trunk/toolkits/basemap/doc/users/figures/make.py Added: trunk/toolkits/basemap/doc/users/figures/make.py =================================================================== --- trunk/toolkits/basemap/doc/users/figures/make.py (rev 0) +++ trunk/toolkits/basemap/doc/users/figures/make.py 2008年06月16日 16:40:09 UTC (rev 5561) @@ -0,0 +1,69 @@ +#!/usr/bin/env python +import sys, os, glob +import matplotlib +import IPython.Shell +#matplotlib.rcdefaults() +matplotlib.use('Agg') + +mplshell = IPython.Shell.MatplotlibShell('mpl') + +formats = [('png', 100), + ('hires.png', 200), + ('pdf', 72)] + +def figs(): + print 'making figs' + import matplotlib.pyplot as plt + for fname in glob.glob('*.py'): + if fname.split('/')[-1] == __file__.split('/')[-1]: continue + basename, ext = os.path.splitext(fname) + imagefiles = dict([('%s.%s'%(basename, format), dpi) + for format, dpi in formats]) + all_exists = True + for imagefile in imagefiles: + if not os.path.exists(imagefile): + all_exists = False + break + + if all_exists: + print ' already have %s'%fname + else: + print ' building %s'%fname + plt.close('all') # we need to clear between runs + mplshell.magic_run(basename) + for imagefile, dpi in imagefiles.iteritems(): + plt.savefig(imagefile, dpi=dpi) + print 'all figures made' + + +def clean(): + patterns = (['#*', '*~', '*pyc'] + + ['*.%s' % format for format, dpi in formats]) + for pattern in patterns: + for fname in glob.glob(pattern): + os.remove(fname) + print 'all clean' + + + +def all(): + figs() + +funcd = {'figs':figs, + 'clean':clean, + 'all':all, + } + +if len(sys.argv)>1: + for arg in sys.argv[1:]: + func = funcd.get(arg) + if func is None: + raise SystemExit('Do not know how to handle %s; valid args are'%( + arg, funcd.keys())) + func() +else: + all() + + + + Property changes on: trunk/toolkits/basemap/doc/users/figures/make.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5560 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5560&view=rev Author: jswhit Date: 2008年06月16日 08:13:58 -0700 (2008年6月16日) Log Message: ----------- fixed gnomonic coastlines. Modified Paths: -------------- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2008年06月16日 14:41:48 UTC (rev 5559) +++ trunk/toolkits/basemap/Changelog 2008年06月16日 15:13:58 UTC (rev 5560) @@ -1,3 +1,4 @@ + * fixed processing of coastlines for gnomonic projection. * don't try to use PyNIO in NetCDFFile (it was causing too many suprises). * improved documentation using Sphinx/docutils. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5559 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5559&view=rev Author: jswhit Date: 2008年06月16日 07:41:48 -0700 (2008年6月16日) Log Message: ----------- add gnomonic projection example Modified Paths: -------------- trunk/toolkits/basemap/doc/users/mapsetup.rst Added Paths: ----------- trunk/toolkits/basemap/doc/users/figures/gnomon.png trunk/toolkits/basemap/doc/users/figures/gnomon.py trunk/toolkits/basemap/doc/users/gnomon.rst Added: trunk/toolkits/basemap/doc/users/figures/gnomon.png =================================================================== (Binary files differ) Property changes on: trunk/toolkits/basemap/doc/users/figures/gnomon.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/toolkits/basemap/doc/users/figures/gnomon.py =================================================================== --- trunk/toolkits/basemap/doc/users/figures/gnomon.py (rev 0) +++ trunk/toolkits/basemap/doc/users/figures/gnomon.py 2008年06月16日 14:41:48 UTC (rev 5559) @@ -0,0 +1,12 @@ +from mpl_toolkits.basemap import Basemap +import numpy as np +import matplotlib.pyplot as plt +m = Basemap(width=15.e6,height=15.e6,\ + projection='gnom',lat_0=60.,lon_0=-30.) +m.drawmapboundary(fill_color='aqua') +m.drawcoastlines() +m.fillcontinents(color='coral',lake_color='aqua') +m.drawparallels(np.arange(10,90,20)) +m.drawmeridians(np.arange(-180,180,30)) +plt.title('Gnomonic Projection') +plt.savefig('gnomon.png') Added: trunk/toolkits/basemap/doc/users/gnomon.rst =================================================================== --- trunk/toolkits/basemap/doc/users/gnomon.rst (rev 0) +++ trunk/toolkits/basemap/doc/users/gnomon.rst 2008年06月16日 14:41:48 UTC (rev 5559) @@ -0,0 +1,10 @@ +.. _gnomon: + +Gnomonic Projection +=================== + +In the gnomonic projection, great circles are straight lines. + +.. literalinclude:: figures/gnomon.py + +.. image:: figures/gnomon.png Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst =================================================================== --- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008年06月16日 13:51:31 UTC (rev 5558) +++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008年06月16日 14:41:48 UTC (rev 5559) @@ -29,4 +29,5 @@ .. toctree:: azeqd.rst + gnomon.rst ortho.rst This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5558 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5558&view=rev Author: jswhit Date: 2008年06月16日 06:51:31 -0700 (2008年6月16日) Log Message: ----------- update comment on ortho/gnom boundary treatment Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008年06月16日 13:41:14 UTC (rev 5557) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008年06月16日 13:51:31 UTC (rev 5558) @@ -831,7 +831,9 @@ raise ValueError('%s projection cannot cross pole'%(self.projection)) # make sure orthographic or gnomonic projection has containsPole=True # we will compute the intersections in stereographic - # coordinates, then transform to orthographic. + # coordinates, then transform to orthographic. This is + # because these projections are only defined on a hemisphere, and + # some boundary features (like Eurasia) would be undefined otherwise. if self.projection in ['ortho','gnom'] and name == 'gshhs': containsPole = True lon_0=self.projparams['lon_0'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5557 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5557&view=rev Author: mdboom Date: 2008年06月16日 06:41:14 -0700 (2008年6月16日) Log Message: ----------- Minor mathtext improvements Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008年06月16日 13:04:07 UTC (rev 5556) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008年06月16日 13:41:14 UTC (rev 5557) @@ -725,15 +725,8 @@ cached_font.charmap[num]) if symbol_name is None: - return self._stix_fallback._get_glyph(fontname, font_class, sym, fontsize) - warn("Unrecognized symbol '%s'. Substituting with a dummy symbol." - % sym.encode('ascii', 'backslashreplace'), MathTextWarning) - fontname = 'it' - cached_font = self._get_font(fontname) - num = 0x3F # currency character, for lack of anything better - gid = cached_font.charmap[num] - symbol_name = cached_font.font.get_glyph_name(gid) - slanted = False + return self._stix_fallback._get_glyph( + fontname, font_class, sym, fontsize) return cached_font, num, symbol_name, fontsize, slanted @@ -865,10 +858,7 @@ glyphindex = cached_font.charmap[uniindex] found_symbol = True except KeyError: - warn("Font '%s' does not have a glyph for '%s'" % - (cached_font.font.postscript_name, - sym.encode('ascii', 'backslashreplace')), - MathTextWarning) + pass if not found_symbol: if self.cm_fallback: @@ -879,6 +869,10 @@ else: if fontname == 'it' and isinstance(self, StixFonts): return self._get_glyph('rm', font_class, sym, fontsize) + warn("Font '%s' does not have a glyph for '%s'" % + (cached_font.font.postscript_name, + sym.encode('ascii', 'backslashreplace')), + MathTextWarning) warn("Substituting with a dummy symbol.", MathTextWarning) fontname = 'rm' new_fontname = fontname This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5556 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5556&view=rev Author: mdboom Date: 2008年06月16日 06:04:07 -0700 (2008年6月16日) Log Message: ----------- Fix title placement in polar plots. Remove broken auto layout code. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/rcsetup.py trunk/matplotlib/lib/matplotlib/figure.py trunk/matplotlib/lib/matplotlib/projections/geo.py trunk/matplotlib/lib/matplotlib/projections/polar.py trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/matplotlibrc.template Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008年06月16日 13:04:07 UTC (rev 5556) @@ -1403,32 +1403,6 @@ YL = self.yaxis.get_major_locator().autoscale() self.set_ybound(YL) - def update_layout(self, renderer): - pad_pixels = rcParams['xtick.major.pad'] * self.figure.dpi / 72.0 - inverse_transFigure = self.figure.transFigure.inverted() - t_text, b_text = self.xaxis.get_text_heights(renderer) - l_text, r_text = self.yaxis.get_text_widths(renderer) - title_height = self.title.get_window_extent(renderer).height - title_height += pad_pixels * 2.0 - original_t_text = t_text - - ((l_text, t_text), - (r_text, b_text), - (dummy, title_height)) = inverse_transFigure.transform( - ((l_text, t_text), - (r_text, b_text), - (0.0, title_height))) - x0, y0, x1, y1 = self.get_position(True).extents - # Adjust the title - self.titleOffsetTrans.clear().translate( - 0, original_t_text + pad_pixels * 2.0) - - new_position = mtransforms.Bbox.from_extents( - x0 + l_text, y0 + b_text, - x1 - r_text, y1 - t_text - title_height) - - self.set_position(new_position, 'active') - #### Drawing def draw(self, renderer=None, inframe=False): @@ -5654,7 +5628,7 @@ ax2.xaxis.set_label_position('top') self.xaxis.tick_bottom() return ax2 - + def get_shared_x_axes(self): 'Return a copy of the shared axes Grouper object for x axes' return self._shared_x_axes Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008年06月16日 13:04:07 UTC (rev 5556) @@ -238,7 +238,6 @@ dpi = T.Float(80) facecolor = T.Trait('0.75', mplT.ColorHandler()) edgecolor = T.Trait('white', mplT.ColorHandler()) - autolayout = T.false class subplot(TConfig): """The figure subplot parameters. All dimensions are fraction @@ -408,7 +407,6 @@ 'figure.dpi' : (self.tconfig.figure, 'dpi'), 'figure.facecolor' : (self.tconfig.figure, 'facecolor'), 'figure.edgecolor' : (self.tconfig.figure, 'edgecolor'), - 'figure.autolayout' : (self.tconfig.figure, 'autolayout'), 'figure.subplot.left' : (self.tconfig.figure.subplot, 'left'), 'figure.subplot.right' : (self.tconfig.figure.subplot, 'right'), Modified: trunk/matplotlib/lib/matplotlib/config/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2008年06月16日 13:04:07 UTC (rev 5556) @@ -439,7 +439,6 @@ 'figure.dpi' : [80, validate_float], # DPI 'figure.facecolor' : ['0.75', validate_color], # facecolor; scalar gray 'figure.edgecolor' : ['w', validate_color], # edgecolor; white - 'figure.autolayout' : [False, validate_bool], 'figure.subplot.left' : [0.125, ValidateInterval(0, 1, closedmin=False, closedmax=False)], 'figure.subplot.right' : [0.9, ValidateInterval(0, 1, closedmin=False, closedmax=False)], Modified: trunk/matplotlib/lib/matplotlib/figure.py =================================================================== --- trunk/matplotlib/lib/matplotlib/figure.py 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/lib/matplotlib/figure.py 2008年06月16日 13:04:07 UTC (rev 5556) @@ -240,7 +240,6 @@ self.clf() self._cachedRenderer = None - self._autoLayout = rcParams['figure.autolayout'] def _get_dpi(self): return self._dpi @@ -250,9 +249,6 @@ self.callbacks.process('dpi_changed', self) dpi = property(_get_dpi, _set_dpi) - def enable_auto_layout(self, setting=True): - self._autoLayout = setting - def autofmt_xdate(self, bottom=0.2, rotation=30, ha='right'): """ Date ticklabels often overlap, so it is useful to rotate them @@ -284,7 +280,7 @@ label.set_visible(False) ax.set_xlabel('') - if allsubplots and not self._autoLayout: + if allsubplots: self.subplots_adjust(bottom=bottom) def get_children(self): @@ -765,62 +761,6 @@ renderer.draw_image(l, b, im, self.bbox, *self.get_transformed_clip_path_and_affine()) - # update the positions of the axes - # This gives each of the axes the opportunity to resize itself - # based on the tick and axis labels etc., and then makes sure - # that any axes that began life aligned to another axes remains - # aligned after these adjustments - if self._autoLayout and len(self.axes) > 1: - aligned_positions = [{}, {}, {}, {}] - sizes = [{}, {}] - for a in self.axes: - a.update_layout(renderer) - orig_pos = a.get_position(True) - curr_pos = a.get_position() - for pos, orig, curr in zip(aligned_positions, - orig_pos.get_points().flatten(), - curr_pos.get_points().flatten()): - if orig in pos: - pos[orig][0].append(a) - pos[orig][1].add(curr) - else: - pos[orig] = [[a], set([curr])] - for size, orig, curr in zip(sizes, - orig_pos.size, - curr_pos.size): - orig = round(orig * 1000.0) / 1000.0 - if orig in size: - size[orig][0].append(a) - size[orig][1].add(curr) - else: - size[orig] = [[a], set([curr])] - - for i, pos in enumerate(aligned_positions): - for axes, places in pos.values(): - if len(places) > 1: - if i < 2: - curr = max(places) - else: - curr = min(places) - for a in axes: - curr_pos = a.get_position().frozen() - curr_pos.get_points()[i/2, i%2] = curr - a.set_position(curr_pos, 'active') - - for i, size in enumerate(sizes): - for axes, dims in size.values(): - new = min(dims) - for a in axes: - curr_pos = a.get_position().frozen() - curr = curr_pos.size[i] - if curr > new: - extra = (curr - new) * 0.5 - curr_pos.get_points()[0, i] += extra - curr_pos.get_points()[1, i] -= extra - a.set_position(curr_pos, 'active') - elif self._autoLayout: - for a in self.axes: a.update_layout(renderer) - # render the axes for a in self.axes: a.draw(renderer) Modified: trunk/matplotlib/lib/matplotlib/projections/geo.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/geo.py 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/lib/matplotlib/projections/geo.py 2008年06月16日 13:04:07 UTC (rev 5556) @@ -109,14 +109,6 @@ .scale(0.5 / xscale, 0.5 / yscale) \ .translate(0.5, 0.5) - def update_layout(self, renderer): - t_text, b_text = self.xaxis.get_text_heights(renderer) - l_text, r_text = self.yaxis.get_text_widths(renderer) - originalPosition = self.get_position(True) - title_offset = (b_text - originalPosition.transformed( - self.figure.transFigure).height) / 2.0 - self.titleOffsetTrans.clear().translate(0, title_offset) - def get_xaxis_transform(self): return self._xaxis_transform Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/polar.py 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2008年06月16日 13:04:07 UTC (rev 5556) @@ -176,6 +176,8 @@ def cla(self): Axes.cla(self) + self.title.set_y(1.05) + self.xaxis.set_major_formatter(self.ThetaFormatter()) angles = npy.arange(0.0, 360.0, 45.0) self.set_thetagrids(angles) @@ -241,14 +243,6 @@ self._yaxis_transform ) - def update_layout(self, renderer): - t_text, b_text = self.xaxis.get_text_heights(renderer) - l_text, r_text = self.yaxis.get_text_widths(renderer) - originalPosition = self.get_position(True) - title_offset = (b_text - originalPosition.transformed( - self.figure.transFigure).height) / 2.0 - self.titleOffsetTrans.clear().translate(0, title_offset) - def get_xaxis_transform(self): return self._xaxis_transform Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008年06月16日 13:04:07 UTC (rev 5556) @@ -457,8 +457,6 @@ 'figure.subplot.wspace' : [0.2, ValidateInterval(0, 1, closedmin=True, closedmax=False)], 'figure.subplot.hspace' : [0.2, ValidateInterval(0, 1, closedmin=True, closedmax=False)], - 'figure.autolayout' : [False, validate_bool], - 'savefig.dpi' : [100, validate_float], # DPI 'savefig.facecolor' : ['w', validate_color], # facecolor; white 'savefig.edgecolor' : ['w', validate_color], # edgecolor; white Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2008年06月16日 12:51:33 UTC (rev 5555) +++ trunk/matplotlib/matplotlibrc.template 2008年06月16日 13:04:07 UTC (rev 5556) @@ -249,8 +249,6 @@ #figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots #figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots -#figure.autolayout : False # when True, adjust the axes so that text doesn't overlap - ### IMAGES #image.aspect : equal # equal | auto | a number #image.interpolation : bilinear # see help(imshow) for options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5555 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5555&view=rev Author: jswhit Date: 2008年06月16日 05:51:33 -0700 (2008年6月16日) Log Message: ----------- treat gnomonic like orthographic when deciding if boundary polygons are intersect map region. Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008年06月16日 12:14:22 UTC (rev 5554) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008年06月16日 12:51:33 UTC (rev 5555) @@ -531,6 +531,8 @@ if width is not None or height is not None: print 'warning: width and height keywords ignored for %s projection' % self.projection elif projection in ['tmerc','gnom','cass','poly'] : + if projection == 'gnom' and not projparams.has_key('R'): + raise ValueError, 'gnomonic projection only works for perfect spheres - not ellipsoids' if lat_0 is None or lon_0 is None: raise ValueError, 'must specify lat_0 and lon_0 for Transverse Mercator, Gnomonic, Cassini-Soldnerr Polyconic basemap' if not using_corners: @@ -827,10 +829,10 @@ self.projection in ['merc','mill','cyl','robin','moll','sinu','geos']: #self.projection in ['tmerc','omerc','cass','merc','mill','cyl','robin','moll','sinu','geos']: raise ValueError('%s projection cannot cross pole'%(self.projection)) - # make sure orthographic projection has containsPole=True + # make sure orthographic or gnomonic projection has containsPole=True # we will compute the intersections in stereographic # coordinates, then transform to orthographic. - if self.projection == 'ortho' and name == 'gshhs': + if self.projection in ['ortho','gnom'] and name == 'gshhs': containsPole = True lon_0=self.projparams['lon_0'] lat_0=self.projparams['lat_0'] @@ -841,7 +843,7 @@ lat0 = 90.*(np.around(lat_0/90.)) if np.abs(int(lat0)) == 90: lon0=0. maptran = pyproj.Proj(proj='stere',lon_0=lon0,lat_0=lat0,R=re) - # boundary polygon for orthographic projection + # boundary polygon for ortho/gnom projection # in stereographic coorindates. b = self._boundarypolyll.boundary blons = b[:,0]; blats = b[:,1] @@ -939,9 +941,9 @@ else: # transform coordinates from lat/lon # to map projection coordinates. - # special case for ortho, compute coastline polygon + # special case for ortho/gnom, compute coastline polygon # vertices in stereographic coords. - if name == 'gshhs' and self.projection == 'ortho': + if name == 'gshhs' and self.projection in ['ortho','gnom']: b[:,0], b[:,1] = maptran(b[:,0], b[:,1]) else: b[:,0], b[:,1] = self(b[:,0], b[:,1]) @@ -955,10 +957,10 @@ # in this map projection. bx = np.compress(goodmask, b[:,0]) by = np.compress(goodmask, b[:,1]) - # for orthographic projection, all points + # for ortho/gnom projection, all points # outside map projection region are eliminated # with the above step, so we're done. - if self.projection == 'ortho': + if self.projection in ['ortho','gnom']: polygons.append(zip(bx,by)) polygon_types.append(type) continue @@ -976,21 +978,22 @@ # iterate over geometries in intersection. for psub in geoms: b = psub.boundary - # if projection == 'ortho', + # if projection in ['ortho','gnom'], # transform polygon from stereographic - # to orthographic coordinates. - if self.projection == 'ortho': + # to ortho/gnom coordinates. + if self.projection in ['ortho','gnom']: # if coastline polygon covers more than 99% # of map region for fulldisk projection, # it's probably bogus, so skip it. areafrac = psub.area()/boundarypolyxy.area() - if name == 'gshhs' and\ - self._fulldisk and\ - areafrac > 0.99: continue + if self.projection == 'ortho': + if name == 'gshhs' and\ + self._fulldisk and\ + areafrac > 0.99: continue # inverse transform from stereographic # to lat/lon. b[:,0], b[:,1] = maptran(b[:,0], b[:,1], inverse=True) - # orthographic. + # orthographic/gnomonic. b[:,0], b[:,1]= self(b[:,0], b[:,1]) polygons.append(zip(b[:,0],b[:,1])) polygon_types.append(type) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5554 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5554&view=rev Author: mdboom Date: 2008年06月16日 05:14:22 -0700 (2008年6月16日) Log Message: ----------- Fix bug specifying alpha in a color array. (Thanks, M?195円?161円ty?195円?161円s J?195円?161円nos) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/colors.py Modified: trunk/matplotlib/lib/matplotlib/colors.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colors.py 2008年06月16日 12:04:29 UTC (rev 5553) +++ trunk/matplotlib/lib/matplotlib/colors.py 2008年06月16日 12:14:22 UTC (rev 5554) @@ -291,11 +291,15 @@ """ try: if not cbook.is_string_like(arg) and cbook.iterable(arg): - if len(arg) == 4 and alpha is None: + if len(arg) == 4: if [x for x in arg if (float(x) < 0) or (x > 1)]: # This will raise TypeError if x is not a number. raise ValueError('number in rbga sequence outside 0-1 range') - return tuple(arg) + if alpha is None: + return tuple(arg) + if alpha < 0.0 or alpha > 1.0: + raise ValueError("alpha must be in range 0-1") + return arg[0], arg[1], arg[2], arg[3] * alpha r,g,b = arg[:3] if [x for x in (r,g,b) if (float(x) < 0) or (x > 1)]: raise ValueError('number in rbg sequence outside 0-1 range') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5553 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5553&view=rev Author: jswhit Date: 2008年06月16日 05:04:29 -0700 (2008年6月16日) Log Message: ----------- added azimuth equidistant example Modified Paths: -------------- trunk/toolkits/basemap/doc/users/mapsetup.rst Added Paths: ----------- trunk/toolkits/basemap/doc/users/azeqd.rst trunk/toolkits/basemap/doc/users/figures/azeqd.png trunk/toolkits/basemap/doc/users/figures/azeqd.py Added: trunk/toolkits/basemap/doc/users/azeqd.rst =================================================================== --- trunk/toolkits/basemap/doc/users/azeqd.rst (rev 0) +++ trunk/toolkits/basemap/doc/users/azeqd.rst 2008年06月16日 12:04:29 UTC (rev 5553) @@ -0,0 +1,17 @@ +.. _azeqd: + +Azimuthal Equidistant Projection +================================ + +The shortest route from the center of the map +to any other point is a straight line in the azimuthal +equidistant projection. Such lines show the true scale +on the earth's surface. +So, for the specified point, this script draws a map that shows +in which direction to depart for other points on earth and how far +it will be to reach that destination. +The specified point ``lon_0, lat_0`` shows up as a black dot in the center of the map. + +.. literalinclude:: figures/azeqd.py + +.. image:: figures/azeqd.png Added: trunk/toolkits/basemap/doc/users/figures/azeqd.png =================================================================== (Binary files differ) Property changes on: trunk/toolkits/basemap/doc/users/figures/azeqd.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/toolkits/basemap/doc/users/figures/azeqd.py =================================================================== --- trunk/toolkits/basemap/doc/users/figures/azeqd.py (rev 0) +++ trunk/toolkits/basemap/doc/users/figures/azeqd.py 2008年06月16日 12:04:29 UTC (rev 5553) @@ -0,0 +1,20 @@ +from mpl_toolkits.basemap import Basemap +import numpy as np +import matplotlib.pyplot as plt +width = 28000000; lon_0 = -105; lat_0 = 40 +m = Basemap(width=width,height=width,projection='aeqd', + lat_0=lat_0,lon_0=lon_0) +# fill background. +m.drawmapboundary(fill_color='aqua') +# draw coasts and fill continents. +m.drawcoastlines(linewidth=0.5) +m.fillcontinents(color='coral',lake_color='aqua') +# 20 degree graticule. +m.drawparallels(np.arange(-80,81,20)) +m.drawmeridians(np.arange(-180,180,20)) +# draw a black dot at the center. +xpt, ypt = m(lon_0, lat_0) +m.plot([xpt],[ypt],'ko') +# draw the title. +plt.title('Azimuthal Equidistant Projection') +plt.savefig('azeqd.png') Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst =================================================================== --- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008年06月16日 00:27:35 UTC (rev 5552) +++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008年06月16日 12:04:29 UTC (rev 5553) @@ -28,4 +28,5 @@ .. toctree:: + azeqd.rst ortho.rst This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5552 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5552&view=rev Author: dsdale Date: 2008年06月15日 17:27:35 -0700 (2008年6月15日) Log Message: ----------- added colorbar api reference Modified Paths: -------------- trunk/matplotlib/doc/api/index.rst trunk/matplotlib/lib/matplotlib/colorbar.py Added Paths: ----------- trunk/matplotlib/doc/api/axis_api.rst trunk/matplotlib/doc/api/cbook_api.rst trunk/matplotlib/doc/api/cm_api.rst trunk/matplotlib/doc/api/collections_api.rst trunk/matplotlib/doc/api/colorbar_api.rst Added: trunk/matplotlib/doc/api/axis_api.rst =================================================================== --- trunk/matplotlib/doc/api/axis_api.rst (rev 0) +++ trunk/matplotlib/doc/api/axis_api.rst 2008年06月16日 00:27:35 UTC (rev 5552) @@ -0,0 +1,11 @@ +*************** +matplotlib axis +*************** + + +:mod:`matplotlib.axis` +====================== + +.. automodule:: matplotlib.axis + :members: + :undoc-members: Added: trunk/matplotlib/doc/api/cbook_api.rst =================================================================== --- trunk/matplotlib/doc/api/cbook_api.rst (rev 0) +++ trunk/matplotlib/doc/api/cbook_api.rst 2008年06月16日 00:27:35 UTC (rev 5552) @@ -0,0 +1,11 @@ +**************** +matplotlib cbook +**************** + + +:mod:`matplotlib.cbook` +======================= + +.. automodule:: matplotlib.cbook + :members: + :undoc-members: Added: trunk/matplotlib/doc/api/cm_api.rst =================================================================== --- trunk/matplotlib/doc/api/cm_api.rst (rev 0) +++ trunk/matplotlib/doc/api/cm_api.rst 2008年06月16日 00:27:35 UTC (rev 5552) @@ -0,0 +1,11 @@ +************* +matplotlib cm +************* + + +:mod:`matplotlib.cm` +==================== + +.. automodule:: matplotlib.cm + :members: + :undoc-members: Added: trunk/matplotlib/doc/api/collections_api.rst =================================================================== --- trunk/matplotlib/doc/api/collections_api.rst (rev 0) +++ trunk/matplotlib/doc/api/collections_api.rst 2008年06月16日 00:27:35 UTC (rev 5552) @@ -0,0 +1,11 @@ +********************** +matplotlib collections +********************** + + +:mod:`matplotlib.collections` +============================= + +.. automodule:: matplotlib.collections + :members: + :undoc-members: Added: trunk/matplotlib/doc/api/colorbar_api.rst =================================================================== --- trunk/matplotlib/doc/api/colorbar_api.rst (rev 0) +++ trunk/matplotlib/doc/api/colorbar_api.rst 2008年06月16日 00:27:35 UTC (rev 5552) @@ -0,0 +1,11 @@ +******************* +matplotlib colorbar +******************* + + +:mod:`matplotlib.colorbar` +========================== + +.. automodule:: matplotlib.colorbar + :members: + :undoc-members: Modified: trunk/matplotlib/doc/api/index.rst =================================================================== --- trunk/matplotlib/doc/api/index.rst 2008年06月15日 23:53:06 UTC (rev 5551) +++ trunk/matplotlib/doc/api/index.rst 2008年06月16日 00:27:35 UTC (rev 5552) @@ -18,5 +18,6 @@ cbook_api.rst cm_api.rst collections_api.rst + colorbar_api.rst pyplot_api.rst index_backend_api.rst Modified: trunk/matplotlib/lib/matplotlib/colorbar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colorbar.py 2008年06月15日 23:53:06 UTC (rev 5551) +++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008年06月16日 00:27:35 UTC (rev 5552) @@ -1,17 +1,21 @@ ''' Colorbar toolkit with two classes and a function: - ColorbarBase is the base class with full colorbar drawing functionality. + :class:`ColorbarBase` + the base class with full colorbar drawing functionality. It can be used as-is to make a colorbar for a given colormap; a mappable object (e.g., image) is not needed. - Colorbar is the derived class for use with images or contour plots. + :class:`Colorbar` + the derived class for use with images or contour plots. - make_axes is a function for resizing an axes and adding a second axes + :func:`make_axes` + a function for resizing an axes and adding a second axes suitable for a colorbar -The Figure.colorbar() method uses make_axes and Colorbar; the pylab.colorbar() -function is a thin wrapper over Figure.colorbar(). +The :meth:`matplotlib.Figure.colorbar` method uses :func:`make_axes` +and :class:`Colorbar`; the :func:`matplotlib.pyplot.colorbar` function +is a thin wrapper over :meth:`matplotlib.Figure.colorbar`. ''' @@ -28,60 +32,68 @@ make_axes_kw_doc = ''' - ======== ==================================================== - Property Description - ======== ==================================================== - fraction 0.15; fraction of original axes to use for colorbar - pad 0.05 if vertical, 0.15 if horizontal; fraction - of original axes between colorbar and new image axes - shrink 1.0; fraction by which to shrink the colorbar - aspect 20; ratio of long to short dimensions - ======== ==================================================== + ========== ==================================================== + Property Description + ========== ==================================================== + *fraction* 0.15; fraction of original axes to use for colorbar + *pad* 0.05 if vertical, 0.15 if horizontal; fraction + of original axes between colorbar and new image axes + *shrink* 1.0; fraction by which to shrink the colorbar + *aspect* 20; ratio of long to short dimensions + ========== ==================================================== ''' colormap_kw_doc = ''' - ========= =============================================================== - Property Description - ========= =============================================================== - extend [ 'neither' | 'both' | 'min' | 'max' ] - If not 'neither', make pointed end(s) for out-of-range - values. These are set for a given colormap using the - colormap set_under and set_over methods. - spacing [ 'uniform' | 'proportional' ] - Uniform spacing gives each discrete color the same space; - proportional makes the space proportional to the data interval. - ticks [ None | list of ticks | Locator object ] - If None, ticks are determined automatically from the input. - format [ None | format string | Formatter object ] - If none, the ScalarFormatter is used. - If a format string is given, e.g. '%.3f', that is used. - An alternative Formatter object may be given instead. - drawedges [ False | True ] If true, draw lines at color boundaries. - ========= =============================================================== + =========== ==================================================== + Property Description + =========== ==================================================== + *extend* [ 'neither' | 'both' | 'min' | 'max' ] + If not 'neither', make pointed end(s) for out-of- + range values. These are set for a given colormap + using the colormap set_under and set_over methods. + *spacing* [ 'uniform' | 'proportional' ] + Uniform spacing gives each discrete color the same + space; proportional makes the space proportional to + the data interval. + *ticks* [ None | list of ticks | Locator object ] + If None, ticks are determined automatically from the + input. + *format* [ None | format string | Formatter object ] + If None, the + :class:`~matplotlib.ticker.ScalarFormatter` is used. + If a format string is given, e.g. '%.3f', that is + used. An alternative + :class:`~matplotlib.ticker.Formatter` object may be + given instead. + *drawedges* [ False | True ] If true, draw lines at color + boundaries. + =========== ==================================================== The following will probably be useful only in the context of indexed colors (that is, when the mappable has norm=NoNorm()), or other unusual circumstances. - ========== =============================================================== - Property Description - ========== =============================================================== - boundaries None or a sequence - values None or a sequence which must be of length 1 less than the - sequence of boundaries. For each region delimited by adjacent - entries in boundaries, the color mapped to the corresponding - value in values will be used. - ========== =============================================================== + ============ =================================================== + Property Description + ============ =================================================== + *boundaries* None or a sequence + *values* None or a sequence which must be of length 1 less + than the sequence of *boundaries*. For each region + delimited by adjacent entries in *boundaries*, the + color mapped to the corresponding value in values + will be used. + ============ =================================================== ''' colorbar_doc = ''' Add a colorbar to a plot. -Function signatures for the pyplot interface; all but the first are -also method signatures for the Figure.colorbar method:: +Function signatures for the :mod:`~matplotlib.pyplot` interface; all +but the first are also method signatures for the +:meth:`matplotlib.Figure.colorbar` method:: colorbar(**kwargs) colorbar(mappable, **kwargs) @@ -89,16 +101,17 @@ colorbar(mappable, ax=ax, **kwargs) arguments: - mappable: - the image, ContourSet, etc. to which the colorbar applies; - this argument is mandatory for the Figure.colorbar - method but optional for the pyplot.colorbar function, - which sets the default to the current image. + *mappable* + the image, :class:`~matplotlib.contours.ContourSet`, etc. to + which the colorbar applies; this argument is mandatory for the + :meth:`matplotlib.Figure.colorbar` method but optional for the + :func:`matplotlib.pyplot.colorbar` function, which sets the + default to the current image. keyword arguments: - cax: + *cax* None | axes object into which the colorbar will be drawn - ax: + *ax* None | parent axes object from which space for a new colorbar axes will be stolen @@ -109,19 +122,18 @@ colorbar properties: %s -If mappable is a ContourSet, its extend kwarg is included automatically. +If mappable is a :class:`~matplotlib.contours.ContourSet`, its *extend* +kwarg is included automatically. -Note that the shrink kwarg provides a simple way to keep -a vertical colorbar, for example, from being taller than -the axes of the mappable to which the colorbar is attached; -but it is a manual method requiring some trial and error. -If the colorbar is too tall (or a horizontal colorbar is -too wide) use a smaller value of shrink. +Note that the *shrink* kwarg provides a simple way to keep a vertical +colorbar, for example, from being taller than the axes of the mappable +to which the colorbar is attached; but it is a manual method requiring +some trial and error. If the colorbar is too tall (or a horizontal +colorbar is too wide) use a smaller value of *shrink*. -For more precise control, you can manually specify the -positions of the axes objects in which the mappable and -the colorbar are drawn. In this case, do not use any of the -axes properties kwargs. +For more precise control, you can manually specify the positions of +the axes objects in which the mappable and the colorbar are drawn. In +this case, do not use any of the axes properties kwargs. ''' % (make_axes_kw_doc, colormap_kw_doc) @@ -130,16 +142,22 @@ ''' Draw a colorbar in an existing axes. - This is a base class for the Colorbar class, which is - the basis for the colorbar method and pylab function. + This is a base class for the :class:`Colorbar` class, which is the + basis for the :func:`~matplotlib.pyplot.colorbar` method and pylab + function. - It is also useful by itself for showing a colormap. If - the cmap kwarg is given but boundaries and values are left - as None, then the colormap will be displayed on a 0-1 scale. - To show the under- and over-value colors, specify the norm - as colors.Normalize(clip=False). + It is also useful by itself for showing a colormap. If the *cmap* + kwarg is given but *boundaries* and *values* are left as None, + then the colormap will be displayed on a 0-1 scale. To show the + under- and over-value colors, specify the *norm* as:: + + colors.Normalize(clip=False) + To show the colors versus index instead of on the 0-1 scale, - use norm=colors.NoNorm. + use:: + + norm=colors.NoNorm. + ''' _slice_dict = {'neither': slice(0,1000000), 'both': slice(1,-1), @@ -257,7 +275,7 @@ def _outline(self, X, Y): ''' - Return x, y arrays of colorbar bounding polygon, + Return *x*, *y* arrays of colorbar bounding polygon, taking orientation into account. ''' N = X.shape[0] @@ -284,7 +302,8 @@ def _add_solids(self, X, Y, C): ''' - Draw the colors using pcolor; optionally add separators. + Draw the colors using :meth:`~matplotlib.axes.Axes.pcolor`; + optionally add separators. ''' ## Change to pcolorfast after fixing bugs in some backends... if self.orientation == 'vertical': @@ -371,9 +390,9 @@ def _process_values(self, b=None): ''' - Set the _boundaries and _values attributes based on - the input boundaries and values. Input boundaries can - be self.boundaries or the argument b. + Set the :attr:`_boundaries` and :attr:`_values` attributes + based on the input boundaries and values. Input boundaries + can be *self.boundaries* or the argument *b*. ''' if b is None: b = self.boundaries @@ -441,15 +460,15 @@ def _find_range(self): ''' - Set vmin and vmax attributes to the first and last - boundary excluding extended end boundaries. + Set :attr:`vmin` and :attr:`vmax` attributes to the first and + last boundary excluding extended end boundaries. ''' b = self._boundaries[self._inside] self.vmin = b[0] self.vmax = b[-1] def _central_N(self): - '''number of boundaries *before* extension of ends''' + '''number of boundaries **before** extension of ends''' nb = len(self._boundaries) if self.extend == 'both': nb -= 2 @@ -471,7 +490,7 @@ def _uniform_y(self, N): ''' - Return colorbar data coordinates for N uniformly + Return colorbar data coordinates for *N* uniformly spaced boundaries, plus ends if required. ''' if self.extend == 'neither': @@ -595,7 +614,8 @@ def add_lines(self, CS): ''' - Add the lines from a non-filled ContourSet to the colorbar. + Add the lines from a non-filled + :class:`~matplotlib.contour.ContourSet` to the colorbar. ''' if not isinstance(CS, contour.ContourSet) or CS.filled: raise ValueError('add_lines is only for a ContourSet of lines') @@ -612,7 +632,8 @@ ColorbarBase.add_lines(self, CS.levels, tcolors, tlinewidths) def update_bruteforce(self, mappable): - '''Manually change any contour line colors. This is called + ''' + Manually change any contour line colors. This is called when the image or contour plot to which this colorbar belongs is changed. ''' @@ -666,12 +687,15 @@ return cax, kw make_axes.__doc__ =''' Resize and reposition a parent axes, and return a child - axes suitable for a colorbar. + axes suitable for a colorbar:: - cax, kw = make_axes(parent, **kw) + cax, kw = make_axes(parent, **kw) Keyword arguments may include the following (with defaults): - orientation = 'vertical' or 'horizontal' + + *orientation* + 'vertical' or 'horizontal' + %s All but the first of these are stripped from the input kw set. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.