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
|
|
From: <jd...@us...> - 2009-08-05 12:04:47
|
Revision: 7362
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7362&view=rev
Author: jdh2358
Date: 2009-08-05 12:04:36 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
added a new mpl data example script to test svn commits on the data
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/cbook.py
Added Paths:
-----------
trunk/matplotlib/examples/misc/mpl_data_test.py
Added: trunk/matplotlib/examples/misc/mpl_data_test.py
===================================================================
--- trunk/matplotlib/examples/misc/mpl_data_test.py (rev 0)
+++ trunk/matplotlib/examples/misc/mpl_data_test.py 2009-08-05 12:04:36 UTC (rev 7362)
@@ -0,0 +1,13 @@
+"""
+Demonstrate how get_mpl_data works with svn revisions in the data.
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/mpl_data
+
+and edit testdata.csv to add a new row. After committing the changes,
+when you rerun this script you will get the updated data (and the new
+svn version will be cached in ~/.matplotlib/mpl_data)
+"""
+
+import matplotlib.cbook as cbook
+fh = cbook.get_mpl_data("testdata.csv")
+print fh.read()
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2009-08-05 11:39:37 UTC (rev 7361)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2009-08-05 12:04:36 UTC (rev 7362)
@@ -89,7 +89,7 @@
"""
from __future__ import generators
-__version__ = '0.99.0.rc1'
+__version__ = '1.0.svn'
__revision__ = '$Revision$'
__date__ = '$Date$'
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-05 11:39:37 UTC (rev 7361)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-05 12:04:36 UTC (rev 7362)
@@ -356,7 +356,7 @@
def in_cache_dir(self, fn):
return os.path.join(self.cache_dir, fn)
-
+
def read_cache(self):
"""
Read the cache file from the cache directory.
@@ -386,7 +386,7 @@
for path in os.listdir(self.cache_dir):
if path not in listed and path != 'cache.pck':
os.remove(os.path.join(self.cache_dir, path))
-
+
def write_cache(self):
"""
Write the cache data structure into the cache directory.
@@ -419,7 +419,7 @@
# http_request for preprocessing requests
# http_error_304 for handling 304 Not Modified responses
# http_response for postprocessing requests
-
+
def http_request(self, req):
"""
Make the request conditional if we have a cached file.
@@ -441,7 +441,7 @@
handle = urllib2.addinfourl(file, hdrs, url)
handle.code = 304
return handle
-
+
def http_response(self, req, response):
"""
Update the cache with the returned file.
@@ -473,7 +473,7 @@
To add a datafile to this directory, you need to check out
mpl_data from matplotlib svn::
- svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/mpl_data
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/mpl_data
and svn add the data file you want to support. This is primarily
intended for use in mpl examples that need custom data
@@ -497,7 +497,7 @@
response.close()
p = get_mpl_data.processor
return p.in_cache_dir(p.cache[url][0])
-
+
def flatten(seq, scalarp=is_scalar_or_string):
"""
this generator flattens nested containers such as
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-05 11:39:43
|
Revision: 7361
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7361&view=rev
Author: jdh2358
Date: 2009-08-05 11:39:37 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
updated test data
Modified Paths:
--------------
trunk/mpl_data/testdata.csv
Modified: trunk/mpl_data/testdata.csv
===================================================================
--- trunk/mpl_data/testdata.csv 2009-08-05 11:34:43 UTC (rev 7360)
+++ trunk/mpl_data/testdata.csv 2009-08-05 11:39:37 UTC (rev 7361)
@@ -1,3 +1,5 @@
name,age
john,41
-miriam,38
\ No newline at end of file
+miriam,38
+rahel,11
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-05 11:34:49
|
Revision: 7360
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7360&view=rev
Author: jdh2358
Date: 2009-08-05 11:34:43 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
added testdata.csv
Added Paths:
-----------
trunk/mpl_data/testdata.csv
Added: trunk/mpl_data/testdata.csv
===================================================================
--- trunk/mpl_data/testdata.csv (rev 0)
+++ trunk/mpl_data/testdata.csv 2009-08-05 11:34:43 UTC (rev 7360)
@@ -0,0 +1,3 @@
+name,age
+john,41
+miriam,38
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-05 11:06:19
|
Revision: 7359
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7359&view=rev
Author: jdh2358
Date: 2009-08-05 11:06:13 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
remove dup gui event in enter/leave events in gtk
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py
Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-05 02:29:12 UTC (rev 7358)
+++ branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-05 11:06:13 UTC (rev 7359)
@@ -243,10 +243,10 @@
return False # finish event propagation?
def leave_notify_event(self, widget, event):
- FigureCanvasBase.leave_notify_event(self, event, guiEvent=event)
+ FigureCanvasBase.leave_notify_event(self, event)
def enter_notify_event(self, widget, event):
- FigureCanvasBase.enter_notify_event(self, event, guiEvent=event)
+ FigureCanvasBase.enter_notify_event(self, event)
def _get_key(self, event):
if event.keyval in self.keyvald:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-05 02:29:21
|
Revision: 7358
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7358&view=rev
Author: jdh2358
Date: 2009-08-05 02:29:12 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
some fixes for osx builds on rc2
Modified Paths:
--------------
branches/v0_99_maint/doc/_templates/indexsidebar.html
branches/v0_99_maint/lib/matplotlib/__init__.py
branches/v0_99_maint/release/osx/Makefile
branches/v0_99_maint/release/osx/README.txt
Modified: branches/v0_99_maint/doc/_templates/indexsidebar.html
===================================================================
--- branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-05 00:11:42 UTC (rev 7357)
+++ branches/v0_99_maint/doc/_templates/indexsidebar.html 2009-08-05 02:29:12 UTC (rev 7358)
@@ -3,7 +3,7 @@
<p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a>
to support matplotlib development.</p>
-<p>A release candidate rc1 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>
+<p>A release candidate rc2 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>
</p>
<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>.
Modified: branches/v0_99_maint/lib/matplotlib/__init__.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/__init__.py 2009-08-05 00:11:42 UTC (rev 7357)
+++ branches/v0_99_maint/lib/matplotlib/__init__.py 2009-08-05 02:29:12 UTC (rev 7358)
@@ -89,7 +89,7 @@
"""
from __future__ import generators
-__version__ = '0.99.0.rc1'
+__version__ = '0.99.0.rc2'
__revision__ = '$Revision$'
__date__ = '$Date$'
Modified: branches/v0_99_maint/release/osx/Makefile
===================================================================
--- branches/v0_99_maint/release/osx/Makefile 2009-08-05 00:11:42 UTC (rev 7357)
+++ branches/v0_99_maint/release/osx/Makefile 2009-08-05 02:29:12 UTC (rev 7358)
@@ -1,10 +1,10 @@
-PYVERSION=2.6
+PYVERSION=2.5
PYTHON=python${PYVERSION}
SRCDIR=${PWD}
ZLIBVERSION=1.2.3
PNGVERSION=1.2.33
FREETYPEVERSION=2.3.7
-MPLVERSION=0.99.0.rc1
+MPLVERSION=0.99.0.rc2
BDISTMPKGVERSION=0.4.4
MPLSRC=matplotlib-${MPLVERSION}
MACOSX_DEPLOYMENT_TARGET=10.4
@@ -88,7 +88,7 @@
cp ../data/setup.cfg . &&\
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
- bdist_mpkg &&\
+ /Library/Frameworks/Python.framework/Versions/${PYVERSION}/bin/bdist_mpkg &&\
${PYTHON} setupegg.py bdist_egg &&\
cd dist && \
zip -ro matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5_mpkg.zip matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg
Modified: branches/v0_99_maint/release/osx/README.txt
===================================================================
--- branches/v0_99_maint/release/osx/README.txt 2009-08-05 00:11:42 UTC (rev 7357)
+++ branches/v0_99_maint/release/osx/README.txt 2009-08-05 02:29:12 UTC (rev 7358)
@@ -7,7 +7,7 @@
-------------
* :file:`bdist_mkpg` - the distutils.extension to build Installer.app
- mpkg installers.
+ mpkg installers.
* :file:`data` - some config files and patches needed for the build
@@ -19,16 +19,22 @@
How to build
--------------
-* You need a python framework build , numpy and wxpython to build the
+* You need a python framework build, numpy and wxpython to build the
mpl installers (wx requires this and we need wx to build the wxagg
- extension). You can get the three required dependencies as
- Installer apps, eg:
+ extension). I recommend building python from src as a framework build::
+ ./configure --enable-universalsdk --enable-framework
+ sudo make install
- http://www.python.org/ftp/python/2.6.2/python-2.6.2-macosx2009-04-16.dmg
- http://downloads.sourceforge.net/project/numpy/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg?use_mirror=voxel
- http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel
+ and build numpy from src too since the 2.5 numpy installer doesn't work
+ with a python built from src::
+ sudo python setup.py install
+
+ you can use the pre-built installer for wx::
+
+ http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel
+
* You need to make sure to unset PKG_CONFIG_PATH to make sure the
static linking below is respected. Otherwise the mpl build script
will dynamically link using the libs from pkgconfig if you have this
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-05 00:11:48
|
Revision: 7357
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7357&view=rev
Author: efiring
Date: 2009-08-05 00:11:42 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
Remove unused argument from data_init in cntr.c
Modified Paths:
--------------
trunk/matplotlib/src/cntr.c
Modified: trunk/matplotlib/src/cntr.c
===================================================================
--- trunk/matplotlib/src/cntr.c 2009-08-05 00:05:37 UTC (rev 7356)
+++ trunk/matplotlib/src/cntr.c 2009-08-05 00:11:42 UTC (rev 7357)
@@ -291,7 +291,7 @@
static long curve_tracer (Csite * site, int pass2);
/* this initializes the data array for curve_tracer */
-static void data_init (Csite * site, int region, long nchunk);
+static void data_init (Csite * site, long nchunk);
/* ------------------------------------------------------------------------ */
@@ -974,13 +974,8 @@
/* ------------------------------------------------------------------------ */
-/* The sole function of the "region" argument is to specify the
- value in Csite.reg that denotes a missing zone. We always
- use zero.
-*/
-
static void
-data_init (Csite * site, int region, long nchunk)
+data_init (Csite * site, long nchunk)
{
Cdata * data = site->data;
long imax = site->imax;
@@ -1050,8 +1045,7 @@
data[ij + imax + 1] = 0;
if (reg)
{
- if (region ? (reg[ij + imax + 1] == region)
- : (reg[ij + imax + 1] != 0))
+ if (reg[ij + imax + 1] != 0)
data[ij + imax + 1] = ZONE_EX;
}
else
@@ -1403,7 +1397,7 @@
site->zlevel[1] = levels[1];
}
site->n = site->count = 0;
- data_init (site, 0, nchunk);
+ data_init (site, nchunk);
/* make first pass to compute required sizes for second pass */
for (;;)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-05 00:05:49
|
Revision: 7356
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7356&view=rev
Author: efiring
Date: 2009-08-05 00:05:37 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
Elimination of contourf cut strokes: second try
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/src/cntr.c
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 19:51:08 UTC (rev 7355)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2009-08-05 00:05:37 UTC (rev 7356)
@@ -606,7 +606,6 @@
segs = nlist[:nseg]
kinds = nlist[nseg:]
-
paths = self._make_paths(segs, kinds)
col = collections.PathCollection(paths,
@@ -652,8 +651,10 @@
codes = np.zeros(kind.shape, dtype=mpath.Path.code_type)
codes.fill(mpath.Path.LINETO)
codes[0] = mpath.Path.MOVETO
- # Attempted slit removal is disabled until we get it right.
- #codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO
+ # points that begin a slit or are in it:
+ in_slit = kind[:-1] >= _cntr._slitkind
+ # use moveto for any point *following* such a point
+ codes[1:][in_slit] = mpath.Path.MOVETO
paths.append(mpath.Path(seg, codes))
return paths
Modified: trunk/matplotlib/src/cntr.c
===================================================================
--- trunk/matplotlib/src/cntr.c 2009-08-04 19:51:08 UTC (rev 7355)
+++ trunk/matplotlib/src/cntr.c 2009-08-05 00:05:37 UTC (rev 7356)
@@ -1326,7 +1326,7 @@
/* Build a list of XY 2-D arrays, shape (N,2), to which a list of K arrays
- is concatenated concatenated. */
+ is concatenated. */
static PyObject *
build_cntr_list_v2(long *np, double *xp, double *yp, short *kp,
int nparts, long ntotal)
@@ -1653,6 +1653,29 @@
return cntr_trace(self->site, levels, nlevels, nchunk);
}
+/* The following will not normally be called. It is experimental,
+ and intended for future debugging. It may go away at any time.
+*/
+static PyObject *
+Cntr_get_cdata(Cntr *self)
+{
+ PyArrayObject *Cdata;
+ npy_intp dims[2];
+ int i, j;
+ int ni, nj;
+
+ dims[0] = ni = self->site->imax;
+ dims[1] = nj = self->site->jmax;
+
+ Cdata = (PyArrayObject *) PyArray_SimpleNew(2, dims, PyArray_SHORT);
+ for (j=0; j<nj; j++)
+ for (i=0; i<ni; i++)
+ Cdata->data[j + i*nj] = self->site->data[i + j*ni];
+ /* output is C-order, input is F-order */
+ /* for now we are ignoring the last ni+1 values */
+ return (PyObject *)Cdata;
+}
+
static PyMethodDef Cntr_methods[] = {
{"trace", (PyCFunction)Cntr_trace, METH_VARARGS | METH_KEYWORDS,
"Return a list of contour line segments or polygons.\n\n"
@@ -1665,6 +1688,12 @@
" Optional argument: nchunk; approximate number of grid points\n"
" per chunk. 0 (default) for no chunking.\n"
},
+ {"get_cdata", (PyCFunction)Cntr_get_cdata, METH_NOARGS,
+ "Returns a copy of the mesh array with contour calculation codes.\n\n"
+ "Experimental and incomplete; we are not returning quite all of\n"
+ "the array.\n"
+ "Don't call this unless you are exploring the dark recesses of cntr.c\n"
+ },
{0, 0, 0, 0} /* Sentinel */
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-08-04 19:51:20
|
Revision: 7355
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7355&view=rev
Author: jouni
Date: 2009-08-04 19:51:08 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Fix indentation error in mpl_data_demo.py - thanks to G?\195?\182khan Sever
Modified Paths:
--------------
trunk/matplotlib/examples/misc/mpl_data_demo.py
Modified: trunk/matplotlib/examples/misc/mpl_data_demo.py
===================================================================
--- trunk/matplotlib/examples/misc/mpl_data_demo.py 2009-08-04 19:35:13 UTC (rev 7354)
+++ trunk/matplotlib/examples/misc/mpl_data_demo.py 2009-08-04 19:51:08 UTC (rev 7355)
@@ -1,7 +1,7 @@
- """
- Grab mpl data from the ~/.matplotlib/mpl_data cache if it exists, else
- fetch it from svn and cache it
- """
+"""
+Grab mpl data from the ~/.matplotlib/mpl_data cache if it exists, else
+fetch it from svn and cache it
+"""
import matplotlib.cbook as cbook
import matplotlib.pyplot as plt
fname = cbook.get_mpl_data('lena.png', asfileobj=False)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-08-04 19:35:22
|
Revision: 7354
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7354&view=rev
Author: jouni
Date: 2009-08-04 19:35:13 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Made cbook.get_mpl_data make use of the ETag and Last-Modified headers of mod_dav_svn.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/cbook.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-08-04 18:46:41 UTC (rev 7353)
+++ trunk/matplotlib/CHANGELOG 2009-08-04 19:35:13 UTC (rev 7354)
@@ -1,3 +1,5 @@
+2009-08-04 Made cbook.get_mpl_data make use of the ETag and Last-Modified
+ headers of mod_dav_svn. - JKS
2009-08-03 Add PathCollection; modify contourf to use complex
paths instead of simple paths with cuts. - EF
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-04 18:46:41 UTC (rev 7353)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-04 19:35:13 UTC (rev 7354)
@@ -9,6 +9,10 @@
import numpy as np
import numpy.ma as ma
from weakref import ref
+import cPickle
+import os.path
+import random
+import urllib2
import matplotlib
@@ -340,8 +344,120 @@
def is_scalar_or_string(val):
return is_string_like(val) or not iterable(val)
+class _CacheProcessor(urllib2.BaseHandler):
+ """
+ Urllib2 handler that takes care of caching files.
+ The file cache.pck holds the directory of files to be cached.
+ """
+ def __init__(self, cache_dir):
+ self.cache_dir = cache_dir
+ self.read_cache()
+ self.remove_stale_files()
+ def in_cache_dir(self, fn):
+ return os.path.join(self.cache_dir, fn)
+
+ def read_cache(self):
+ """
+ Read the cache file from the cache directory.
+ """
+ fn = self.in_cache_dir('cache.pck')
+ if not os.path.exists(fn):
+ self.cache = {}
+ return
+ f = open(fn, 'rb')
+ cache = cPickle.load(f)
+ f.close()
+
+ # If any files are deleted, drop them from the cache
+ for url, (fn, _, _) in cache.items():
+ if not os.path.exists(self.in_cache_dir(fn)):
+ del cache[url]
+
+ self.cache = cache
+
+ def remove_stale_files(self):
+ """
+ Remove files from the cache directory that are not listed in
+ cache.pck.
+ """
+ listed = set([fn for (_, (fn, _, _)) in self.cache.items()])
+ for path in os.listdir(self.cache_dir):
+ if path not in listed and path != 'cache.pck':
+ os.remove(os.path.join(self.cache_dir, path))
+
+ def write_cache(self):
+ """
+ Write the cache data structure into the cache directory.
+ """
+ fn = self.in_cache_dir('cache.pck')
+ f = open(fn, 'wb')
+ cPickle.dump(self.cache, f, -1)
+ f.close()
+
+ def cache_file(self, url, data, headers):
+ """
+ Store a received file in the cache directory.
+ """
+ # Pick a filename
+ rightmost = url.rstrip('/').split('/')[-1]
+ fn = rightmost
+ while os.path.exists(self.in_cache_dir(fn)):
+ fn = rightmost + '.' + str(random.randint(0,9999999))
+
+ # Write out the data
+ f = open(self.in_cache_dir(fn), 'wb')
+ f.write(data)
+ f.close()
+
+ # Update the cache
+ self.cache[url] = (fn, headers.get('ETag'), headers.get('Last-Modified'))
+ self.write_cache()
+
+ # These urllib2 entry points are used:
+ # http_request for preprocessing requests
+ # http_error_304 for handling 304 Not Modified responses
+ # http_response for postprocessing requests
+
+ def http_request(self, req):
+ """
+ Make the request conditional if we have a cached file.
+ """
+ url = req.get_full_url()
+ if url in self.cache:
+ _, etag, lastmod = self.cache[url]
+ req.add_header("If-None-Match", etag)
+ req.add_header("If-Modified-Since", lastmod)
+ return req
+
+ def http_error_304(self, req, fp, code, msg, hdrs):
+ """
+ Read the file from the cache since the server has no newer version.
+ """
+ url = req.get_full_url()
+ fn, _, _ = self.cache[url]
+ file = open(self.in_cache_dir(fn), 'rb')
+ handle = urllib2.addinfourl(file, hdrs, url)
+ handle.code = 304
+ return handle
+
+ def http_response(self, req, response):
+ """
+ Update the cache with the returned file.
+ """
+ if response.code != 200:
+ return response
+ else:
+ data = response.read()
+ self.cache_file(req.get_full_url(), data, response.headers)
+ result = urllib2.addinfourl(StringIO.StringIO(data),
+ response.headers,
+ req.get_full_url())
+ result.code = response.code
+ result.msg = response.msg
+ return result
+
def get_mpl_data(fname, asfileobj=True):
"""
Check the cachedirectory ~/.matplotlib/mpl_data for an mpl_data
@@ -363,32 +479,25 @@
intended for use in mpl examples that need custom data
"""
- # TODO: how to handle stale data in the cache that has been
- # updated from svn -- is there a clean http way to get the current
- # revision number that will not leave us at the mercy of html
- # changes at sf?
+ if not hasattr(get_mpl_data, 'opener'):
+ configdir = matplotlib.get_configdir()
+ cachedir = os.path.join(configdir, 'mpl_data')
+ if not os.path.exists(cachedir):
+ os.mkdir(cachedir)
+ # Store the cache processor and url opener as attributes of this function
+ get_mpl_data.processor = _CacheProcessor(cachedir)
+ get_mpl_data.opener = urllib2.build_opener(get_mpl_data.processor)
-
- configdir = matplotlib.get_configdir()
- cachedir = os.path.join(configdir, 'mpl_data')
- if not os.path.exists(cachedir):
- os.mkdir(cachedir)
-
- cachefile = os.path.join(cachedir, fname)
-
- if not os.path.exists(cachefile):
- import urllib
- url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/%s'%urllib.quote(fname)
- matplotlib.verbose.report('Attempting to download %s to %s'%(url, cachefile))
- urllib.urlretrieve(url, filename=cachefile)
- else:
- matplotlib.verbose.report('Aleady have mpl_data %s'%fname)
-
+ url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/' + \
+ urllib2.quote(fname)
+ response = get_mpl_data.opener.open(url)
if asfileobj:
- return to_filehandle(cachefile)
+ return response
else:
- return cachefile
-
+ response.close()
+ p = get_mpl_data.processor
+ return p.in_cache_dir(p.cache[url][0])
+
def flatten(seq, scalarp=is_scalar_or_string):
"""
this generator flattens nested containers such as
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-04 18:46:52
|
Revision: 7353
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7353&view=rev
Author: jdh2358
Date: 2009-08-04 18:46:41 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
attach gtk events to mpl events -- fixes sf bug 2816580
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py
Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-04 18:40:10 UTC (rev 7352)
+++ branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-04 18:46:41 UTC (rev 7353)
@@ -197,7 +197,7 @@
step = 1
else:
step = -1
- FigureCanvasBase.scroll_event(self, x, y, step)
+ FigureCanvasBase.scroll_event(self, x, y, step, guiEvent=event)
return False # finish event propagation?
def button_press_event(self, widget, event):
@@ -205,7 +205,7 @@
x = event.x
# flipy so y=0 is bottom of canvas
y = self.allocation.height - event.y
- FigureCanvasBase.button_press_event(self, x, y, event.button)
+ FigureCanvasBase.button_press_event(self, x, y, event.button, guiEvent=event)
return False # finish event propagation?
def button_release_event(self, widget, event):
@@ -213,21 +213,21 @@
x = event.x
# flipy so y=0 is bottom of canvas
y = self.allocation.height - event.y
- FigureCanvasBase.button_release_event(self, x, y, event.button)
+ FigureCanvasBase.button_release_event(self, x, y, event.button, guiEvent=event)
return False # finish event propagation?
def key_press_event(self, widget, event):
if _debug: print 'FigureCanvasGTK.%s' % fn_name()
key = self._get_key(event)
if _debug: print "hit", key
- FigureCanvasBase.key_press_event(self, key)
+ FigureCanvasBase.key_press_event(self, key, guiEvent=event)
return False # finish event propagation?
def key_release_event(self, widget, event):
if _debug: print 'FigureCanvasGTK.%s' % fn_name()
key = self._get_key(event)
if _debug: print "release", key
- FigureCanvasBase.key_release_event(self, key)
+ FigureCanvasBase.key_release_event(self, key, guiEvent=event)
return False # finish event propagation?
def motion_notify_event(self, widget, event):
@@ -239,14 +239,14 @@
# flipy so y=0 is bottom of canvas
y = self.allocation.height - y
- FigureCanvasBase.motion_notify_event(self, x, y)
+ FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
return False # finish event propagation?
def leave_notify_event(self, widget, event):
- FigureCanvasBase.leave_notify_event(self, event)
+ FigureCanvasBase.leave_notify_event(self, event, guiEvent=event)
def enter_notify_event(self, widget, event):
- FigureCanvasBase.enter_notify_event(self, event)
+ FigureCanvasBase.enter_notify_event(self, event, guiEvent=event)
def _get_key(self, event):
if event.keyval in self.keyvald:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-04 18:40:22
|
Revision: 7352
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7352&view=rev
Author: efiring
Date: 2009-08-04 18:40:10 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Disable contourf slit line removal until problems are fixed.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/src/cntr.c
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 18:21:59 UTC (rev 7351)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 18:40:10 UTC (rev 7352)
@@ -652,7 +652,8 @@
codes = np.zeros(kind.shape, dtype=mpath.Path.code_type)
codes.fill(mpath.Path.LINETO)
codes[0] = mpath.Path.MOVETO
- codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO
+ # Attempted slit removal is disabled until we get it right.
+ #codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO
paths.append(mpath.Path(seg, codes))
return paths
Modified: trunk/matplotlib/src/cntr.c
===================================================================
--- trunk/matplotlib/src/cntr.c 2009-08-04 18:21:59 UTC (rev 7351)
+++ trunk/matplotlib/src/cntr.c 2009-08-04 18:40:10 UTC (rev 7352)
@@ -326,12 +326,14 @@
int z0, z1, z2, z3;
int keep_left = 0; /* flag to try to minimize curvature in saddles */
int done = 0;
+ int n_kind;
if (level)
level = 2;
for (;;)
{
+ n_kind = 0;
/* set edge endpoints */
p0 = POINT0 (edge, fwd);
p1 = POINT1 (edge, fwd);
@@ -344,6 +346,7 @@
xcp[n] = zcp * (x[p1] - x[p0]) + x[p0];
ycp[n] = zcp * (y[p1] - y[p0]) + y[p0];
kcp[n] = kind_zone;
+ n_kind = n;
}
if (!done && !jedge)
{
@@ -497,9 +500,9 @@
{
return done;
}
- if (pass2 && n > 0)
+ if (pass2 && n_kind)
{
- kcp[n-1] += kind_start_slit;
+ kcp[n_kind] += kind_start_slit;
}
return slit_cutter (site, done - 5, pass2);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-04 18:22:07
|
Revision: 7351
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7351&view=rev
Author: jdh2358
Date: 2009-08-04 18:21:59 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
minor tweak to legend picking example
Modified Paths:
--------------
trunk/matplotlib/examples/event_handling/legend_picking.py
Modified: trunk/matplotlib/examples/event_handling/legend_picking.py
===================================================================
--- trunk/matplotlib/examples/event_handling/legend_picking.py 2009-08-04 18:09:38 UTC (rev 7350)
+++ trunk/matplotlib/examples/event_handling/legend_picking.py 2009-08-04 18:21:59 UTC (rev 7351)
@@ -31,11 +31,11 @@
# legend proxy line, and toggle the visibilit
legline = event.artist
origline = lined[legline]
- vis = origline.get_visible()
- origline.set_visible(not vis)
+ vis = not origline.get_visible()
+ origline.set_visible(vis)
# Change the alpha on the line in the legend so we can see what lines
# have been toggled
- if not vis:
+ if vis:
legline.set_alpha(1.0)
else:
legline.set_alpha(0.2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-04 18:09:49
|
Revision: 7350
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7350&view=rev
Author: efiring
Date: 2009-08-04 18:09:38 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Fix typo in recent change to contour.py.
(There are still bugs to be found in the change to cntr.c.)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 17:59:44 UTC (rev 7349)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 18:09:38 UTC (rev 7350)
@@ -652,7 +652,7 @@
codes = np.zeros(kind.shape, dtype=mpath.Path.code_type)
codes.fill(mpath.Path.LINETO)
codes[0] = mpath.Path.MOVETO
- codes[kinds >= _cntr._slitkind] = mpath.Path.MOVETO
+ codes[kind >= _cntr._slitkind] = mpath.Path.MOVETO
paths.append(mpath.Path(seg, codes))
return paths
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2009-08-04 17:59:52
|
Revision: 7349
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7349&view=rev
Author: ryanmay
Date: 2009-08-04 17:59:44 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Tweak legend_picking.py demo to change alpha of lines in legend.
Modified Paths:
--------------
trunk/matplotlib/examples/event_handling/legend_picking.py
Modified: trunk/matplotlib/examples/event_handling/legend_picking.py
===================================================================
--- trunk/matplotlib/examples/event_handling/legend_picking.py 2009-08-04 17:18:03 UTC (rev 7348)
+++ trunk/matplotlib/examples/event_handling/legend_picking.py 2009-08-04 17:59:44 UTC (rev 7349)
@@ -33,6 +33,12 @@
origline = lined[legline]
vis = origline.get_visible()
origline.set_visible(not vis)
+ # Change the alpha on the line in the legend so we can see what lines
+ # have been toggled
+ if not vis:
+ legline.set_alpha(1.0)
+ else:
+ legline.set_alpha(0.2)
fig.canvas.draw()
fig.canvas.mpl_connect('pick_event', onpick)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-04 17:18:25
|
Revision: 7348
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7348&view=rev
Author: jdh2358
Date: 2009-08-04 17:18:03 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
clean up legend picking example
Modified Paths:
--------------
trunk/matplotlib/examples/event_handling/legend_picking.py
Modified: trunk/matplotlib/examples/event_handling/legend_picking.py
===================================================================
--- trunk/matplotlib/examples/event_handling/legend_picking.py 2009-08-04 16:48:04 UTC (rev 7347)
+++ trunk/matplotlib/examples/event_handling/legend_picking.py 2009-08-04 17:18:03 UTC (rev 7348)
@@ -10,25 +10,29 @@
fig = plt.figure()
ax = fig.add_subplot(111)
-
-line1, = ax.plot(t, y1, lw=2, color='red', label='1 hz')
-line2, = ax.plot(t, y2, lw=2, color='blue', label='2 hz')
-
+ax.set_title('Click on legend line to toggle line on/off')
+line1, = ax.plot(t, y1, lw=2, color='red', label='1 HZ')
+line2, = ax.plot(t, y2, lw=2, color='blue', label='2 HZ')
leg = ax.legend(loc='upper left', fancybox=True, shadow=True)
leg.get_frame().set_alpha(0.4)
+# we will set up a dict mapping legend line to orig line, and enable
+# picking on the legend line
lines = [line1, line2]
lined = dict()
-for legline, realine in zip(leg.get_lines(), lines):
+for legline, origline in zip(leg.get_lines(), lines):
legline.set_picker(5) # 5 pts tolerance
- lined[legline] = realine
+ lined[legline] = origline
+
def onpick(event):
+ # on the pick event, find the orig line corresponding to the
+ # legend proxy line, and toggle the visibilit
legline = event.artist
- realline = lined[legline]
- vis = realline.get_visible()
- realline.set_visible(not vis)
+ origline = lined[legline]
+ vis = origline.get_visible()
+ origline.set_visible(not vis)
fig.canvas.draw()
fig.canvas.mpl_connect('pick_event', onpick)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-04 16:48:17
|
Revision: 7347
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7347&view=rev
Author: jdh2358
Date: 2009-08-04 16:48:04 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
enabled legend picking
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/legend.py
Added Paths:
-----------
trunk/matplotlib/examples/event_handling/legend_picking.py
Added: trunk/matplotlib/examples/event_handling/legend_picking.py
===================================================================
--- trunk/matplotlib/examples/event_handling/legend_picking.py (rev 0)
+++ trunk/matplotlib/examples/event_handling/legend_picking.py 2009-08-04 16:48:04 UTC (rev 7347)
@@ -0,0 +1,36 @@
+"""
+Enable picking on the legend to toggle the legended line on and off
+"""
+import numpy as np
+import matplotlib.pyplot as plt
+
+t = np.arange(0.0, 0.2, 0.1)
+y1 = 2*np.sin(2*np.pi*t)
+y2 = 4*np.sin(2*np.pi*2*t)
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+line1, = ax.plot(t, y1, lw=2, color='red', label='1 hz')
+line2, = ax.plot(t, y2, lw=2, color='blue', label='2 hz')
+
+leg = ax.legend(loc='upper left', fancybox=True, shadow=True)
+leg.get_frame().set_alpha(0.4)
+
+
+lines = [line1, line2]
+lined = dict()
+for legline, realine in zip(leg.get_lines(), lines):
+ legline.set_picker(5) # 5 pts tolerance
+ lined[legline] = realine
+
+def onpick(event):
+ legline = event.artist
+ realline = lined[legline]
+ vis = realline.get_visible()
+ realline.set_visible(not vis)
+ fig.canvas.draw()
+
+fig.canvas.mpl_connect('pick_event', onpick)
+
+plt.show()
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2009-08-04 13:20:29 UTC (rev 7346)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2009-08-04 16:48:04 UTC (rev 7347)
@@ -177,6 +177,10 @@
propnames=['numpoints', 'markerscale', 'shadow', "columnspacing",
"scatterpoints"]
+ self.texts = []
+ self.legendHandles = []
+ self._legend_title_box = None
+
localdict = locals()
for name in propnames:
@@ -240,6 +244,7 @@
if isinstance(parent,Axes):
self.isaxes = True
+ self.set_axes(parent)
self.set_figure(parent.figure)
elif isinstance(parent,Figure):
self.isaxes = False
@@ -313,10 +318,8 @@
set the boilerplate props for artists added to axes
"""
a.set_figure(self.figure)
-
- for c in self.get_children():
- c.set_figure(self.figure)
-
+ if self.isaxes:
+ a.set_axes(self.axes)
a.set_transform(self.get_transform())
@@ -432,6 +435,7 @@
textbox = TextArea(l, textprops=label_prop,
multilinebaseline=True, minimumdescent=True)
text_list.append(textbox._text)
+
labelboxes.append(textbox)
handleboxes = []
@@ -688,6 +692,13 @@
children = []
if self._legend_box:
children.append(self._legend_box)
+ children.extend(self.get_lines())
+ children.extend(self.get_patches())
+ children.extend(self.get_texts())
+ children.append(self.get_frame())
+
+ if self._legend_title_box:
+ children.append(self.get_title())
return children
def get_frame(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-04 13:20:40
|
Revision: 7346
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7346&view=rev
Author: jdh2358
Date: 2009-08-04 13:20:29 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Merged revisions 7323-7326,7328-7331,7334-7337,7343 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7323 | jdh2358 | 2009-07-31 10:32:11 -0500 (Fri, 31 Jul 2009) | 2 lines
apply sf patches 2830233 and 2823885 for osx setup and 64 bit; thanks Michiel
........
r7324 | jdh2358 | 2009-07-31 10:39:30 -0500 (Fri, 31 Jul 2009) | 1 line
revert setupext.py patch for osx; breaks my osx test build
........
r7325 | jdh2358 | 2009-07-31 10:52:19 -0500 (Fri, 31 Jul 2009) | 1 line
added miktex win32 patch from sf patch 2820194
........
r7326 | jdh2358 | 2009-07-31 13:11:50 -0500 (Fri, 31 Jul 2009) | 1 line
update the makefile for win32 build
........
r7328 | jdh2358 | 2009-08-01 12:37:26 -0500 (Sat, 01 Aug 2009) | 1 line
Applied Michiel's sf patch 2823885 to remove the /usr/X11R6 dirs from darwin
........
r7329 | jdh2358 | 2009-08-01 14:11:58 -0500 (Sat, 01 Aug 2009) | 1 line
some fixes for the binary builds
........
r7330 | jdh2358 | 2009-08-01 14:27:43 -0500 (Sat, 01 Aug 2009) | 1 line
more fixes for osx
........
r7331 | jdh2358 | 2009-08-01 14:34:05 -0500 (Sat, 01 Aug 2009) | 1 line
update the readme with build requirements
........
r7334 | jdh2358 | 2009-08-03 11:38:25 -0500 (Mon, 03 Aug 2009) | 1 line
handled sf bugs 2831556 and 2830525; better bar error messages and backend driver configs
........
r7335 | jdh2358 | 2009-08-03 12:19:42 -0500 (Mon, 03 Aug 2009) | 1 line
added two examples from Josh Hemann
........
r7336 | jdh2358 | 2009-08-03 12:40:17 -0500 (Mon, 03 Aug 2009) | 1 line
fixed rec2csv win32 file handle bug from sf patch 2831018
........
r7337 | jdh2358 | 2009-08-03 14:31:05 -0500 (Mon, 03 Aug 2009) | 1 line
removed a couple of cases of mlab.load
........
r7343 | jdh2358 | 2009-08-04 06:50:09 -0500 (Tue, 04 Aug 2009) | 1 line
applied sf patch 2815064 (middle button events for wx) and patch 2818092 (resize events for wx)
........
Modified Paths:
--------------
trunk/matplotlib/doc/_templates/index.html
trunk/matplotlib/doc/_templates/indexsidebar.html
trunk/matplotlib/doc/api/spine_api.rst
trunk/matplotlib/doc/faq/installing_faq.rst
trunk/matplotlib/doc/pyplots/plotmap.py
trunk/matplotlib/doc/users/installing.rst
trunk/matplotlib/examples/pylab_examples/load_converter.py
trunk/matplotlib/examples/tests/backend_driver.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
trunk/matplotlib/lib/matplotlib/mlab.py
trunk/matplotlib/lib/matplotlib/texmanager.py
trunk/matplotlib/release/osx/Makefile
trunk/matplotlib/release/osx/README.txt
trunk/matplotlib/release/win32/Makefile
trunk/matplotlib/setupext.py
trunk/matplotlib/src/_macosx.m
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/barchart_demo2.py
trunk/matplotlib/examples/pylab_examples/boxplot_demo2.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7318,7338
+ /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7345
Modified: trunk/matplotlib/doc/_templates/index.html
===================================================================
--- trunk/matplotlib/doc/_templates/index.html 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/doc/_templates/index.html 2009-08-04 13:20:29 UTC (rev 7346)
@@ -3,7 +3,7 @@
{% block body %}
- <h1>Welcome</h1>
+ <h1>mpl</h1>
<p>matplotlib is a python 2D plotting library which produces
publication quality figures in a variety of hardcopy formats and
Modified: trunk/matplotlib/doc/_templates/indexsidebar.html
===================================================================
--- trunk/matplotlib/doc/_templates/indexsidebar.html 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/doc/_templates/indexsidebar.html 2009-08-04 13:20:29 UTC (rev 7346)
@@ -4,11 +4,14 @@
<p>Please <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donate</a>
to support matplotlib development.</p>
+<p>A release candidate rc1 of matplotlib-0.99.0 is <a href="http://drop.io/xortel1#">available</a> for testing. Please post any bugs to the <a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>
+</p>
<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>.
</p>
<h3>Download</h3>
+
<p>Current version: <b>{{ version }}</b></p>
Modified: trunk/matplotlib/doc/api/spine_api.rst
===================================================================
--- trunk/matplotlib/doc/api/spine_api.rst 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/doc/api/spine_api.rst 2009-08-04 13:20:29 UTC (rev 7346)
@@ -4,7 +4,7 @@
:mod:`matplotlib.spine`
-======================
+========================
.. automodule:: matplotlib.spine
:members:
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/doc/faq/installing_faq.rst 2009-08-04 13:20:29 UTC (rev 7346)
@@ -287,11 +287,66 @@
<http://www.python.org/download/>`_.
+.. _install_osx_binaries:
+
+Installing OSX binaries
+-----------------------
+
+If you want to install matplotlib from one of the binary installers we
+build, you have two choices: a mpkg installer, which is a typical
+Installer.app, or an binary OSX egg, which you can install via
+setuptools easy_install.
+
+The mkpg installer will have a "zip" extension, and will have a name
+like file:`matplotlib-0.99.0.rc1-py2.5-macosx10.5_mpkg.zip` depending on
+the python, matplotlib, and OSX versions. You need to unzip this file
+using either the "unzip" command on OSX, or simply double clicking on
+it to run StuffIt Expander. When you double click on the resultant
+mpkd directory, which will have a name like
+file:`matplotlib-0.99.0.rc1-py2.5-macosx10.5.mpkg`, it will run the
+Installer.app, prompt you for a password if you need system wide
+installation privileges, and install to a directory like
+file:`/Library/Python/2.5/site-packages/`, again depedending on your
+python version. This directory may not be in your python path, so you
+can test your installation with::
+
+ > python -c 'import matplotlib; print matplotlib.__version__, matplotlib.__file__'
+
+If you get an error like::
+
+ Traceback (most recent call last):
+ File "<string>", line 1, in <module>
+ ImportError: No module named matplotlib
+
+then you will need to set your PYTHONPATH, eg::
+
+ export PYTHONPATH=/Library/Python/2.5/site-packages:$PYTHONPATH
+
+See also ref:`environment-variables`.
+
.. _easy-install-osx-egg:
-easy_install from egg?
+easy_install from egg
------------------------------
+You can also us the eggs we build for OSX (see the `installation
+instructions
+<http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other>`_
+for easy_install if you do not have it on your system already). You
+can try::
+
+ > easy_install matplotlib
+
+which should grab the latest egg from the sourceforge site, but the
+naming conventions for OSX eggs appear to be broken (see below) so
+there is no guarantee the right egg will be found. We recommend you
+download the latest egg from our `download site
+<http://sourceforge.net/projects/matplotlib/files/>`_ directly to your
+harddrive, and manually install it with
+
+ > easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg
+
+
Some users have reported problems with the egg for 0.98 from the
matplotlib download site, with ``easy_install``, getting an error::
Modified: trunk/matplotlib/doc/pyplots/plotmap.py
===================================================================
--- trunk/matplotlib/doc/pyplots/plotmap.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/doc/pyplots/plotmap.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -5,7 +5,9 @@
# the data is interpolated to the native projection grid.
import os
from mpl_toolkits.basemap import Basemap, shiftgrid
-from pylab import title, colorbar, show, axes, cm, load, arange, figure, \
+import numpy as np
+
+from pylab import title, colorbar, show, axes, cm, arange, figure, \
text
# read in topo data (on a regular lat/lon grid)
@@ -15,9 +17,9 @@
if not os.path.exists(datadir):
raise SystemExit('You need to download the data with svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/htdocs/screenshots/data/" and set the datadir variable in %s'%__file__)
-topoin = load(os.path.join(datadir, 'etopo20data.gz'))
-lons = load(os.path.join(datadir, 'etopo20lons.gz'))
-lats = load(os.path.join(datadir, 'etopo20lats.gz'))
+topoin = np.loadtxt(os.path.join(datadir, 'etopo20data.gz'))
+lons = np.loadtxt(os.path.join(datadir, 'etopo20lons.gz'))
+lats = np.loadtxt(os.path.join(datadir, 'etopo20lats.gz'))
# shift data so lons go from -180 to 180 instead of 20 to 380.
topoin,lons = shiftgrid(180.,topoin,lons,start=False)
Modified: trunk/matplotlib/doc/users/installing.rst
===================================================================
--- trunk/matplotlib/doc/users/installing.rst 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/doc/users/installing.rst 2009-08-04 13:20:29 UTC (rev 7346)
@@ -63,14 +63,17 @@
And a *voila*, a figure pops up. But we are putting the cart ahead of
the horse -- first we need to get matplotlib installed. We provide
prebuilt binaries for OS X and Windows on the matplotlib `download
-<http://sourceforge.net/project/showfiles.php?group_id=80706>`_ page.
-Click on the latest release of the "matplotlib" package, choose your
-python version (2.4 or 2.5) and your platform (macosx or win32) and
-you should be good to go. If you have any problems, please check the
+<http://sourceforge.net/projects/matplotlib/files/>`_ page. Click on
+the latest release of the "matplotlib" package, choose your python
+version (2.4 or 2.5) and your platform (macosx or win32) and you
+should be good to go. If you have any problems, please check the
:ref:`installing-faq`, google around a little bit, and post a question
the `mailing list
<http://sourceforge.net/project/showfiles.php?group_id=80706>`_.
+Instructions for installing our OSX binaries are found in the FAQ
+ref:`install_osx_binaries`.
+
Note that when testing matplotlib installations from the interactive
python console, there are some issues relating to user interface
toolkits and interactive settings that are discussed in
@@ -114,7 +117,8 @@
These are external packages which you will need to install before
installing matplotlib. Windows users only need the first two (python
and numpy) since the others are built into the matplotlib windows
-installers available for download at the sourceforge site.
+installers available for download at the sourceforge site. If you are
+building on OSX, see :ref:`build_osx`
:term:`python` 2.4 (or later but not python3)
matplotlib requires python 2.4 or later (`download <http://www.python.org/download/>`__)
@@ -183,3 +187,19 @@
+.. _build_osx:
+
+Building on OSX
+==================
+
+The build situation on OSX is complicated by the various places one
+can get the png and freetype requirements from (darwinports, fink,
+/usr/X11R6) and the different architectures (x86, ppc, universal) and
+the different OSX version (10.4 and 10.5). We recommend that you build
+the way we do for the OSX release: by grabbing the tarbar or svn
+repository, cd-ing into the release/osx dir, and following the
+instruction in the README. This directory has a Makefile which will
+automatically grab the zlib, png and freetype dependencies from the
+web, build them with the right flags to make universal libraries, and
+then build the matplotlib source and binary installers.
+
\ No newline at end of file
Copied: trunk/matplotlib/examples/pylab_examples/barchart_demo2.py (from rev 7337, branches/v0_99_maint/examples/pylab_examples/barchart_demo2.py)
===================================================================
--- trunk/matplotlib/examples/pylab_examples/barchart_demo2.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/barchart_demo2.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -0,0 +1,107 @@
+"""
+Thanks Josh Hemann for the example
+
+This examples comes from an application in which grade school gym
+teachers wanted to be able to show parents how their child did across
+a handful of fitness tests, and importantly, relative to how other
+children did. To extract the plotting code for demo purposes, we'll
+just make up some data for little Johnny Doe...
+
+"""
+import numpy as np
+import matplotlib.pyplot as plt
+import pylab
+from matplotlib.patches import Polygon
+from matplotlib.ticker import MaxNLocator
+
+
+
+student = 'Johnny Doe'
+grade = 2
+gender = 'boy'
+cohortSize = 62 #The number of other 2nd grade boys
+
+numTests = 5
+testNames = ['Pacer Test', 'Flexed Arm\n Hang', 'Mile Run', 'Agility',
+ 'Push Ups']
+testMeta = ['laps', 'sec', 'min:sec', 'sec', '']
+scores = ['7', '48', '12:52', '17', '14']
+rankings = np.round(np.random.uniform(0, 1, numTests)*100, 0)
+
+fig = plt.figure(figsize=(9,7))
+ax1 = fig.add_subplot(111)
+plt.subplots_adjust(left=0.115, right=0.88)
+fig.canvas.set_window_title('Eldorado K-8 Fitness Chart')
+pos = np.arange(numTests)+0.5 #Center bars on the Y-axis ticks
+rects = ax1.barh(pos, rankings, align='center', height=0.5, color='m')
+
+ax1.axis([0,100,0,5])
+pylab.yticks(pos, testNames)
+ax1.set_title('Johnny Doe')
+plt.text(50, -0.5, 'Cohort Size: ' + str(cohortSize),
+ horizontalalignment='center', size='small')
+
+# Set the right-hand Y-axis ticks and labels and set X-axis tick marks at the
+# deciles
+ax2 = ax1.twinx()
+ax2.plot([100,100], [0, 5], 'white', alpha=0.1)
+ax2.xaxis.set_major_locator(MaxNLocator(11))
+xticks = pylab.setp(ax2, xticklabels=['0','10','20','30','40','50','60',
+'70',
+ '80','90','100'])
+ax2.xaxis.grid(True, linestyle='--', which='major', color='grey',
+alpha=0.25)
+#Plot a solid vertical gridline to highlight the median position
+plt.plot([50,50], [0, 5], 'grey', alpha=0.25)
+
+# Build up the score labels for the right Y-axis by first appending a carriage
+# return to each string and then tacking on the appropriate meta information
+# (i.e., 'laps' vs 'seconds'). We want the labels centered on the ticks, so if
+# there is no meta info (like for pushups) then don't add the carriage return to
+# the string
+
+def withnew(i, scr):
+ if testMeta[i] != '' : return '%s\n'%scr
+ else: return scr
+scoreLabels = [withnew(i, scr) for i,scr in enumerate(scores)]
+scoreLabels = [i+j for i,j in zip(scoreLabels, testMeta)]
+pylab.yticks(pos, scoreLabels)
+ax2.set_ylabel('Test Scores')
+#Make list of numerical suffixes corresponding to position in a list
+# 0 1 2 3 4 5 6 7 8 9
+suffixes =['th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th']
+ax2.set_xlabel('Percentile Ranking Across ' + str(grade) + suffixes[grade] \
+ + ' Grade ' + gender.title() + 's')
+
+# Lastly, write in the ranking inside each bar to aid in interpretation
+for rect in rects:
+ # Rectangle widths are already integer-valued but are floating
+ # type, so it helps to remove the trailing decimal point and 0 by
+ # converting width to int type
+ width = int(rect.get_width())
+
+ # Figure out what the last digit (width modulo 10) so we can add
+ # the appropriate numerical suffix (e.g. 1st, 2nd, 3rd, etc)
+ lastDigit = width % 10
+ # Note that 11, 12, and 13 are special cases
+ if (width == 11) or (width == 12) or (width == 13):
+ suffix = 'th'
+ else:
+ suffix = suffixes[lastDigit]
+
+ rankStr = str(width) + suffix
+ if (width < 5): # The bars aren't wide enough to print the ranking inside
+ xloc = width + 1 # Shift the text to the right side of the right edge
+ clr = 'black' # Black against white background
+ align = 'left'
+ else:
+ xloc = 0.98*width # Shift the text to the left side of the right edge
+ clr = 'white' # White on magenta
+ align = 'right'
+
+ yloc = rect.get_y()+rect.get_height()/2.0 #Center the text vertically in the bar
+ ax1.text(xloc, yloc, rankStr, horizontalalignment=align,
+ verticalalignment='center', color=clr, weight='bold')
+
+plt.show()
+
Copied: trunk/matplotlib/examples/pylab_examples/boxplot_demo2.py (from rev 7337, branches/v0_99_maint/examples/pylab_examples/boxplot_demo2.py)
===================================================================
--- trunk/matplotlib/examples/pylab_examples/boxplot_demo2.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/boxplot_demo2.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -0,0 +1,121 @@
+"""
+Thanks Josh Hemann for the example
+"""
+
+import numpy as np
+import matplotlib.pyplot as plt
+from matplotlib.patches import Polygon
+
+
+# Generate some data from five different probability distributions,
+# each with different characteristics. We want to play with how an IID
+# bootstrap resample of the data preserves the distributional
+# properties of the original sample, and a boxplot is one visual tool
+# to make this assessment
+numDists = 5
+randomDists = ['Normal(1,1)',' Lognormal(1,1)', 'Exp(1)', 'Gumbel(6,4)',
+ 'Triangular(2,9,11)']
+N = 500
+norm = np.random.normal(1,1, N)
+logn = np.random.lognormal(1,1, N)
+expo = np.random.exponential(1, N)
+gumb = np.random.gumbel(6, 4, N)
+tria = np.random.triangular(2, 9, 11, N)
+
+# Generate some random indices that we'll use to resample the original data
+# arrays. For code brevity, just use the same random indices for each array
+bootstrapIndices = np.random.random_integers(0, N-1, N)
+normBoot = norm[bootstrapIndices]
+expoBoot = expo[bootstrapIndices]
+gumbBoot = gumb[bootstrapIndices]
+lognBoot = logn[bootstrapIndices]
+triaBoot = tria[bootstrapIndices]
+
+data = [norm, normBoot, logn, lognBoot, expo, expoBoot, gumb, gumbBoot,
+ tria, triaBoot]
+
+fig = plt.figure(figsize=(10,6))
+fig.canvas.set_window_title('A Boxplot Example')
+ax1 = fig.add_subplot(111)
+plt.subplots_adjust(left=0.075, right=0.95, top=0.9, bottom=0.25)
+
+bp = plt.boxplot(data, notch=0, sym='+', vert=1, whis=1.5)
+plt.setp(bp['boxes'], color='black')
+plt.setp(bp['whiskers'], color='black')
+plt.setp(bp['fliers'], color='red', marker='+')
+
+# Add a horizontal grid to the plot, but make it very light in color
+# so we can use it for reading data values but not be distracting
+ax1.yaxis.grid(True, linestyle='-', which='major', color='lightgrey',
+ alpha=0.5)
+
+# Hide these grid behind plot objects
+ax1.set_axisbelow(True)
+ax1.set_title('Comparison of IID Bootstrap Resampling Across Five Distributions')
+ax1.set_xlabel('Distribution')
+ax1.set_ylabel('Value')
+
+# Now fill the boxes with desired colors
+boxColors = ['darkkhaki','royalblue']
+numBoxes = numDists*2
+medians = range(numBoxes)
+for i in range(numBoxes):
+ box = bp['boxes'][i]
+ boxX = []
+ boxY = []
+ for j in range(5):
+ boxX.append(box.get_xdata()[j])
+ boxY.append(box.get_ydata()[j])
+ boxCoords = zip(boxX,boxY)
+ # Alternate between Dark Khaki and Royal Blue
+ k = i % 2
+ boxPolygon = Polygon(boxCoords, facecolor=boxColors[k])
+ ax1.add_patch(boxPolygon)
+ # Now draw the median lines back over what we just filled in
+ med = bp['medians'][i]
+ medianX = []
+ medianY = []
+ for j in range(2):
+ medianX.append(med.get_xdata()[j])
+ medianY.append(med.get_ydata()[j])
+ plt.plot(medianX, medianY, 'k')
+ medians[i] = medianY[0]
+ # Finally, overplot the sample averages, with horixzontal alignment
+ # in the center of each box
+ plt.plot([np.average(med.get_xdata())], [np.average(data[i])],
+ color='w', marker='*', markeredgecolor='k')
+
+# Set the axes ranges and axes labels
+ax1.set_xlim(0.5, numBoxes+0.5)
+top = 40
+bottom = -5
+ax1.set_ylim(bottom, top)
+xtickNames = plt.setp(ax1, xticklabels=np.repeat(randomDists, 2))
+plt.setp(xtickNames, rotation=45, fontsize=8)
+
+# Due to the Y-axis scale being different across samples, it can be
+# hard to compare differences in medians across the samples. Add upper
+# X-axis tick labels with the sample medians to aid in comparison
+# (just use two decimal places of precision)
+pos = np.arange(numBoxes)+1
+upperLabels = [str(np.round(s, 2)) for s in medians]
+weights = ['bold', 'semibold']
+for tick,label in zip(range(numBoxes),ax1.get_xticklabels()):
+ k = tick % 2
+ ax1.text(pos[tick], top-(top*0.05), upperLabels[tick],
+ horizontalalignment='center', size='x-small', weight=weights[k],
+ color=boxColors[k])
+
+# Finally, add a basic legend
+plt.figtext(0.80, 0.08, str(N) + ' Random Numbers' ,
+ backgroundcolor=boxColors[0], color='black', weight='roman',
+ size='x-small')
+plt.figtext(0.80, 0.045, 'IID Bootstrap Resample',
+backgroundcolor=boxColors[1],
+ color='white', weight='roman', size='x-small')
+plt.figtext(0.80, 0.015, '*', color='white', backgroundcolor='silver',
+ weight='roman', size='medium')
+plt.figtext(0.815, 0.013, ' Average Value', color='black', weight='roman',
+ size='x-small')
+
+plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/load_converter.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/load_converter.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/examples/pylab_examples/load_converter.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -1,8 +1,9 @@
from matplotlib.dates import strpdate2num
-from matplotlib.mlab import load
+#from matplotlib.mlab import load
+import numpy as np
from pylab import figure, show
-dates, closes = load(
+dates, closes = np.loadtxt(
'../data/msft.csv', delimiter=',',
converters={0:strpdate2num('%d-%b-%y')},
skiprows=1, usecols=(0,2), unpack=True)
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -373,7 +373,7 @@
if backend in rcsetup.interactive_bk:
tmpfile.write('show()')
else:
- tmpfile.write('\nsavefig("%s", dpi=150)' % outfile)
+ tmpfile.write('\nsavefig(r"%s", dpi=150)' % outfile)
tmpfile.close()
start_time = time.time()
@@ -457,7 +457,7 @@
python = ['valgrind', '--tool=memcheck', '--leak-check=yes',
'--log-file=%(name)s', 'python']
elif sys.platform == 'win32':
- python = [r'c:\Python24\python.exe']
+ python = [sys.executable]
else:
python = ['python']
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -4229,20 +4229,20 @@
# FIXME: convert the following to proper input validation
# raising ValueError; don't use assert for this.
- assert len(left)==nbars, "argument 'left' must be %d or scalar" % nbars
- assert len(height)==nbars, ("argument 'height' must be %d or scalar" %
+ assert len(left)==nbars, "incompatible sizes: argument 'left' must be length %d or scalar" % nbars
+ assert len(height)==nbars, ("incompatible sizes: argument 'height' must be length %d or scalar" %
nbars)
- assert len(width)==nbars, ("argument 'width' must be %d or scalar" %
+ assert len(width)==nbars, ("incompatible sizes: argument 'width' must be length %d or scalar" %
nbars)
- assert len(bottom)==nbars, ("argument 'bottom' must be %d or scalar" %
+ assert len(bottom)==nbars, ("incompatible sizes: argument 'bottom' must be length %d or scalar" %
nbars)
if yerr is not None and len(yerr)!=nbars:
raise ValueError(
- "bar() argument 'yerr' must be len(%s) or scalar" % nbars)
+ "incompatible sizes: bar() argument 'yerr' must be len(%s) or scalar" % nbars)
if xerr is not None and len(xerr)!=nbars:
raise ValueError(
- "bar() argument 'xerr' must be len(%s) or scalar" % nbars)
+ "incompatible sizes: bar() argument 'xerr' must be len(%s) or scalar" % nbars)
patches = []
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -772,6 +772,11 @@
bind(self, wx.EVT_LEAVE_WINDOW, self._onLeave)
bind(self, wx.EVT_ENTER_WINDOW, self._onEnter)
bind(self, wx.EVT_IDLE, self._onIdle)
+ #Add middle button events
+ bind(self, wx.EVT_MIDDLE_DOWN, self._onMiddleButtonDown)
+ bind(self, wx.EVT_MIDDLE_DCLICK, self._onMiddleButtonDown)
+ bind(self, wx.EVT_MIDDLE_UP, self._onMiddleButtonUp)
+
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
self.macros = {} # dict from wx id to seq of macros
@@ -1183,6 +1188,7 @@
# so no need to do anything here except to make sure
# the whole background is repainted.
self.Refresh(eraseBackground=False)
+ FigureCanvasBase.resize_event(self)
def _get_key(self, evt):
@@ -1251,6 +1257,24 @@
if self.HasCapture(): self.ReleaseMouse()
FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt)
+ #Add middle button events
+ def _onMiddleButtonDown(self, evt):
+ """Start measuring on an axis."""
+ x = evt.GetX()
+ y = self.figure.bbox.height - evt.GetY()
+ evt.Skip()
+ self.CaptureMouse()
+ FigureCanvasBase.button_press_event(self, x, y, 2, guiEvent=evt)
+
+ def _onMiddleButtonUp(self, evt):
+ """End measuring on an axis."""
+ x = evt.GetX()
+ y = self.figure.bbox.height - evt.GetY()
+ #print 'release button', 1
+ evt.Skip()
+ if self.HasCapture(): self.ReleaseMouse()
+ FigureCanvasBase.button_release_event(self, x, y, 2, guiEvent=evt)
+
def _onMouseWheel(self, evt):
"""Translate mouse wheel events into matplotlib events"""
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -2595,7 +2595,7 @@
for i, name in enumerate(r.dtype.names):
funcs.append(with_mask(csvformat_factory(formatd[name]).tostr))
- fh, opened = cbook.to_filehandle(fname, 'w', return_opened=True)
+ fh, opened = cbook.to_filehandle(fname, 'wb', return_opened=True)
writer = csv.writer(fh, delimiter=delimiter)
header = r.dtype.names
if withheader:
Modified: trunk/matplotlib/lib/matplotlib/texmanager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/texmanager.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/lib/matplotlib/texmanager.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -56,7 +56,7 @@
def dvipng_hack_alpha():
p = Popen('dvipng -version', shell=True, stdin=PIPE, stdout=PIPE,
- stderr=STDOUT, close_fds=True)
+ stderr=STDOUT, close_fds=(sys.platform!='win32'))
stdin, stdout = p.stdin, p.stdout
for line in stdout:
if line.startswith('dvipng '):
Modified: trunk/matplotlib/release/osx/Makefile
===================================================================
--- trunk/matplotlib/release/osx/Makefile 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/release/osx/Makefile 2009-08-04 13:20:29 UTC (rev 7346)
@@ -1,3 +1,5 @@
+PYVERSION=2.6
+PYTHON=python${PYVERSION}
SRCDIR=${PWD}
ZLIBVERSION=1.2.3
PNGVERSION=1.2.33
@@ -2,3 +4,4 @@
FREETYPEVERSION=2.3.7
-MPLVERSION=0.98.5.3
+MPLVERSION=0.99.0.rc1
+BDISTMPKGVERSION=0.4.4
MPLSRC=matplotlib-${MPLVERSION}
@@ -20,8 +23,8 @@
clean:
rm -rf zlib-${ZLIBVERSION}.tar.gz libpng-${PNGVERSION}.tar.bz2 \
- freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-0.4.3.tar.gz \
- bdist_mpkg-0.4.3 \
+ freetype-${FREETYPEVERSION}.tar.bz2 bdist_mpkg-${BDISTMPKGVERSION}.tar.gz \
+ bdist_mpkg-${BDISTMPKGVERSION} \
zlib-${ZLIBVERSION} libpng-${PNGVERSION} freetype-${FREETYPEVERSION} \
matplotlib-${MPLVERSION} *~
@@ -29,10 +32,9 @@
wget http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz &&\
wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2 &&\
wget http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2&&\
- wget http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-0.4.3.tar.gz&&\
- tar xvfz bdist_mpkg-0.4.3.tar.gz &&\
- patch -p0 < data/bdist.patch
- echo "You need to to install bdist_mpkg-0.4.3 now"
+ wget http://pypi.python.org/packages/source/b/bdist_mpkg/bdist_mpkg-${BDISTMPKGVERSION}.tar.gz&&\
+ tar xvfz bdist_mpkg-${BDISTMPKGVERSION}.tar.gz &&\
+ echo "You need to to install bdist_mpkg-${BDISTMPKGVERSION} now"
@@ -87,16 +89,16 @@
export CFLAGS=${CFLAGS} &&\
export LDFLAGS=${LDFLAGS} &&\
bdist_mpkg &&\
- python setupegg.py bdist_egg &&\
+ ${PYTHON} setupegg.py bdist_egg &&\
cd dist && \
- zip -ro matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip matplotlib-${MPLVERSION}-py2.5-macosx10.5.mpkg
+ zip -ro matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5_mpkg.zip matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.mpkg
upload:
rm -rf upload &&\
mkdir upload &&\
cp matplotlib-${MPLVERSION}.tar.gz upload/ &&\
- cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-macosx-py2.5.egg &&\
- cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py2.5-mpkg.zip&&\
+ cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py${PYVERSION}-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-macosx-py${PYVERSION}.egg &&\
+ cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py${PYVERSION}-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py${PYVERSION}-mpkg.zip&&\
scp upload/* jd...@fr...:uploads/
all:
Modified: trunk/matplotlib/release/osx/README.txt
===================================================================
--- trunk/matplotlib/release/osx/README.txt 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/release/osx/README.txt 2009-08-04 13:20:29 UTC (rev 7346)
@@ -7,9 +7,7 @@
-------------
* :file:`bdist_mkpg` - the distutils.extension to build Installer.app
- mpkg installers. It is patched from the tarball with
- file:`data/bdist.patch` because 0.4.3 is broken on OS X 10.5.
- Instructions on how to patch and install are below
+ mpkg installers.
* :file:`data` - some config files and patches needed for the build
@@ -21,6 +19,16 @@
How to build
--------------
+* You need a python framework build , numpy and wxpython to build the
+ mpl installers (wx requires this and we need wx to build the wxagg
+ extension). You can get the three required dependencies as
+ Installer apps, eg:
+
+
+ http://www.python.org/ftp/python/2.6.2/python-2.6.2-macosx2009-04-16.dmg
+ http://downloads.sourceforge.net/project/numpy/NumPy/1.3.0/numpy-1.3.0-py2.6-macosx10.5.dmg?use_mirror=voxel
+ http://downloads.sourceforge.net/project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?use_mirror=voxel
+
* You need to make sure to unset PKG_CONFIG_PATH to make sure the
static linking below is respected. Otherwise the mpl build script
will dynamically link using the libs from pkgconfig if you have this
@@ -38,7 +46,7 @@
* install the patched bdist_mpkg, that the fetch_deps step just created::
- cd bdist_mpkg-0.4.3
+ cd bdist_mpkg-0.4.4
sudo python setup.py install
* build the dependencies::
@@ -64,7 +72,7 @@
cd release/osx/
unset PKG_CONFIG_PATH
make fetch_deps
- cd bdist_mpkg-0.4.3
+ cd bdist_mpkg-0.4.4
sudo python setup.py install
cd ..
make dependencies
Modified: trunk/matplotlib/release/win32/Makefile
===================================================================
--- trunk/matplotlib/release/win32/Makefile 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/release/win32/Makefile 2009-08-04 13:20:29 UTC (rev 7346)
@@ -1,4 +1,4 @@
-PYDIR = C:/Python26
+PYDIR = C:/Python25
PYTHON = ${PYDIR}/python.exe
SRCDIR = ${PWD}
WINSRCDIR = `${PWD}/data/mingw_path.sh ${PWD}`
@@ -6,7 +6,7 @@
PNGVERSION = 1.2.36
FREETYPEVERSION = 2.3.9
TCLTKVERSION = 8.5.7
-MPLVERSION = 0.98.5.3
+MPLVERSION = 0.99.0.rc1
## You shouldn't need to configure past this point
@@ -89,8 +89,8 @@
rm -rf build &&\
cp ../data/setup*.* . &&\
export CFLAGS="${CFLAGS}" &&\
- ${PYTHON} setupwin.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_wininst
- #${PYTHON} setupwinegg.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_egg
+ ${PYTHON} setupwin.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_wininst &&\
+ ${PYTHON} setupwinegg.py build_ext -c mingw32 -I ${PY_INCLUDE} -L ${PY_LINKER} bdist_egg
inplace:
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/setupext.py 2009-08-04 13:20:29 UTC (rev 7346)
@@ -51,7 +51,7 @@
'linux' : ['/usr/local', '/usr',],
'cygwin' : ['/usr/local', '/usr',],
'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local',
- '/usr', '/sw', '/usr/X11R6'],
+ '/usr', '/sw'],
'freebsd4' : ['/usr/local', '/usr'],
'freebsd5' : ['/usr/local', '/usr'],
'freebsd6' : ['/usr/local', '/usr'],
@@ -174,7 +174,7 @@
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
- close_fds=True)
+ close_fds=(sys.platform != 'win32'))
return p.stdin, p.stdout
class CleanUpFile:
@@ -458,7 +458,7 @@
try:
stdin, stdout = run_child_process('latex -version')
line = stdout.readlines()[0]
- pattern = '3\.1\d+'
+ pattern = '(3\.1\d+)|(MiKTeX \d+.\d+)'
match = re.search(pattern, line)
print_status("latex", match.group(0))
return True
Modified: trunk/matplotlib/src/_macosx.m
===================================================================
--- trunk/matplotlib/src/_macosx.m 2009-08-04 13:15:14 UTC (rev 7345)
+++ trunk/matplotlib/src/_macosx.m 2009-08-04 13:20:29 UTC (rev 7346)
@@ -7,15 +7,19 @@
static int nwin = 0; /* The number of open windows */
+
+/* Use Atsui for Mac OS X 10.4, CoreText for Mac OS X 10.5 */
+#ifndef MAC_OS_X_VERSION_10_5
static int ngc = 0; /* The number of graphics contexts in use */
/* For drawing Unicode strings with ATSUI */
static ATSUStyle style = NULL;
static ATSUTextLayout layout = NULL;
+#endif
/* CGFloat was defined in Mac OS X 10.5 */
-#ifndef CGFloat
+#ifndef CGFLOAT_DEFINED
#define CGFloat float
#endif
@@ -171,6 +175,7 @@
return 1;
}
+#ifndef MAC_OS_X_VERSION_10_5
static int _init_atsui(void)
{
OSStatus status;
@@ -208,6 +213,7 @@
if (status!=noErr)
PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeTextLayout failed", 1);
}
+#endif
static int _draw_path(CGContextRef cr, void* iterator)
{
@@ -336,6 +342,10 @@
- (void)mouseUp:(NSEvent*)event;
- (void)mouseDragged:(NSEvent*)event;
- (void)mouseMoved:(NSEvent*)event;
+- (void)rightMouseDown:(NSEvent*)event;
+- (void)rightMouseUp:(NSEvent*)event;
+- (void)otherMouseDown:(NSEvent*)event;
+- (void)otherMouseUp:(NSEvent*)event;
- (void)setRubberband:(NSRect)rect;
- (void)removeRubberband;
- (const char*)convertKeyEvent:(NSEvent*)event;
@@ -375,6 +385,7 @@
CGContextRef cr;
NSSize size;
int level;
+ CGFloat color[4];
} GraphicsContext;
static CGMutablePathRef _create_path(void* iterator)
@@ -440,6 +451,7 @@
self->cr = NULL;
self->level = 0;
+#ifndef MAC_OS_X_VERSION_10_5
if (ngc==0)
{
int ok = _init_atsui();
@@ -449,10 +461,12 @@
}
}
ngc++;
+#endif
return (PyObject*) self;
}
+#ifndef MAC_OS_X_VERSION_10_5
static void
GraphicsContext_dealloc(GraphicsContext *self)
{
@@ -461,6 +475,7 @@
self->ob_type->tp_free((PyObject*)self);
}
+#endif
static PyObject*
GraphicsContext_repr(GraphicsContext* self)
@@ -516,6 +531,9 @@
return NULL;
}
CGContextSetAlpha(cr, alpha);
+
+ self->color[3] = alpha;
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -651,7 +669,7 @@
static BOOL
_set_dashes(CGContextRef cr, PyObject* linestyle)
{
- float phase = 0.0;
+ CGFloat phase = 0.0;
PyObject* offset;
PyObject* dashes;
@@ -686,7 +704,7 @@
}
int n = PyTuple_GET_SIZE(dashes);
int i;
- float* lengths = malloc(n*sizeof(float));
+ CGFloat* lengths = malloc(n*sizeof(CGFloat));
if(!lengths)
{
PyErr_SetString(PyExc_MemoryError, "Failed to store dashes");
@@ -697,9 +715,9 @@
{
PyObject* value = PyTuple_GET_ITEM(dashes, i);
if (PyFloat_Check(value))
- lengths[i] = (float) PyFloat_AS_DOUBLE(value);
+ lengths[i] = (CGFloat) PyFloat_AS_DOUBLE(value);
else if (PyInt_Check(value))
- lengths[i] = (float) PyInt_AS_LONG(value);
+ lengths[i] = (CGFloat) PyInt_AS_LONG(value);
else break;
}
Py_DECREF(dashes);
@@ -750,6 +768,11 @@
CGContextSetRGBStrokeColor(cr, r, g, b, 1.0);
CGContextSetRGBFillColor(cr, r, g, b, 1.0);
+
+ self->color[0] = r;
+ self->color[1] = g;
+ self->color[2] = b;
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -889,28 +912,12 @@
}
else
{
- int ok;
- float color[4] = {0, 0, 0, 1};
CGPatternRef pattern;
CGColorSpaceRef baseSpace;
CGColorSpaceRef patternSpace;
static const CGPatternCallbacks callbacks = {0,
&_draw_hatch,
&_release_hatch};
- PyObject* rgb = PyObject_CallMethod((PyObject*)self, "get_rgb", "");
- if (!rgb)
- {
- Py_DECREF(hatchpath);
- return NULL;
- }
- ok = PyArg_ParseTuple(rgb, "ffff", &color[0], &color[1], &color[2], &color[3]);
- Py_DECREF(rgb);
- if (!ok)
- {
- Py_DECREF(hatchpath);
- return NULL;
- }
-
baseSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
if (!baseSpace)
{
@@ -938,7 +945,7 @@
kCGPatternTilingNoDistortion,
false,
&callbacks);
- CGContextSetFillPattern(cr, pattern, color);
+ CGContextSetFillPattern(cr, pattern, self->color);
CGPatternRelease(pattern);
iterator = get_path_iterator(path,
transform,
@@ -1227,6 +1234,8 @@
if (Ntransforms)
{
+ CGAffineTransform master;
+ double a, b, c, d, tx, ty;
PyObject* values = PyObject_CallMethod(master_transform, "to_values", "");
if (!values)
{
@@ -1239,15 +1248,15 @@
ok = 0;
goto exit;
}
- CGAffineTransform master;
- ok = PyArg_ParseTuple(values, "ffffff",
- &master.a,
- &master.b,
- &master.c,
- &master.d,
- &master.tx,
- &master.ty);
+ /* CGAffineTransform contains CGFloat; cannot use master directly */
+ ok = PyArg_ParseTuple(values, "dddddd", &a, &b, &c, &d, &tx, &ty);
Py_DECREF(values);
+ master.a = a;
+ master.b = b;
+ master.c = c;
+ master.d = d;
+ master.tx = tx;
+ master.ty = ty;
if (!ok) goto exit;
CGContextConcatCTM(cr, master);
}
@@ -1652,13 +1661,15 @@
}
if (PyTuple_Check(values))
{
- ok = PyArg_ParseTuple(values, "ffffff",
- &master.a,
- &master.b,
- &master.c,
- &master.d,
- &master.tx,
- &master.ty);
+ double a, b, c, d, tx, ty;
+ /* CGAffineTransform contains CGFloat; cannot use master directly */
+ ok = PyArg_ParseTuple(values, "dddddd", &a, &b, &c, &d, &tx, &ty);
+ master.a = a;
+ master.b = b;
+ master.c = c;
+ master.d = d;
+ master.tx = tx;
+ master.ty = ty;
}
else
{
@@ -1866,7 +1877,11 @@
}
+#ifdef MAC_OS_X_VERSION_10_5
+static CTFontRef
+#else
static ATSFontRef
+#endif
setfont(CGContextRef cr, PyObject* family, float size, const char weight[],
const char italic[])
{
@@ -1876,7 +1891,11 @@
const char* temp;
const char* name = "Times-Roman";
CFStringRef string;
- ATSFontRef atsfont = 0;
+#ifdef MAC_OS_X_VERSION_10_5
+ CTFontRef font = 0;
+#else
+ ATSFontRef font = 0;
+#endif
const int k = (strcmp(italic, "italic") ? 0 : 2)
+ (strcmp(weight, "bold") ? 0 : 1);
@@ -2072,26 +2091,38 @@
string = CFStringCreateWithCString(kCFAllocatorDefault,
temp,
kCFStringEncodingMacRoman);
- atsfont = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault);
+#ifdef MAC_OS_X_VERSION_10_5
+ font = CTFontCreateWithName(string, size, NULL);
+#else
+ font = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault);
+#endif
+
CFRelease(string);
- if(atsfont)
+ if(font)
{
name = temp;
break;
}
}
- if(!atsfont)
+ if(!font)
{ string = CFStringCreateWithCString(kCFAllocatorDefault,
name,
kCFStringEncodingMacRoman);
- atsfont = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault);
+#ifdef MAC_OS_X_VERSION_10_5
+ font = CTFontCreateWithName(string, size, NULL);
+#else
+ font = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault);
+#endif
CFRelease(string);
}
+#ifndef MAC_OS_X_VERSION_10_5
CGContextSelectFont(cr, name, size, kCGEncodingMacRoman);
- return atsfont;
+#endif
+ return font;
}
+#ifdef MAC_OS_X_VERSION_10_5
static PyObject*
GraphicsContext_draw_text (GraphicsContext* self, PyObject* args)
{
@@ -2104,6 +2135,174 @@
const char* weight;
const char* italic;
float angle;
+ CTFontRef font;
+ CGColorRef color;
+ CGFloat descent;
+
+ CFStringRef keys[2];
+ CFTypeRef values[2];
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "ffu#Ofssf",
+ &x,
+ &y,
+ &text,
+ &n,
+ &family,
+ &size,
+ &weight,
+ &italic,
+ &angle)) return NULL;
+
+ font = setfont(cr, family, size, weight, italic);
+
+ color = CGColorCreateGenericRGB(self->color[0],
+ self->color[1],
+ self->color[2],
+ self->color[3]);
+
+ keys[0] = kCTFontAttributeName;
+ keys[1] = kCTForegroundColorAttributeName;
+ values[0] = font;
+ values[1] = color;
+ CFDictionaryRef attributes = CFDictionaryCreate(kCFAllocatorDefault,
+ (const void**)&keys,
+ (const void**)&values,
+ 2,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CGColorRelease(color);
+ CFRelease(font);
+
+ CFStringRef s = CFStringCreateWithCharacters(kCFAllocatorDefault, text, n);
+
+ CFAttributedStringRef string = CFAttributedStringCreate(kCFAllocatorDefault,
+ s,
+ attributes);
+ CFRelease(s);
+ CFRelease(attributes);
+
+ CTLineRef line = CTLineCreateWithAttributedString(string);
+ CFRelease(string);
+
+ CTLineGetTypographicBounds(line, NULL, &descent, NULL);
+
+ if (!line)
+ {
+ PyErr_SetString(PyExc_RuntimeError,
+ "CTLineCreateWithAttributedString failed");
+ return NULL;
+ }
+
+ CGContextSetTextMatrix(cr, CGAffineTransformIdentity);
+ if (angle)
+ {
+ CGContextSaveGState(cr);
+ CGContextTranslateCTM(cr, x, y);
+ CGContextRotateCTM(cr, angle*M_PI/180);
+ CTLineDraw(line, cr);
+ CGContextRestoreGState(cr);
+ }
+ else
+ {
+ CGContextSetTextPosition(cr, x, y);
+ CTLineDraw(line, cr);
+ }
+ CFRelease(line);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_get_text_width_height_descent(GraphicsContext* self, PyObject* args)
+{
+ const UniChar* text;
+ int n;
+ PyObject* family;
+ float size;
+ const char* weight;
+ const char* italic;
+
+ CGFloat ascent;
+ CGFloat descent;
+ double width;
+ CGRect rect;
+
+ CTFontRef font;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "u#Ofss",
+ &text, &n, &family, &size, &weight, &italic))
+ return NULL;
+
+ font = setfont(cr, family, size, weight, italic);
+
+ CFStringRef keys[1];
+ CFTypeRef values[1];
+
+ keys[0] = kCTFontAttributeName;
+ values[0] = font;
+ CFDictionaryRef attributes = CFDictionaryCreate(kCFAllocatorDefault,
+ (const void**)&keys,
+ (const void**)&values,
+ 1,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CFRelease(font);
+
+ CFStringRef s = CFStringCreateWithCharacters(kCFAllocatorDefault, text, n);
+
+ CFAttributedStringRef string = CFAttributedStringCreate(kCFAllocatorDefault,
+ s,
+ attributes);
+ CFRelease(s);
+ CFRelease(attributes);
+
+ CTLineRef line = CTLineCreateWithAttributedString(string);
+ CFRelease(string);
+
+ if (!line)
+ {
+ PyErr_SetString(PyExc_RuntimeError,
+ "CTLineCreateWithAttributedString failed");
+ return NULL;
+ }
+
+ width = CTLineGetTypographicBounds(line, &ascent, &descent, NULL);
+ rect = CTLineGetImageBounds(line, cr);
+
+ CFRelease(line);
+
+ return Py_BuildValue("fff", width, rect.size.height, descent);
+}
+
+#else
+
+static PyObject*
+GraphicsContext_draw_text (GraphicsContext* self, PyObject* args)
+{
+ float x;
+ float y;
+ const UniChar* text;
+ int n;
+ PyObject* family;
+ float size;
+ const char* weight;
+ const char* italic;
+ float angle;
ATSFontRef atsfont;
CGContextRef cr = self->cr;
if (!cr)
@@ -2188,6 +2387,102 @@
return Py_None;
}
+static PyObject*
+GraphicsContext_get_text_width_height_descent(GraphicsContext* self, PyObject* args)
+{
+ const UniChar* text;
+ int n;
+ PyObject* family;
+ float size;
+ const char* weight;
+ const char* italic;
+
+ ATSFontRef atsfont;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "u#Ofss", &text, &n, &family, &size, &weight, &italic)) return NULL;
+
+ atsfont = setfont(cr, family, size, weight, italic);
+
+ OSStatus status = noErr;
+ ATSUAttributeTag tags[] = {kATSUFontTag,
+ kATSUSizeTag,
+ kATSUQDBoldfaceTag,
+ kATSUQDItalicTag};
+ ByteCount sizes[] = {sizeof(ATSUFontID),
+ sizeof(Fixed),
+ sizeof(Boolean),
+ sizeof(Boolean)};
+ Fixed atsuSize = Long2Fix(size);
+ Boolean isBold = FALSE; /* setfont takes care of this */
+ Boolean isItalic = FALSE; /* setfont takes care of this */
+ ATSUAttributeValuePtr values[] = {&atsfont, &atsuSize, &isBold, &isItalic};
+
+ status = ATSUSetAttributes(style, 4, tags, sizes, values);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetAttributes failed");
+ return NULL;
+ }
+
+ status = ATSUSetTextPointerLocation(layout,
+ text,
+ kATSUFromTextBeginning, /* offset from beginning */
+ kATSUToTextEnd, /* length of text range */
+ n); /* length of text buffer */
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ATSUCreateTextLayoutWithTextPtr failed");
+ return NULL;
+ }
+
+ status = ATSUSetRunStyle(layout,
+ style,
+ kATSUFromTextBeginning,
+ kATSUToTextEnd);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetRunStyle failed");
+ return NULL;
+ }
+
+ ATSUAttributeTag tag = kATSUCGContextTag;
+ ByteCount bc = sizeof (CGContextRef);
+ ATSUAttributeValuePtr value = &cr;
+ status = ATSUSetLayoutControls(layout, 1, &tag, &bc, &value);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetLayoutControls failed");
+ return NULL;
+ }
+
+ ATSUTextMeasurement before;
+ ATSUTextMeasurement after;
+ ATSUTextMeasurement ascent;
+ ATSUTextMeasurement descent;
+ status = ATSUGetUnjustifiedBounds(layout,
+ kATSUFromTextBeginning, kATSUToTextEnd,
+ &before, &after, &ascent, &descent);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUGetUnjustifiedBounds failed");
+ return NULL;
+ }
+
+ const float width = FixedToFloat(after-before);
+ const float height = FixedToFloat(ascent-descent);
+
+ return Py_BuildValue("fff", width, height, FixedToFloat(descent));
+}
+#endif
+
static void _data_provider_release(void* info, const void* data, size_t size)
{
PyObject* image = (PyObject*)info;
@@ -2293,101 +2588,6 @@
}
static PyObject*
-GraphicsContext_get_text_width_height_descent(GraphicsContext* self, PyObject* args)
-{
- const UniChar* text;
- int n;
- PyObject* family;
- float size;
- const char* weight;
- const char* italic;
-
- ATSFontRef atsfont;
-
- CGContextRef cr = self->cr;
- if (!cr)
- {
- PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
- return NULL;
- }
-
- if(!PyArg_ParseTuple(args, "u#Ofss", &text, &n, &family, &size, &weight, &italic)) return NULL;
-
- atsfont = setfont(cr, family, size, weight, italic);
-
- OSStatus status = noErr;
- ATSUAttributeTag tags[] = {kATSUFontTag,
- kATSUSizeTag,
- kATSUQDBoldfaceTag,
- kATSUQDItalicTag};
- ByteCount sizes[] = {sizeof(ATSUFontID),
- sizeof(Fixed),
- sizeof(Boolean),
- sizeof(Boolean)};
- Fixed atsuSize = Long2Fix(size);
- Boolean isBold = FALSE; /* setfont takes care of this */
- Boolean isItalic = FALSE; /* setfont takes care of this */
- ATSUAttributeValuePtr values[] = {&atsfont, &atsuSize, &isBold, &isItalic};
-
- status = ATSUSetAttributes(style, 4, tags, sizes, values);
- if (status!=noErr)
- {
- PyErr_SetString(PyExc_RuntimeError, "ATSUSetAttributes failed");
- return NULL;
- }
-
- status = ATSUSetTextPointerLocation(layout,
- text,
- kATSUFromTextBeginning, /* offset from beginning */
- kATSUToTextEnd, /* length of text range */
- n); /* length of text buffer */
- if (status!=noErr)
- {
- PyErr_SetString(PyExc_RuntimeError,
- "ATSUCreateTextLayoutWithTextPtr failed");
- return NULL;
- }
-
- status = ATSUSetRunStyle(layout,
- style,
- kATSUFromTextBeginning,
- kATSUToTextEnd);
- if (status!=noErr)
- {
- PyErr_SetString(PyExc_RuntimeError, "ATSUSetRunStyle failed");
- return NULL;
- }
-
- ATSUAttributeTag tag = kATSUCGContextTag;
- ByteCount bc = sizeof (CGContextRef);
- ATSUAttributeValuePtr value = &cr;
- status = ATSUSetLayoutControls(layout, 1, &tag, &bc, &value);
- if (status!=noErr)
- {
- PyErr_SetString(PyExc_RuntimeError, "ATSUSetLayoutControls failed");
- return NULL;
- }
-
- ATSUTextMeasurement before;
- ATSUTextMeasurement after;
- ATSUTextMeasurement ascent;
- ATSUTextMeasurement descent;
- status = ATSUGetUnjustifiedBounds(layout,
- kATSUFromTextBeginning, kATSUToTextEnd,
- &before, &after, &ascent, &descent);
- if (status!=noErr)
- {
- PyErr_SetString(PyExc_RuntimeError, "ATSUGetUnjustifiedBounds failed");
- return NULL;
- }
-
- const float width = FixedToFloat(after-before);
- const float height = FixedToFloat(ascent-descent);
-
- return Py_BuildValue("fff", width, height, FixedToFloat(descent));
-}
-
-static PyObject*
GraphicsContext_draw_image(GraphicsContext* self, PyObject* args)
{
float x, y;
@@ -2621,7 +2821,11 @@
"_macosx.GraphicsContext", /*tp_name*/
sizeof(GraphicsContext), /*tp_basicsize*/
0, /*tp_itemsize*/
+#ifdef MAC_OS_X_VERSION_10_5
+ 0, /*tp_dealloc*/
+#else
(destructor)GraphicsContext_dealloc, /*tp_dealloc*/
+#endif
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -2826,15 +3030,18 @@
int n;
const unichar* characters;
NSSize size;
+ double width, height;
if(!view)
{
PyErr_SetString(PyExc_RuntimeError, "NSView* is NULL");
return NULL;
}
- if(!PyArg_ParseTuple(args, "u#ff",
- &characters, &n,
- &size.width, &size.height)) return NULL;
+ /* NSSize contains CGFloat; cannot use size directly */
+ if(!PyArg_ParseTuple(args, "u#dd",
+ &characters, &n, &width, &height)) return NULL;
+ size.width = width;
+ size.height = height;
/* This function may be called from inside the event loop, when an
* autorelease pool is available, or from Python, when no autorelease
@@ -4492,6 +4699,86 @@
PyGILState_Release(gstate);
}
+- (void)rightMouseDown:(NSEvent *)event
+{
+ int x, y;
+ int num = 3;
+ PyObject* result;
+ PyGILState_STATE gstate;
+ NSPoint location = [event locationInWindow];
+ location = [self convertPoint: location fromView: nil];
+ x = location.x;
+ y = location.y;
+ gstate = PyGILState_Ensure();
+ result = PyObject_CallMethod(canvas, "button_press_event", "iii", x, y, num);
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+
+ PyGILState_Release(gstate);
+}
+
+- (void)rightMouseUp:(NSEvent *)event
+{
+ int x, y;
+ int num = 3;
+ PyObject* result;
+ PyGILState_STATE gstate;
+ NSPoint location = [event locationInWindow];
+ location = [self convertPoint: location fromView: nil];
+ x = location.x;
+ y = location.y;
+ gstate = PyGILState_Ensure();
+ result = PyObject_CallMethod(canvas, "button_release_event", "iii", x, y, num);
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+
+ PyGILState_Release(gstate);
+}
+
+- (void)otherMouseDown:(NSEvent *)event
+{
+ int x, y;
+ int num = 2;
+ PyObject* result;
+ PyGILState_STATE gstate;
+ NSPoint location = [event locationInWindow];
+ location = [self convertPoint: location fromView: nil];
+ x = location.x;
+ y = location.y;
+ gstate = PyGILState_Ensure();
+ result = PyObject_CallMethod(canvas, "button_press_event", "iii", x, y, num);
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+
+ PyGILState_Release(gstate);
+}
+
+- (void)otherMouseUp:(NSEvent *)event
+{
+ int x, y;
+ int num = 2;
+ PyObject* result;
+ PyGILState_STATE gstate;
+ NSPoint location = [event locationInWindow];
+ location = [self convertPoint: location fromView: nil];
+ x = location.x;
+ y = location.y;
+ gstate = PyGILState_Ensure();
+ result = PyObject_CallMethod(canvas, "button_release_event", "iii", x, y, num);
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+
+ PyGILState_Release(gstate);
+}
+
- (void)setRubberband:(NSRect)rect
{
if (!NSIsEmptyRect(rubberband)) [self setNeedsDisplayInRect: rubberband];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-04 13:15:24
|
Revision: 7345
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7345&view=rev
Author: jdh2358
Date: 2009-08-04 13:15:14 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
get data example
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/pylab_examples/scatter_demo2.py
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/cbook.py
Added Paths:
-----------
trunk/matplotlib/examples/misc/mpl_data_demo.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-08-04 13:11:35 UTC (rev 7344)
+++ trunk/matplotlib/CHANGELOG 2009-08-04 13:15:14 UTC (rev 7345)
@@ -1,3 +1,4 @@
+
2009-08-03 Add PathCollection; modify contourf to use complex
paths instead of simple paths with cuts. - EF
@@ -3,4 +4,8 @@
2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS
+2009-07-31 Added cbook.get_mpl_data for urllib enabled fetching and
+ cacheing of data needed for examples. See
+ examples/misc/mpl_data_demo.py - JDH
+
======================================================================
Added: trunk/matplotlib/examples/misc/mpl_data_demo.py
===================================================================
--- trunk/matplotlib/examples/misc/mpl_data_demo.py (rev 0)
+++ trunk/matplotlib/examples/misc/mpl_data_demo.py 2009-08-04 13:15:14 UTC (rev 7345)
@@ -0,0 +1,12 @@
+ """
+ Grab mpl data from the ~/.matplotlib/mpl_data cache if it exists, else
+ fetch it from svn and cache it
+ """
+import matplotlib.cbook as cbook
+import matplotlib.pyplot as plt
+fname = cbook.get_mpl_data('lena.png', asfileobj=False)
+
+print 'fname', fname
+im = plt.imread(fname)
+plt.imshow(im)
+plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/scatter_demo2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/scatter_demo2.py 2009-08-04 13:11:35 UTC (rev 7344)
+++ trunk/matplotlib/examples/pylab_examples/scatter_demo2.py 2009-08-04 13:15:14 UTC (rev 7345)
@@ -1,7 +1,7 @@
"""
make a scatter plot with varying color and size arguments
"""
-import matplotlib
+import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2009-08-04 13:11:35 UTC (rev 7344)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2009-08-04 13:15:14 UTC (rev 7345)
@@ -487,6 +487,7 @@
always=False)
+
def get_example_data(fname):
"""
return a filehandle to one of the example files in mpl-data/example
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-04 13:11:35 UTC (rev 7344)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2009-08-04 13:15:14 UTC (rev 7345)
@@ -10,6 +10,8 @@
import numpy.ma as ma
from weakref import ref
+import matplotlib
+
major, minor1, minor2, s, tmp = sys.version_info
@@ -338,6 +340,55 @@
def is_scalar_or_string(val):
return is_string_like(val) or not iterable(val)
+
+
+def get_mpl_data(fname, asfileobj=True):
+ """
+ Check the cachedirectory ~/.matplotlib/mpl_data for an mpl_data
+ file. If it does not exist, fetch it with urllib from the mpl svn repo
+
+ http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/
+
+ and store it in the cachedir.
+
+ If asfileobj is True, a file object will be returned. Else the
+ path to the file as a string will be returned
+
+ To add a datafile to this directory, you need to check out
+ mpl_data from matplotlib svn::
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/mpl_data
+
+ and svn add the data file you want to support. This is primarily
+ intended for use in mpl examples that need custom data
+ """
+
+ # TODO: how to handle stale data in the cache that has been
+ # updated from svn -- is there a clean http way to get the current
+ # revision number that will not leave us at the mercy of html
+ # changes at sf?
+
+
+ configdir = matplotlib.get_configdir()
+ cachedir = os.path.join(configdir, 'mpl_data')
+ if not os.path.exists(cachedir):
+ os.mkdir(cachedir)
+
+ cachefile = os.path.join(cachedir, fname)
+
+ if not os.path.exists(cachefile):
+ import urllib
+ url = 'http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/mpl_data/%s'%urllib.quote(fname)
+ matplotlib.verbose.report('Attempting to download %s to %s'%(url, cachefile))
+ urllib.urlretrieve(url, filename=cachefile)
+ else:
+ matplotlib.verbose.report('Aleady have mpl_data %s'%fname)
+
+ if asfileobj:
+ return to_filehandle(cachefile)
+ else:
+ return cachefile
+
def flatten(seq, scalarp=is_scalar_or_string):
"""
this generator flattens nested containers such as
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-08-04 13:11:43
|
Revision: 7344
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7344&view=rev
Author: mdboom
Date: 2009-08-04 13:11:35 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Build mathtex as part of matplotlib's build
Modified Paths:
--------------
branches/mathtex/setup.py
branches/mathtex/setupext.py
Modified: branches/mathtex/setup.py
===================================================================
--- branches/mathtex/setup.py 2009-08-04 11:50:09 UTC (rev 7343)
+++ branches/mathtex/setup.py 2009-08-04 13:11:35 UTC (rev 7344)
@@ -42,7 +42,8 @@
check_for_qt, check_for_qt4, check_for_cairo, \
check_provide_pytz, check_provide_dateutil,\
check_for_dvipng, check_for_ghostscript, check_for_latex, \
- check_for_pdftops, check_for_datetime, options, build_png
+ check_for_pdftops, check_for_datetime, options, build_png, \
+ check_for_mathtex
#import distutils.sysconfig
# jdh
@@ -64,6 +65,7 @@
'matplotlib.numerix.fft',
]
+package_dir = {'': 'lib'}
py_modules = ['pylab']
@@ -214,6 +216,11 @@
print 'adding pytz'
if provide_dateutil: add_dateutil()
+# Add installation of mathtex
+if not check_for_mathtex():
+ package_dir['mathtex'] = 'lib/mathtex/mathtex'
+ packages.append('mathtex')
+
print_raw("")
print_raw("OPTIONAL USETEX DEPENDENCIES")
check_for_dvipng()
@@ -243,6 +250,7 @@
if options['verbose']:
mod.extra_compile_args.append('-DVERBOSE')
+
print 'pymods', py_modules
print 'packages', packages
distrib = setup(name="matplotlib",
@@ -262,7 +270,7 @@
platforms='any',
py_modules = py_modules,
ext_modules = ext_modules,
- package_dir = {'': 'lib'},
+ package_dir = package_dir,
package_data = package_data,
**additional_params
)
Modified: branches/mathtex/setupext.py
===================================================================
--- branches/mathtex/setupext.py 2009-08-04 11:50:09 UTC (rev 7343)
+++ branches/mathtex/setupext.py 2009-08-04 13:11:35 UTC (rev 7344)
@@ -106,7 +106,8 @@
'build_macosx': 'auto',
'build_image': True,
'build_windowing': True,
- 'backend': None}
+ 'backend': None,
+ 'provide_mathtex': True}
# Based on the contents of setup.cfg, determine the build options
if os.path.exists("setup.cfg"):
@@ -144,6 +145,8 @@
try: options['backend'] = config.get("rc_options", "backend")
except: pass
+ try: options['provide_mathtex'] = config.getboolean("provide_packages", "mathtex")
+ except: options['provide_mathtex'] = True
if options['display_status']:
def print_line(char='='):
@@ -545,7 +548,7 @@
else:
add_base_flags(module)
module.libraries.append('z')
-
+
# put this last for library link order
module.libraries.extend(std_libs)
@@ -1376,3 +1379,17 @@
BUILT_GDK = True
+def check_for_mathtex():
+ if options['provide_mathtex'] is True:
+ print_status("mathtex", "matplotlib will provide")
+ return False
+ try:
+ import mathtex
+ except ImportError:
+ print_status("mathtex", "no")
+ return False
+ else:
+ from mathtex import __version__
+ print_status("mathtex", "present, version %s" % __version__)
+ return True
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-04 11:50:16
|
Revision: 7343
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7343&view=rev
Author: jdh2358
Date: 2009-08-04 11:50:09 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
applied sf patch 2815064 (middle button events for wx) and patch 2818092 (resize events for wx)
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py
Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-08-04 07:13:37 UTC (rev 7342)
+++ branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-08-04 11:50:09 UTC (rev 7343)
@@ -772,6 +772,11 @@
bind(self, wx.EVT_LEAVE_WINDOW, self._onLeave)
bind(self, wx.EVT_ENTER_WINDOW, self._onEnter)
bind(self, wx.EVT_IDLE, self._onIdle)
+ #Add middle button events
+ bind(self, wx.EVT_MIDDLE_DOWN, self._onMiddleButtonDown)
+ bind(self, wx.EVT_MIDDLE_DCLICK, self._onMiddleButtonDown)
+ bind(self, wx.EVT_MIDDLE_UP, self._onMiddleButtonUp)
+
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
self.macros = {} # dict from wx id to seq of macros
@@ -1183,6 +1188,7 @@
# so no need to do anything here except to make sure
# the whole background is repainted.
self.Refresh(eraseBackground=False)
+ FigureCanvasBase.resize_event(self)
def _get_key(self, evt):
@@ -1251,6 +1257,24 @@
if self.HasCapture(): self.ReleaseMouse()
FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt)
+ #Add middle button events
+ def _onMiddleButtonDown(self, evt):
+ """Start measuring on an axis."""
+ x = evt.GetX()
+ y = self.figure.bbox.height - evt.GetY()
+ evt.Skip()
+ self.CaptureMouse()
+ FigureCanvasBase.button_press_event(self, x, y, 2, guiEvent=evt)
+
+ def _onMiddleButtonUp(self, evt):
+ """End measuring on an axis."""
+ x = evt.GetX()
+ y = self.figure.bbox.height - evt.GetY()
+ #print 'release button', 1
+ evt.Skip()
+ if self.HasCapture(): self.ReleaseMouse()
+ FigureCanvasBase.button_release_event(self, x, y, 2, guiEvent=evt)
+
def _onMouseWheel(self, evt):
"""Translate mouse wheel events into matplotlib events"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-04 07:13:44
|
Revision: 7342
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7342&view=rev
Author: efiring
Date: 2009-08-04 07:13:37 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Remove unneeded function and argument from contouring internals
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/src/cntr.c
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 07:01:43 UTC (rev 7341)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 07:13:37 UTC (rev 7342)
@@ -601,8 +601,7 @@
lowers = self._levels[:-1]
uppers = self._levels[1:]
for level, level_upper in zip(lowers, uppers):
- nlist = C.trace(level, level_upper, points = 0,
- nchunk = self.nchunk)
+ nlist = C.trace(level, level_upper, nchunk = self.nchunk)
nseg = len(nlist)//2
segs = nlist[:nseg]
kinds = nlist[nseg:]
@@ -624,7 +623,7 @@
tlinestyles = self._process_linestyles()
C = _cntr.Cntr(x, y, z.filled(), _mask)
for level, width, lstyle in zip(self.levels, tlinewidths, tlinestyles):
- nlist = C.trace(level, points = 0)
+ nlist = C.trace(level)
nseg = len(nlist)//2
segs = nlist[:nseg]
kinds = nlist[nseg:]
Modified: trunk/matplotlib/src/cntr.c
===================================================================
--- trunk/matplotlib/src/cntr.c 2009-08-04 07:01:43 UTC (rev 7341)
+++ trunk/matplotlib/src/cntr.c 2009-08-04 07:13:37 UTC (rev 7342)
@@ -1321,39 +1321,7 @@
site = NULL;
}
-/* Build a list of lists of points, where each point is an (x,y,k)
- tuple.
-*/
-static PyObject *
-build_cntr_list_p(long *np, double *xp, double *yp, short *kp,
- int nparts, long ntotal)
-{
- PyObject *point, *contourList, *all_contours;
- int start = 0, end = 0;
- int i, j, k;
- all_contours = PyList_New(nparts);
-
- for (i = 0; i < nparts; i++)
- {
- start = end;
- end += np[i];
- contourList = PyList_New(np[i]);
- for (k = 0, j = start; j < end; j++, k++)
- {
- point = Py_BuildValue("(ddh)", xp[j], yp[j], kp[j]);
- if (PyList_SetItem(contourList, k, point)) goto error;
- }
- if (PyList_SetItem(all_contours, i, contourList)) goto error;
- }
- return all_contours;
-
- error:
- Py_XDECREF(all_contours);
- return NULL;
-}
-
-
/* Build a list of XY 2-D arrays, shape (N,2), to which a list of K arrays
is concatenated concatenated. */
static PyObject *
@@ -1409,7 +1377,7 @@
*/
PyObject *
-cntr_trace(Csite *site, double levels[], int nlevels, int points, long nchunk)
+cntr_trace(Csite *site, double levels[], int nlevels, long nchunk)
{
PyObject *c_list = NULL;
double *xp0;
@@ -1491,15 +1459,8 @@
}
}
+ c_list = build_cntr_list_v2(nseg0, xp0, yp0, kp0, nparts, ntotal);
- if (points) /* It is False when called; we don't need the point version */
- {
- c_list = build_cntr_list_p(nseg0, xp0, yp0, kp0, nparts, ntotal);
- }
- else
- {
- c_list = build_cntr_list_v2(nseg0, xp0, yp0, kp0, nparts, ntotal);
- }
PyMem_Free(xp0);
PyMem_Free(yp0);
PyMem_Free(kp0);
@@ -1676,18 +1637,17 @@
{
double levels[2] = {0.0, -1e100};
int nlevels = 2;
- int points = 0;
long nchunk = 0L;
- static char *kwlist[] = {"level0", "level1", "points", "nchunk", NULL};
+ static char *kwlist[] = {"level0", "level1", "nchunk", NULL};
- if (! PyArg_ParseTupleAndKeywords(args, kwds, "d|dil", kwlist,
- levels, levels+1, &points, &nchunk))
+ if (! PyArg_ParseTupleAndKeywords(args, kwds, "d|dl", kwlist,
+ levels, levels+1, &nchunk))
{
return NULL;
}
if (levels[1] == -1e100 || levels[1] <= levels[0])
nlevels = 1;
- return cntr_trace(self->site, levels, nlevels, points, nchunk);
+ return cntr_trace(self->site, levels, nlevels, nchunk);
}
static PyMethodDef Cntr_methods[] = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-04 07:01:54
|
Revision: 7341
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7341&view=rev
Author: efiring
Date: 2009-08-04 07:01:43 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
contourf uses complex paths instead of simple paths with cuts
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/src/cntr.c
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-08-04 06:52:24 UTC (rev 7340)
+++ trunk/matplotlib/CHANGELOG 2009-08-04 07:01:43 UTC (rev 7341)
@@ -1,3 +1,6 @@
+2009-08-03 Add PathCollection; modify contourf to use complex
+ paths instead of simple paths with cuts. - EF
+
2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS
======================================================================
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 06:52:24 UTC (rev 7340)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2009-08-04 07:01:43 UTC (rev 7341)
@@ -8,7 +8,7 @@
import numpy as np
from numpy import ma
import matplotlib._cntr as _cntr
-import matplotlib.path as path
+import matplotlib.path as mpath
import matplotlib.ticker as ticker
import matplotlib.cm as cm
import matplotlib.colors as colors
@@ -499,7 +499,7 @@
if inline:
for n in new:
# Add path if not empty or single point
- if len(n)>1: additions.append( path.Path(n) )
+ if len(n)>1: additions.append( mpath.Path(n) )
else: # If not adding label, keep old path
additions.append(linepath)
@@ -579,6 +579,8 @@
self.collections = cbook.silent_list('collections.PolyCollection')
else:
self.collections = cbook.silent_list('collections.LineCollection')
+ self.segs = []
+ self.kinds = []
# label lists must be initialized here
self.labelTexts = []
self.labelCValues = []
@@ -601,13 +603,21 @@
for level, level_upper in zip(lowers, uppers):
nlist = C.trace(level, level_upper, points = 0,
nchunk = self.nchunk)
- col = collections.PolyCollection(nlist,
+ nseg = len(nlist)//2
+ segs = nlist[:nseg]
+ kinds = nlist[nseg:]
+
+
+ paths = self._make_paths(segs, kinds)
+
+ col = collections.PathCollection(paths,
antialiaseds = (self.antialiased,),
edgecolors= 'none',
alpha=self.alpha)
self.ax.add_collection(col)
self.collections.append(col)
-
+ self.segs.append(segs)
+ self.kinds.append(kinds)
else:
tlinewidths = self._process_linewidths()
self.tlinewidths = tlinewidths
@@ -615,7 +625,10 @@
C = _cntr.Cntr(x, y, z.filled(), _mask)
for level, width, lstyle in zip(self.levels, tlinewidths, tlinestyles):
nlist = C.trace(level, points = 0)
- col = collections.LineCollection(nlist,
+ nseg = len(nlist)//2
+ segs = nlist[:nseg]
+ kinds = nlist[nseg:]
+ col = collections.LineCollection(segs,
linewidths = width,
linestyle = lstyle,
alpha=self.alpha)
@@ -623,6 +636,8 @@
col.set_label('_nolegend_')
self.ax.add_collection(col, False)
self.collections.append(col)
+ self.segs.append(segs)
+ self.kinds.append(kinds)
self.changed() # set the colors
x0 = ma.minimum(x)
x1 = ma.maximum(x)
@@ -631,6 +646,17 @@
self.ax.update_datalim([(x0,y0), (x1,y1)])
self.ax.autoscale_view()
+ @staticmethod
+ def _make_paths(segs, kinds):
+ paths = []
+ for seg, kind in zip(segs, kinds):
+ codes = np.zeros(kind.shape, dtype=mpath.Path.code_type)
+ codes.fill(mpath.Path.LINETO)
+ codes[0] = mpath.Path.MOVETO
+ codes[kinds >= _cntr._slitkind] = mpath.Path.MOVETO
+ paths.append(mpath.Path(seg, codes))
+ return paths
+
def changed(self):
tcolors = [ (tuple(rgba),) for rgba in
self.to_rgba(self.cvalues, alpha=self.alpha)]
Modified: trunk/matplotlib/src/cntr.c
===================================================================
--- trunk/matplotlib/src/cntr.c 2009-08-04 06:52:24 UTC (rev 7340)
+++ trunk/matplotlib/src/cntr.c 2009-08-04 07:01:43 UTC (rev 7341)
@@ -199,6 +199,7 @@
/* making the actual marks requires a bunch of other stuff */
const double *x, *y, *z; /* mesh coordinates and function values */
double *xcp, *ycp; /* output contour points */
+ short *kcp; /* kind of contour point */
};
void print_Csite(Csite *Csite)
@@ -268,6 +269,9 @@
#define START_MARK(left) \
((left)>0?((left)>1?J1_START:I1_START):((left)<-1?J0_START:I0_START))
+enum {kind_zone, kind_edge1, kind_edge2,
+ kind_slit_up, kind_slit_down, kind_start_slit=16} point_kinds;
+
/* ------------------------------------------------------------------------ */
/* these actually mark points */
@@ -317,6 +321,7 @@
double zlevel = pass2 ? site->zlevel[level] : 0.0;
double *xcp = pass2 ? site->xcp : 0;
double *ycp = pass2 ? site->ycp : 0;
+ short *kcp = pass2 ? site->kcp : 0;
int z0, z1, z2, z3;
int keep_left = 0; /* flag to try to minimize curvature in saddles */
@@ -338,6 +343,7 @@
double zcp = (zlevel - z[p0]) / (z[p1] - z[p0]);
xcp[n] = zcp * (x[p1] - x[p0]) + x[p0];
ycp[n] = zcp * (y[p1] - y[p0]) + y[p0];
+ kcp[n] = kind_zone;
}
if (!done && !jedge)
{
@@ -487,7 +493,15 @@
site->edge = edge;
site->n = n;
site->left = left;
- return done > 4 ? slit_cutter (site, done - 5, pass2) : done;
+ if (done <= 4)
+ {
+ return done;
+ }
+ if (pass2 && n > 0)
+ {
+ kcp[n-1] += kind_start_slit;
+ }
+ return slit_cutter (site, done - 5, pass2);
}
/* edge_walker assumes that the current edge is being drawn CCW
@@ -513,11 +527,13 @@
long left0 = site->left0;
int level0 = site->level0 == 2;
int marked;
+ int n_kind = 0;
const double *x = pass2 ? site->x : 0;
const double *y = pass2 ? site->y : 0;
double *xcp = pass2 ? site->xcp : 0;
double *ycp = pass2 ? site->ycp : 0;
+ short *kcp = pass2 ? site->kcp : 0;
int z0, z1, heads_up = 0;
@@ -528,6 +544,7 @@
z0 = data[p0] & Z_VALUE;
z1 = data[p1] & Z_VALUE;
marked = 0;
+ n_kind = 0;
if (z0 == 1)
{
/* mark current boundary point */
@@ -535,6 +552,8 @@
{
xcp[n] = x[p0];
ycp[n] = y[p0];
+ kcp[n] = kind_edge1;
+ n_kind = n;
}
marked = 1;
}
@@ -549,6 +568,8 @@
zcp = (zcp - site->z[p0]) / (site->z[p1] - site->z[p0]);
xcp[n] = zcp * (x[p1] - x[p0]) + x[p0];
ycp[n] = zcp * (y[p1] - y[p0]) + y[p0];
+ kcp[n] = kind_edge2;
+ n_kind = n;
}
marked = 1;
}
@@ -562,7 +583,10 @@
site->n = n + marked;
/* if the curve is closing on a hole, need to make a downslit */
if (fwd < 0 && !(data[edge] & (jedge ? J_BNDY : I_BNDY)))
+ {
+ if (n_kind) kcp[n_kind] += kind_start_slit;
return slit_cutter (site, 0, pass2);
+ }
return 3;
}
else if (pass2)
@@ -572,6 +596,7 @@
site->edge = edge;
site->left = left;
site->n = n + marked;
+ if (n_kind) kcp[n_kind] += kind_start_slit;
return slit_cutter (site, heads_up, pass2);
}
}
@@ -649,6 +674,7 @@
const double *y = pass2 ? site->y : 0;
double *xcp = pass2 ? site->xcp : 0;
double *ycp = pass2 ? site->ycp : 0;
+ short *kcp = pass2 ? site->kcp : 0;
if (up)
{
@@ -677,6 +703,7 @@
}
xcp[n] = x[p1];
ycp[n] = y[p1];
+ kcp[n] = kind_slit_up;
n++;
p1 += imax;
}
@@ -733,6 +760,7 @@
{
xcp[n] = x[p0];
ycp[n] = y[p0];
+ kcp[n] = kind_slit_down;
n++;
}
else
@@ -1230,6 +1258,7 @@
site->triangle = NULL;
site->xcp = NULL;
site->ycp = NULL;
+ site->kcp = NULL;
site->x = NULL;
site->y = NULL;
site->z = NULL;
@@ -1279,6 +1308,7 @@
site->z = z;
site->xcp = NULL;
site->ycp = NULL;
+ site->kcp = NULL;
return 0;
}
@@ -1291,11 +1321,12 @@
site = NULL;
}
-/* Build a list of lists of points, where each point is an (x,y)
+/* Build a list of lists of points, where each point is an (x,y,k)
tuple.
*/
static PyObject *
-build_cntr_list_p(long *np, double *xp, double *yp, int nparts, long ntotal)
+build_cntr_list_p(long *np, double *xp, double *yp, short *kp,
+ int nparts, long ntotal)
{
PyObject *point, *contourList, *all_contours;
int start = 0, end = 0;
@@ -1310,7 +1341,7 @@
contourList = PyList_New(np[i]);
for (k = 0, j = start; j < end; j++, k++)
{
- point = Py_BuildValue("(dd)", xp[j], yp[j]);
+ point = Py_BuildValue("(ddh)", xp[j], yp[j], kp[j]);
if (PyList_SetItem(contourList, k, point)) goto error;
}
if (PyList_SetItem(all_contours, i, contourList)) goto error;
@@ -1323,73 +1354,43 @@
}
-#if 0
-/* the following function is not used, so it produces a warning
- * commented it out NN - 070630 */
-
-/* Build a list of tuples (X, Y), where X and Y are 1-D arrays. */
+/* Build a list of XY 2-D arrays, shape (N,2), to which a list of K arrays
+ is concatenated concatenated. */
static PyObject *
-build_cntr_list_v(long *np, double *xp, double *yp, int nparts, long ntotal)
+build_cntr_list_v2(long *np, double *xp, double *yp, short *kp,
+ int nparts, long ntotal)
{
- PyObject *point, *all_contours;
- PyArrayObject *xv, *yv;
- npy_intp dims[1];
- int i;
- long j, k;
-
- all_contours = PyList_New(nparts);
-
- k = 0;
- for (i = 0; i < nparts; i++)
- {
- dims[0] = np[i];
- xv = (PyArrayObject *) PyArray_SimpleNew(1, dims, PyArray_DOUBLE);
- yv = (PyArrayObject *) PyArray_SimpleNew(1, dims, PyArray_DOUBLE);
- if (xv == NULL || yv == NULL) goto error;
- for (j = 0; j < dims[0]; j++)
- {
- ((double *)xv->data)[j] = xp[k];
- ((double *)yv->data)[j] = yp[k];
- k++;
- }
- point = Py_BuildValue("(NN)", xv, yv);
- /* "O" increments ref count; "N" does not. */
- if (PyList_SetItem(all_contours, i, point)) goto error;
- }
- return all_contours;
-
- error:
- Py_XDECREF(all_contours);
- return NULL;
-}
-#endif
-
-/* Build a list of XY 2-D arrays, shape (N,2) */
-static PyObject *
-build_cntr_list_v2(long *np, double *xp, double *yp, int nparts, long ntotal)
-{
PyObject *all_contours;
PyArrayObject *xyv;
+ PyArrayObject *kv;
npy_intp dims[2];
+ npy_intp kdims[1];
int i;
long j, k;
- all_contours = PyList_New(nparts);
+ all_contours = PyList_New(nparts*2);
k = 0;
for (i = 0; i < nparts; i++)
{
dims[0] = np[i];
dims[1] = 2;
+ kdims[0] = np[i];
xyv = (PyArrayObject *) PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
if (xyv == NULL) goto error;
+ kv = (PyArrayObject *) PyArray_SimpleNew(1, kdims, PyArray_SHORT);
+ if (kv == NULL) goto error;
+
for (j = 0; j < dims[0]; j++)
{
((double *)xyv->data)[2*j] = xp[k];
((double *)xyv->data)[2*j+1] = yp[k];
+ ((short *)kv->data)[j] = kp[k];
k++;
}
if (PyList_SetItem(all_contours, i, (PyObject *)xyv)) goto error;
+ if (PyList_SetItem(all_contours, nparts+i,
+ (PyObject *)kv)) goto error;
}
return all_contours;
@@ -1413,6 +1414,7 @@
PyObject *c_list = NULL;
double *xp0;
double *yp0;
+ short *kp0;
long *nseg0;
int iseg;
@@ -1451,12 +1453,14 @@
}
xp0 = (double *) PyMem_Malloc(ntotal * sizeof(double));
yp0 = (double *) PyMem_Malloc(ntotal * sizeof(double));
+ kp0 = (short *) PyMem_Malloc(ntotal * sizeof(short));
nseg0 = (long *) PyMem_Malloc(nparts * sizeof(long));
- if (xp0 == NULL || yp0 == NULL || nseg0 == NULL) goto error;
+ if (xp0 == NULL || yp0 == NULL || kp0 == NULL || nseg0 == NULL) goto error;
/* second pass */
site->xcp = xp0;
site->ycp = yp0;
+ site->kcp = kp0;
iseg = 0;
for (;;iseg++)
{
@@ -1475,6 +1479,7 @@
nseg0[iseg] = n;
site->xcp += n;
site->ycp += n;
+ site->kcp += n;
ntotal2 += n;
nparts2++;
}
@@ -1487,21 +1492,31 @@
}
- if (points)
+ if (points) /* It is False when called; we don't need the point version */
{
- c_list = build_cntr_list_p(nseg0, xp0, yp0, nparts, ntotal);
+ c_list = build_cntr_list_p(nseg0, xp0, yp0, kp0, nparts, ntotal);
}
else
{
- c_list = build_cntr_list_v2(nseg0, xp0, yp0, nparts, ntotal);
+ c_list = build_cntr_list_v2(nseg0, xp0, yp0, kp0, nparts, ntotal);
}
- PyMem_Free(xp0); PyMem_Free(yp0); PyMem_Free(nseg0);
- site->xcp = NULL; site->ycp = NULL;
+ PyMem_Free(xp0);
+ PyMem_Free(yp0);
+ PyMem_Free(kp0);
+ PyMem_Free(nseg0);
+ site->xcp = NULL;
+ site->ycp = NULL;
+ site->kcp = NULL;
return c_list;
error:
- PyMem_Free(xp0); PyMem_Free(yp0); PyMem_Free(nseg0);
- site->xcp = NULL; site->ycp = NULL;
+ PyMem_Free(xp0);
+ PyMem_Free(yp0);
+ PyMem_Free(kp0);
+ PyMem_Free(nseg0);
+ site->xcp = NULL;
+ site->ycp = NULL;
+ site->kcp = NULL;
Py_XDECREF(c_list);
return NULL;
}
@@ -1603,16 +1618,14 @@
}
xpa = (PyArrayObject *) PyArray_ContiguousFromObject(xarg,
- PyArray_DOUBLE, 2, 2);
+ PyArray_DOUBLE, 2, 2);
ypa = (PyArrayObject *) PyArray_ContiguousFromObject(yarg,
- PyArray_DOUBLE,
- 2, 2);
- zpa = (PyArrayObject *) PyArray_ContiguousFromObject(zarg, PyArray_DOUBLE,
- 2, 2);
+ PyArray_DOUBLE, 2, 2);
+ zpa = (PyArrayObject *) PyArray_ContiguousFromObject(zarg,
+ PyArray_DOUBLE, 2, 2);
if (marg)
mpa = (PyArrayObject *) PyArray_ContiguousFromObject(marg,
- PyArray_SBYTE,
- 2, 2);
+ PyArray_SBYTE, 2, 2);
else
mpa = NULL;
@@ -1751,7 +1764,8 @@
if (m == NULL)
return;
-
+ PyModule_AddIntConstant(m, "_slitkind", (long)kind_slit_up );
+ /* We can add all the point_kinds values later if we need them. */
import_array();
Py_INCREF(&CntrType);
PyModule_AddObject(m, "Cntr", (PyObject *)&CntrType);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-08-04 06:52:32
|
Revision: 7340
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7340&view=rev
Author: efiring
Date: 2009-08-04 06:52:24 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
Add PathCollection; reorganize collections.py
PathCollection is added to support complex paths in contourf.
Other changes are to improve readability and reduce redundancy.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2009-08-03 20:06:02 UTC (rev 7339)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2009-08-04 06:52:24 UTC (rev 7340)
@@ -5,15 +5,15 @@
The classes are not meant to be as flexible as their single element
counterparts (e.g. you may not be able to select all line styles) but
-they are meant to be fast for common use cases (e.g. a bunch of solid
+they are meant to be fast for common use cases (e.g. a large set of solid
line segemnts)
"""
-import copy, math, warnings
+import warnings
import numpy as np
-from numpy import ma
+import numpy.ma as ma
import matplotlib as mpl
import matplotlib.cbook as cbook
-import matplotlib.colors as _colors # avoid conflict with kwarg
+import matplotlib.colors as mcolors
import matplotlib.cm as cm
import matplotlib.transforms as transforms
import matplotlib.artist as artist
@@ -106,6 +106,7 @@
self._pickradius = pickradius
self.update(kwargs)
+ self._paths = None
def _get_value(self, val):
@@ -131,6 +132,9 @@
def get_paths(self):
+ return self._paths
+
+ def set_paths(self):
raise NotImplementedError
def get_transforms(self):
@@ -385,7 +389,7 @@
pass
if c is None: c = mpl.rcParams['patch.facecolor']
self._facecolors_original = c
- self._facecolors = _colors.colorConverter.to_rgba_array(c, self._alpha)
+ self._facecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
def set_facecolors(self, c):
"""alias for set_facecolor"""
@@ -427,7 +431,7 @@
else:
if c is None: c = mpl.rcParams['patch.edgecolor']
self._edgecolors_original = c
- self._edgecolors = _colors.colorConverter.to_rgba_array(c, self._alpha)
+ self._edgecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
def set_edgecolors(self, c):
@@ -446,13 +450,13 @@
else:
artist.Artist.set_alpha(self, alpha)
try:
- self._facecolors = _colors.colorConverter.to_rgba_array(
+ self._facecolors = mcolors.colorConverter.to_rgba_array(
self._facecolors_original, self._alpha)
except (AttributeError, TypeError, IndexError):
pass
try:
if self._edgecolors_original != 'face':
- self._edgecolors = _colors.colorConverter.to_rgba_array(
+ self._edgecolors = mcolors.colorConverter.to_rgba_array(
self._edgecolors_original, self._alpha)
except (AttributeError, TypeError, IndexError):
pass
@@ -516,133 +520,27 @@
setting, in sequence form.
"""
-class QuadMesh(Collection):
+class PathCollection(Collection):
"""
- Class for the efficient drawing of a quadrilateral mesh.
-
- A quadrilateral mesh consists of a grid of vertices. The
- dimensions of this array are (*meshWidth* + 1, *meshHeight* +
- 1). Each vertex in the mesh has a different set of "mesh
- coordinates" representing its position in the topology of the
- mesh. For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth*
- and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates
- (*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*)
- form one of the quadrilaterals in the mesh. There are thus
- (*meshWidth* * *meshHeight*) quadrilaterals in the mesh. The mesh
- need not be regular and the polygons need not be convex.
-
- A quadrilateral mesh is represented by a (2 x ((*meshWidth* + 1) *
- (*meshHeight* + 1))) numpy array *coordinates*, where each row is
- the *x* and *y* coordinates of one of the vertices. To define the
- function that maps from a data point to its corresponding color,
- use the :meth:`set_cmap` method. Each of these arrays is indexed in
- row-major order by the mesh coordinates of the vertex (or the mesh
- coordinates of the lower left vertex, in the case of the
- colors).
-
- For example, the first entry in *coordinates* is the
- coordinates of the vertex at mesh coordinates (0, 0), then the one
- at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and
- so on.
+ This is the most basic :class:`Collection` subclass.
"""
- def __init__(self, meshWidth, meshHeight, coordinates, showedges, antialiased=True):
- Collection.__init__(self)
- self._meshWidth = meshWidth
- self._meshHeight = meshHeight
- self._coordinates = coordinates
- self._showedges = showedges
- self._antialiased = antialiased
-
- self._paths = None
-
- self._bbox = transforms.Bbox.unit()
- self._bbox.update_from_data_xy(coordinates.reshape(
- ((meshWidth + 1) * (meshHeight + 1), 2)))
-
- # By converting to floats now, we can avoid that on every draw.
- self._coordinates = self._coordinates.reshape((meshHeight + 1, meshWidth + 1, 2))
- self._coordinates = np.array(self._coordinates, np.float_)
-
- def get_paths(self, dataTrans=None):
- if self._paths is None:
- self._paths = self.convert_mesh_to_paths(
- self._meshWidth, self._meshHeight, self._coordinates)
- return self._paths
-
- @staticmethod
- def convert_mesh_to_paths(meshWidth, meshHeight, coordinates):
+ def __init__(self, paths, **kwargs):
"""
- Converts a given mesh into a sequence of
- :class:`matplotlib.path.Path` objects for easier rendering by
- backends that do not directly support quadmeshes.
+ *paths* is a sequence of :class:`matplotlib.path.Path`
+ instances.
- This function is primarily of use to backend implementers.
+ %(Collection)s
"""
- Path = mpath.Path
- if ma.isMaskedArray(coordinates):
- c = coordinates.data
- else:
- c = coordinates
+ Collection.__init__(self, **kwargs)
+ self.set_paths(paths)
+ __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
- points = np.concatenate((
- c[0:-1, 0:-1],
- c[0:-1, 1: ],
- c[1: , 1: ],
- c[1: , 0:-1],
- c[0:-1, 0:-1]
- ), axis=2)
- points = points.reshape((meshWidth * meshHeight, 5, 2))
- return [Path(x) for x in points]
- def get_datalim(self, transData):
- return self._bbox
+ def set_paths(self, paths):
+ self._paths = paths
- @allow_rasterization
- def draw(self, renderer):
- if not self.get_visible(): return
- renderer.open_group(self.__class__.__name__)
- transform = self.get_transform()
- transOffset = self._transOffset
- offsets = self._offsets
- if self.have_units():
- if len(self._offsets):
- xs = self.convert_xunits(self._offsets[:0])
- ys = self.convert_yunits(self._offsets[:1])
- offsets = zip(xs, ys)
-
- offsets = np.asarray(offsets, np.float_)
-
- if self.check_update('array'):
- self.update_scalarmappable()
-
- clippath, clippath_trans = self.get_transformed_clip_path_and_affine()
- if clippath_trans is not None:
- clippath_trans = clippath_trans.frozen()
-
- if not transform.is_affine:
- coordinates = self._coordinates.reshape(
- (self._coordinates.shape[0] *
- self._coordinates.shape[1],
- 2))
- coordinates = transform.transform(coordinates)
- coordinates = coordinates.reshape(self._coordinates.shape)
- transform = transforms.IdentityTransform()
- else:
- coordinates = self._coordinates
-
- if not transOffset.is_affine:
- offsets = transOffset.transform_non_affine(offsets)
- transOffset = transOffset.get_affine()
-
- renderer.draw_quad_mesh(
- transform.frozen(), self.clipbox, clippath, clippath_trans,
- self._meshWidth, self._meshHeight, coordinates,
- offsets, transOffset, self.get_facecolor(), self._antialiased,
- self._showedges)
- renderer.close_group(self.__class__.__name__)
-
class PolyCollection(Collection):
def __init__(self, verts, sizes = None, closed = True, **kwargs):
"""
@@ -687,8 +585,7 @@
else:
self._paths = [mpath.Path(xy) for xy in verts]
- def get_paths(self):
- return self._paths
+ set_paths = set_verts
def draw(self, renderer):
if self._sizes is not None:
@@ -797,9 +694,6 @@
for x in self._sizes]
return Collection.draw(self, renderer)
- def get_paths(self):
- return self._paths
-
def get_numsides(self):
return self._numsides
@@ -907,7 +801,7 @@
if antialiaseds is None: antialiaseds = (mpl.rcParams['lines.antialiased'],)
self.set_linestyles(linestyles)
- colors = _colors.colorConverter.to_rgba_array(colors)
+ colors = mcolors.colorConverter.to_rgba_array(colors)
Collection.__init__(
self,
@@ -925,9 +819,6 @@
self.set_segments(segments)
- def get_paths(self):
- return self._paths
-
def set_segments(self, segments):
if segments is None: return
_segments = []
@@ -940,6 +831,7 @@
self._paths = [mpath.Path(seg) for seg in _segments]
set_verts = set_segments # for compatibility with PolyCollection
+ set_paths = set_segments
def _add_offsets(self, segs):
offsets = self._uniform_offsets
@@ -963,7 +855,7 @@
ACCEPTS: matplotlib color arg or sequence of rgba tuples
"""
- self._edgecolors = _colors.colorConverter.to_rgba_array(c)
+ self._edgecolors = mcolors.colorConverter.to_rgba_array(c)
def color(self, c):
"""
@@ -1011,8 +903,6 @@
for x in self._sizes]
return Collection.draw(self, renderer)
- def get_paths(self):
- return self._paths
class EllipseCollection(Collection):
"""
@@ -1095,9 +985,6 @@
self.set_transforms()
return Collection.draw(self, renderer)
- def get_paths(self):
- return self._paths
-
class PatchCollection(Collection):
"""
A generic collection of patches.
@@ -1152,17 +1039,148 @@
else:
Collection.__init__(self, **kwargs)
- paths = [p.get_transform().transform_path(p.get_path())
+ self.set_paths(patches)
+
+ def set_paths(self, patches):
+ paths = [p.get_transform().transform_path(p.get_path())
for p in patches]
-
self._paths = paths
+
+class QuadMesh(Collection):
+ """
+ Class for the efficient drawing of a quadrilateral mesh.
+
+ A quadrilateral mesh consists of a grid of vertices. The
+ dimensions of this array are (*meshWidth* + 1, *meshHeight* +
+ 1). Each vertex in the mesh has a different set of "mesh
+ coordinates" representing its position in the topology of the
+ mesh. For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth*
+ and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates
+ (*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*)
+ form one of the quadrilaterals in the mesh. There are thus
+ (*meshWidth* * *meshHeight*) quadrilaterals in the mesh. The mesh
+ need not be regular and the polygons need not be convex.
+
+ A quadrilateral mesh is represented by a (2 x ((*meshWidth* + 1) *
+ (*meshHeight* + 1))) numpy array *coordinates*, where each row is
+ the *x* and *y* coordinates of one of the vertices. To define the
+ function that maps from a data point to its corresponding color,
+ use the :meth:`set_cmap` method. Each of these arrays is indexed in
+ row-major order by the mesh coordinates of the vertex (or the mesh
+ coordinates of the lower left vertex, in the case of the
+ colors).
+
+ For example, the first entry in *coordinates* is the
+ coordinates of the vertex at mesh coordinates (0, 0), then the one
+ at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and
+ so on.
+ """
+ def __init__(self, meshWidth, meshHeight, coordinates, showedges, antialiased=True):
+ Collection.__init__(self)
+ self._meshWidth = meshWidth
+ self._meshHeight = meshHeight
+ self._coordinates = coordinates
+ self._showedges = showedges
+ self._antialiased = antialiased
+
+ self._bbox = transforms.Bbox.unit()
+ self._bbox.update_from_data_xy(coordinates.reshape(
+ ((meshWidth + 1) * (meshHeight + 1), 2)))
+
+ # By converting to floats now, we can avoid that on every draw.
+ self._coordinates = self._coordinates.reshape((meshHeight + 1, meshWidth + 1, 2))
+ self._coordinates = np.array(self._coordinates, np.float_)
+
def get_paths(self):
+ if self._paths is None:
+ self.set_paths()
return self._paths
+ def set_paths(self):
+ self._paths = self.convert_mesh_to_paths(
+ self._meshWidth, self._meshHeight, self._coordinates)
+ @staticmethod
+ def convert_mesh_to_paths(meshWidth, meshHeight, coordinates):
+ """
+ Converts a given mesh into a sequence of
+ :class:`matplotlib.path.Path` objects for easier rendering by
+ backends that do not directly support quadmeshes.
+
+ This function is primarily of use to backend implementers.
+ """
+ Path = mpath.Path
+
+ if ma.isMaskedArray(coordinates):
+ c = coordinates.data
+ else:
+ c = coordinates
+
+ points = np.concatenate((
+ c[0:-1, 0:-1],
+ c[0:-1, 1: ],
+ c[1: , 1: ],
+ c[1: , 0:-1],
+ c[0:-1, 0:-1]
+ ), axis=2)
+ points = points.reshape((meshWidth * meshHeight, 5, 2))
+ return [Path(x) for x in points]
+
+ def get_datalim(self, transData):
+ return self._bbox
+
+ @allow_rasterization
+ def draw(self, renderer):
+ if not self.get_visible(): return
+ renderer.open_group(self.__class__.__name__)
+ transform = self.get_transform()
+ transOffset = self._transOffset
+ offsets = self._offsets
+
+ if self.have_units():
+ if len(self._offsets):
+ xs = self.convert_xunits(self._offsets[:0])
+ ys = self.convert_yunits(self._offsets[:1])
+ offsets = zip(xs, ys)
+
+ offsets = np.asarray(offsets, np.float_)
+
+ if self.check_update('array'):
+ self.update_scalarmappable()
+
+ clippath, clippath_trans = self.get_transformed_clip_path_and_affine()
+ if clippath_trans is not None:
+ clippath_trans = clippath_trans.frozen()
+
+ if not transform.is_affine:
+ coordinates = self._coordinates.reshape(
+ (self._coordinates.shape[0] *
+ self._coordinates.shape[1],
+ 2))
+ coordinates = transform.transform(coordinates)
+ coordinates = coordinates.reshape(self._coordinates.shape)
+ transform = transforms.IdentityTransform()
+ else:
+ coordinates = self._coordinates
+
+ if not transOffset.is_affine:
+ offsets = transOffset.transform_non_affine(offsets)
+ transOffset = transOffset.get_affine()
+
+ renderer.draw_quad_mesh(
+ transform.frozen(), self.clipbox, clippath, clippath_trans,
+ self._meshWidth, self._meshHeight, coordinates,
+ offsets, transOffset, self.get_facecolor(), self._antialiased,
+ self._showedges)
+ renderer.close_group(self.__class__.__name__)
+
+
+
+
artist.kwdocd['Collection'] = patchstr = artist.kwdoc(Collection)
-for k in ('QuadMesh', 'PolyCollection', 'BrokenBarHCollection', 'RegularPolyCollection',
+for k in ('QuadMesh', 'PolyCollection', 'BrokenBarHCollection',
+ 'RegularPolyCollection', 'PathCollection',
'StarPolygonCollection', 'PatchCollection', 'CircleCollection'):
artist.kwdocd[k] = patchstr
artist.kwdocd['LineCollection'] = artist.kwdoc(LineCollection)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-08-03 20:06:11
|
Revision: 7339
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7339&view=rev
Author: jouni
Date: 2009-08-03 20:06:02 +0000 (Mon, 03 Aug 2009)
Log Message:
-----------
Merged revisions 7338 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7338 | jouni | 2009-08-03 22:41:32 +0300 (Mon, 03 Aug 2009) | 2 lines
Fixed boilerplate.py so it doesn't break the ReST docs.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/boilerplate.py
trunk/matplotlib/lib/matplotlib/pyplot.py
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/examples/misc/multiprocess.py
trunk/matplotlib/examples/mplot3d/contour3d_demo.py
trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
trunk/matplotlib/examples/mplot3d/polys3d_demo.py
trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
trunk/matplotlib/examples/mplot3d/surface3d_demo.py
trunk/matplotlib/examples/mplot3d/wire3d_demo.py
trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7318
+ /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7318,7338
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-08-03 19:41:32 UTC (rev 7338)
+++ trunk/matplotlib/CHANGELOG 2009-08-03 20:06:02 UTC (rev 7339)
@@ -1,3 +1,5 @@
+2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS
+
======================================================================
2009-07-31 Tagging 0.99.0.rc1 at 7314 - MGD
Modified: trunk/matplotlib/boilerplate.py
===================================================================
--- trunk/matplotlib/boilerplate.py 2009-08-03 19:41:32 UTC (rev 7338)
+++ trunk/matplotlib/boilerplate.py 2009-08-03 20:06:02 UTC (rev 7339)
@@ -21,7 +21,6 @@
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def %(func)s(%(argspec)s):
- %(docstring)s
%(ax)s = gca()
# allow callers to override the hold state by passing hold=True|False
%(washold)s = %(ax)s.ishold()
@@ -35,16 +34,19 @@
%(ax)s.hold(%(washold)s)
%(mappable)s
return %(ret)s
+if Axes.%(func)s.__doc__ is not None:
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + __docstring_addendum
"""
_fmtmisc = """\
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def %(func)s(%(argspec)s):
- %(docstring)s
%(ret)s = gca().%(func)s(%(call)s)
draw_if_interactive()
return %(ret)s
+if Axes.%(func)s.__doc__ is not None:
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__)
"""
# these methods are all simple wrappers of Axes methods by the same
@@ -138,19 +140,6 @@
"""
return '\n'.join(x.rstrip() for x in string.split('\n'))
-def make_docstring(cmd, mention_hold):
- func = getattr(Axes, cmd)
- docstring = inspect.getdoc(func)
- if docstring is None:
- return ""
- escaped = re.sub(r'\\', r'\\\\', docstring)
- if mention_hold:
- escaped += '''
-
-Additional kwargs: hold = [True|False] overrides default hold state
-'''
- return '"""'+escaped+'"""'
-
for fmt,cmdlist in (_fmtplot,_plotcommands),(_fmtmisc,_misccommands):
for func in cmdlist:
# For some commands, an additional line is needed to set the
@@ -160,9 +149,6 @@
else:
mappable = ''
- # Format docstring
- docstring = make_docstring(func, fmt is _fmtplot)
-
# Get argspec of wrapped function
args, varargs, varkw, defaults = inspect.getargspec(getattr(Axes, func))
args.pop(0) # remove 'self' argument
Property changes on: trunk/matplotlib/doc/pyplots/README
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
+ /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338
Property changes on: trunk/matplotlib/examples/misc/multiprocess.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
+ /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338
Property changes on: trunk/matplotlib/examples/mplot3d/contour3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
+ /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338
Property changes on: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
+ /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338
Property changes on: trunk/matplotlib/examples/mplot3d/polys3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
+ /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338
Property changes on: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
+ /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338
Property changes on: trunk/matplotlib/examples/mplot3d/surface3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
+ /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338
Property changes on: trunk/matplotlib/examples/mplot3d/wire3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
+ /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2009-08-03 19:41:32 UTC (rev 7338)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2009-08-03 20:06:02 UTC (rev 7339)
@@ -1608,72 +1608,17 @@
draw_if_interactive()
+# This is added to docstrings of autogenerated plotting functions
+__docstring_addendum = """
+
+Additional kwargs: hold = [True|False] overrides default hold state"""
+
## Plotting part 2: autogenerated wrappers for axes methods ##
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def acorr(x, hold=None, **kwargs):
- """call signature::
-
- acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True,
- maxlags=10, **kwargs)
-
-Plot the autocorrelation of *x*. If *normed* = *True*,
-normalize the data by the autocorrelation at 0-th lag. *x* is
-detrended by the *detrend* callable (default no normalization).
-
-Data are plotted as ``plot(lags, c, **kwargs)``
-
-Return value is a tuple (*lags*, *c*, *line*) where:
-
- - *lags* are a length 2*maxlags+1 lag vector
-
- - *c* is the 2*maxlags+1 auto correlation vector
-
- - *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.
-
-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.
-
-*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.
-
-.. seealso::
-
- :meth:`~matplotlib.axes.Axes.plot` or
- :meth:`~matplotlib.axes.Axes.vlines`
- For documentation on valid kwargs.
-
-**Example:**
-
-:func:`~matplotlib.pyplot.xcorr` above, and
-:func:`~matplotlib.pyplot.acorr` below.
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/xcorr_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1687,51 +1632,12 @@
ax.hold(washold)
return ret
+if Axes.acorr.__doc__ is not None:
+ acorr.__doc__ = dedent(Axes.acorr.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def arrow(x, y, dx, dy, hold=None, **kwargs):
- """call signature::
-
- arrow(x, y, dx, dy, **kwargs)
-
-Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*,
-*y* + *dy*).
-
-Optional kwargs control the arrow properties:
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/arrow_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1745,90 +1651,12 @@
ax.hold(washold)
return ret
+if Axes.arrow.__doc__ is not None:
+ arrow.__doc__ = dedent(Axes.arrow.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axhline(y=0, xmin=0, xmax=1, hold=None, **kwargs):
- """call signature::
-
- axhline(y=0, xmin=0, xmax=1, **kwargs)
-
-Axis Horizontal Line
-
-Draw a horizontal line at *y* from *xmin* to *xmax*. With the
-default values of *xmin* = 0 and *xmax* = 1, this line will
-always span the horizontal extent of the axes, regardless of
-the xlim settings, even if you change them, eg. with the
-:meth:`set_xlim` command. That is, the horizontal extent is
-in axes coords: 0=left, 0.5=middle, 1.0=right but the *y*
-location is in data coordinates.
-
-Return value is the :class:`~matplotlib.lines.Line2D`
-instance. kwargs are the same as kwargs to plot, and can be
-used to control the line properties. Eg.,
-
-* draw a thick red hline at *y* = 0 that spans the xrange
-
- >>> axhline(linewidth=4, color='r')
-
-* draw a default hline at *y* = 1 that spans the xrange
-
- >>> axhline(y=1)
-
-* draw a default hline at *y* = .5 that spans the the middle half of
- the xrange
-
- >>> axhline(y=.5, xmin=0.25, xmax=0.75)
-
-Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False]
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color or c: any matplotlib color
- contains: a callable function
- dash_capstyle: ['butt' | 'round' | 'projecting']
- dash_joinstyle: ['miter' | 'round' | 'bevel']
- dashes: sequence of on/off ink in points
- data: 2D array
- drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
- figure: a :class:`matplotlib.figure.Figure` instance
- fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top']
- gid: an id string
- label: any string
- linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'.
- linewidth or lw: float value in points
- lod: [True | False]
- marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ]
- markeredgecolor or mec: any matplotlib color
- markeredgewidth or mew: float value in points
- markerfacecolor or mfc: any matplotlib color
- markersize or ms: float
- markevery: None | integer | (startind, stride)
- picker: float distance in points or callable pick function ``fn(artist, event)``
- pickradius: float distance in points
- rasterized: [True | False | None]
- snap: unknown
- solid_capstyle: ['butt' | 'round' | 'projecting']
- solid_joinstyle: ['miter' | 'round' | 'bevel']
- transform: a :class:`matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- xdata: 1D array
- ydata: 1D array
- zorder: any number
-
-.. seealso::
-
- :meth:`axhspan`
- for example plot and source code
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1842,72 +1670,12 @@
ax.hold(washold)
return ret
+if Axes.axhline.__doc__ is not None:
+ axhline.__doc__ = dedent(Axes.axhline.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axhspan(ymin, ymax, xmin=0, xmax=1, hold=None, **kwargs):
- """call signature::
-
- axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs)
-
-Axis Horizontal Span.
-
-*y* coords are in data units and *x* coords are in axes (relative
-0-1) units.
-
-Draw a horizontal span (rectangle) from *ymin* to *ymax*.
-With the default values of *xmin* = 0 and *xmax* = 1, this
-always spans the xrange, regardless of the xlim settings, even
-if you change them, eg. with the :meth:`set_xlim` command.
-That is, the horizontal extent is in axes coords: 0=left,
-0.5=middle, 1.0=right but the *y* location is in data
-coordinates.
-
-Return value is a :class:`matplotlib.patches.Polygon`
-instance.
-
-Examples:
-
-* draw a gray rectangle from *y* = 0.25-0.75 that spans the
- horizontal extent of the axes
-
- >>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
-
-Valid kwargs are :class:`~matplotlib.patches.Polygon` properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/axhspan_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1921,90 +1689,12 @@
ax.hold(washold)
return ret
+if Axes.axhspan.__doc__ is not None:
+ axhspan.__doc__ = dedent(Axes.axhspan.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axvline(x=0, ymin=0, ymax=1, hold=None, **kwargs):
- """call signature::
-
- axvline(x=0, ymin=0, ymax=1, **kwargs)
-
-Axis Vertical Line
-
-Draw a vertical line at *x* from *ymin* to *ymax*. With the
-default values of *ymin* = 0 and *ymax* = 1, this line will
-always span the vertical extent of the axes, regardless of the
-ylim settings, even if you change them, eg. with the
-:meth:`set_ylim` command. That is, the vertical extent is in
-axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location
-is in data coordinates.
-
-Return value is the :class:`~matplotlib.lines.Line2D`
-instance. kwargs are the same as kwargs to plot, and can be
-used to control the line properties. Eg.,
-
-* draw a thick red vline at *x* = 0 that spans the yrange
-
- >>> axvline(linewidth=4, color='r')
-
-* draw a default vline at *x* = 1 that spans the yrange
-
- >>> axvline(x=1)
-
-* draw a default vline at *x* = .5 that spans the the middle half of
- the yrange
-
- >>> axvline(x=.5, ymin=0.25, ymax=0.75)
-
-Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False]
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color or c: any matplotlib color
- contains: a callable function
- dash_capstyle: ['butt' | 'round' | 'projecting']
- dash_joinstyle: ['miter' | 'round' | 'bevel']
- dashes: sequence of on/off ink in points
- data: 2D array
- drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
- figure: a :class:`matplotlib.figure.Figure` instance
- fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top']
- gid: an id string
- label: any string
- linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'.
- linewidth or lw: float value in points
- lod: [True | False]
- marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ]
- markeredgecolor or mec: any matplotlib color
- markeredgewidth or mew: float value in points
- markerfacecolor or mfc: any matplotlib color
- markersize or ms: float
- markevery: None | integer | (startind, stride)
- picker: float distance in points or callable pick function ``fn(artist, event)``
- pickradius: float distance in points
- rasterized: [True | False | None]
- snap: unknown
- solid_capstyle: ['butt' | 'round' | 'projecting']
- solid_joinstyle: ['miter' | 'round' | 'bevel']
- transform: a :class:`matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- xdata: 1D array
- ydata: 1D array
- zorder: any number
-
-.. seealso::
-
- :meth:`axhspan`
- for example plot and source code
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2018,73 +1708,12 @@
ax.hold(washold)
return ret
+if Axes.axvline.__doc__ is not None:
+ axvline.__doc__ = dedent(Axes.axvline.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axvspan(xmin, xmax, ymin=0, ymax=1, hold=None, **kwargs):
- """call signature::
-
- axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs)
-
-Axis Vertical Span.
-
-*x* coords are in data units and *y* coords are in axes (relative
-0-1) units.
-
-Draw a vertical span (rectangle) from *xmin* to *xmax*. With
-the default values of *ymin* = 0 and *ymax* = 1, this always
-spans the yrange, regardless of the ylim settings, even if you
-change them, eg. with the :meth:`set_ylim` command. That is,
-the vertical extent is in axes coords: 0=bottom, 0.5=middle,
-1.0=top but the *y* location is in data coordinates.
-
-Return value is the :class:`matplotlib.patches.Polygon`
-instance.
-
-Examples:
-
-* draw a vertical green translucent rectangle from x=1.25 to 1.55 that
- spans the yrange of the axes
-
- >>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
-
-Valid kwargs are :class:`~matplotlib.patches.Polygon`
-properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-.. seealso::
-
- :meth:`axhspan`
- for example plot and source code
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2098,110 +1727,12 @@
ax.hold(washold)
return ret
+if Axes.axvspan.__doc__ is not None:
+ axvspan.__doc__ = dedent(Axes.axvspan.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def bar(left, height, width=0.80000000000000004, bottom=None, color=None, edgecolor=None, linewidth=None, yerr=None, xerr=None, ecolor=None, capsize=3, align='edge', orientation='vertical', log=False, hold=None, **kwargs):
- """call signature::
-
- bar(left, height, width=0.8, bottom=0,
- color=None, edgecolor=None, linewidth=None,
- yerr=None, xerr=None, ecolor=None, capsize=3,
- align='edge', orientation='vertical', log=False)
-
-Make a bar plot with rectangles bounded by:
-
- *left*, *left* + *width*, *bottom*, *bottom* + *height*
- (left, right, bottom and top edges)
-
-*left*, *height*, *width*, and *bottom* can be either scalars
-or sequences
-
-Return value is a list of
-:class:`matplotlib.patches.Rectangle` instances.
-
-Required arguments:
-
- ======== ===============================================
- Argument Description
- ======== ===============================================
- *left* the x coordinates of the left sides of the bars
- *height* the heights of the bars
- ======== ===============================================
-
-Optional keyword arguments:
-
- =============== ==========================================
- Keyword Description
- =============== ==========================================
- *width* the widths of the bars
- *bottom* the y coordinates of the bottom edges of
- the bars
- *color* the colors of the bars
- *edgecolor* the colors of the bar edges
- *linewidth* width of bar edges; None means use default
- linewidth; 0 means don't draw edges.
- *xerr* if not None, will be used to generate
- errorbars on the bar chart
- *yerr* if not None, will be used to generate
- errorbars on the bar chart
- *ecolor* specifies the color of any errorbar
- *capsize* (default 3) determines the length in
- points of the error bar caps
- *align* 'edge' (default) | 'center'
- *orientation* 'vertical' | 'horizontal'
- *log* [False|True] False (default) leaves the
- orientation axis as-is; True sets it to
- log scale
- =============== ==========================================
-
-For vertical bars, *align* = 'edge' aligns bars by their left
-edges in left, while *align* = 'center' interprets these
-values as the *x* coordinates of the bar centers. For
-horizontal bars, *align* = 'edge' aligns bars by their bottom
-edges in bottom, while *align* = 'center' interprets these
-values as the *y* coordinates of the bar centers.
-
-The optional arguments *color*, *edgecolor*, *linewidth*,
-*xerr*, and *yerr* can be either scalars or sequences of
-length equal to the number of bars. This enables you to use
-bar as the basis for stacked bar charts, or candlestick plots.
-
-Other optional kwargs:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-**Example:** A stacked bar chart.
-
-.. plot:: mpl_examples/pylab_examples/bar_stacked.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2215,100 +1746,12 @@
ax.hold(washold)
return ret
+if Axes.bar.__doc__ is not None:
+ bar.__doc__ = dedent(Axes.bar.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def barh(bottom, width, height=0.80000000000000004, left=None, hold=None, **kwargs):
- """call signature::
-
- barh(bottom, width, height=0.8, left=0, **kwargs)
-
-Make a horizontal bar plot with rectangles bounded by:
-
- *left*, *left* + *width*, *bottom*, *bottom* + *height*
- (left, right, bottom and top edges)
-
-*bottom*, *width*, *height*, and *left* can be either scalars
-or sequences
-
-Return value is a list of
-:class:`matplotlib.patches.Rectangle` instances.
-
-Required arguments:
-
- ======== ======================================================
- Argument Description
- ======== ======================================================
- *bottom* the vertical positions of the bottom edges of the bars
- *width* the lengths of the bars
- ======== ======================================================
-
-Optional keyword arguments:
-
- =============== ==========================================
- Keyword Description
- =============== ==========================================
- *height* the heights (thicknesses) of the bars
- *left* the x coordinates of the left edges of the
- bars
- *color* the colors of the bars
- *edgecolor* the colors of the bar edges
- *linewidth* width of bar edges; None means use default
- linewidth; 0 means don't draw edges.
- *xerr* if not None, will be used to generate
- errorbars on the bar chart
- *yerr* if not None, will be used to generate
- errorbars on the bar chart
- *ecolor* specifies the color of any errorbar
- *capsize* (default 3) determines the length in
- points of the error bar caps
- *align* 'edge' (default) | 'center'
- *log* [False|True] False (default) leaves the
- horizontal axis as-is; True sets it to log
- scale
- =============== ==========================================
-
-Setting *align* = 'edge' aligns bars by their bottom edges in
-bottom, while *align* = 'center' interprets these values as
-the *y* coordinates of the bar centers.
-
-The optional arguments *color*, *edgecolor*, *linewidth*,
-*xerr*, and *yerr* can be either scalars or sequences of
-length equal to the number of bars. This enables you to use
-barh as the basis for stacked bar charts, or candlestick
-plots.
-
-other optional kwargs:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2322,77 +1765,12 @@
ax.hold(washold)
return ret
+if Axes.barh.__doc__ is not None:
+ barh.__doc__ = dedent(Axes.barh.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def broken_barh(xranges, yrange, hold=None, **kwargs):
- """call signature::
-
- broken_barh(self, xranges, yrange, **kwargs)
-
-A collection of horizontal bars spanning *yrange* with a sequence of
-*xranges*.
-
-Required arguments:
-
- ========= ==============================
- Argument Description
- ========= ==============================
- *xranges* sequence of (*xmin*, *xwidth*)
- *yrange* sequence of (*ymin*, *ywidth*)
- ========= ==============================
-
-kwargs are
-:class:`matplotlib.collections.BrokenBarHCollection`
-properties:
-
- alpha: float
- animated: [True | False]
- antialiased or antialiaseds: Boolean or sequence of booleans
- array: unknown
- axes: an :class:`~matplotlib.axes.Axes` instance
- clim: a length 2 sequence of floats
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- cmap: a colormap
- color: matplotlib color arg or sequence of rgba tuples
- colorbar: unknown
- contains: a callable function
- edgecolor or edgecolors: matplotlib color arg or sequence of rgba tuples
- facecolor or facecolors: matplotlib color arg or sequence of rgba tuples
- figure: a :class:`matplotlib.figure.Figure` instance
- gid: an id string
- label: any string
- linestyle or linestyles or dashes: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- linewidth or lw or linewidths: float or sequence of floats
- lod: [True | False]
- norm: unknown
- offsets: float or sequence of floats
- picker: [None|float|boolean|callable]
- pickradius: unknown
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- urls: unknown
- visible: [True | False]
- zorder: any number
-
-these can either be a single argument, ie::
-
- facecolors = 'black'
-
-or a sequence of arguments for the various bars, ie::
-
- facecolors = ('black', 'red', 'green')
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/broken_barh.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2406,55 +1784,12 @@
ax.hold(washold)
return ret
+if Axes.broken_barh.__doc__ is not None:
+ broken_barh.__doc__ = dedent(Axes.broken_barh.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def boxplot(x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None, hold=None):
- """call signature::
-
- boxplot(x, notch=0, sym='+', vert=1, whis=1.5,
- positions=None, widths=None)
-
-Make a box and whisker plot for each column of *x* or each
-vector in sequence *x*. The box extends from the lower to
-upper quartile values of the data, with a line at the median.
-The whiskers extend from the box to show the range of the
-data. Flier points are those past the end of the whiskers.
-
-- *notch* = 0 (default) produces a rectangular box plot.
-- *notch* = 1 will produce a notched box plot
-
-*sym* (default 'b+') is the default symbol for flier points.
-Enter an empty string ('') if you don't want to show fliers.
-
-- *vert* = 1 (default) makes the boxes vertical.
-- *vert* = 0 makes horizontal boxes. This seems goofy, but
- that's how Matlab did it.
-
-*whis* (default 1.5) defines the length of the whiskers as
-a function of the inner quartile range. They extend to the
-most extreme data point within ( ``whis*(75%-25%)`` ) data range.
-
-*positions* (default 1,2,...,n) sets the horizontal positions of
-the boxes. The ticks and limits are automatically set to match
-the positions.
-
-*widths* is either a scalar or a vector and sets the width of
-each box. The default is 0.5, or ``0.15*(distance between extreme
-positions)`` if that is smaller.
-
-*x* is an array or a sequence of vectors.
-
-Returns a dictionary mapping each component of the boxplot
-to a list of the :class:`matplotlib.lines.Line2D`
-instances created.
-
-**Example:**
-
-.. plot:: pyplots/boxplot_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2468,145 +1803,12 @@
ax.hold(washold)
return ret
+if Axes.boxplot.__doc__ is not None:
+ boxplot.__doc__ = dedent(Axes.boxplot.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=0, pad_to=None, sides='default', scale_by_freq=None, hold=None, **kwargs):
- """call signature::
-
- cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend = mlab.detrend_none,
- window = mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', scale_by_freq=None, **kwargs)
-
-cohere the coherence between *x* and *y*. Coherence is the normalized
-cross spectral density:
-
-.. math::
-
- C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
-
-Keyword arguments:
-
- *NFFT*: integer
- The number of data points used in each block for the FFT.
- Must be even; a power 2 is most efficient. The default value is 256.
-
- *Fs*: scalar
- The sampling frequency (samples per time unit). It is used
- to calculate the Fourier frequencies, freqs, in cycles per time
- unit. The default value is 2.
-
- *detrend*: callable
- The function applied to each segment before fft-ing,
- designed to remove the mean or linear trend. Unlike in
- matlab, where the *detrend* parameter is a vector, in
- matplotlib is it a function. The :mod:`~matplotlib.pylab`
- module defines :func:`~matplotlib.pylab.detrend_none`,
- :func:`~matplotlib.pylab.detrend_mean`, and
- :func:`~matplotlib.pylab.detrend_linear`, but you can use
- a custom function as well.
-
- *window*: callable or ndarray
- A function or a vector of length *NFFT*. To create window
- vectors see :func:`window_hanning`, :func:`window_none`,
- :func:`numpy.blackman`, :func:`numpy.hamming`,
- :func:`numpy.bartlett`, :func:`scipy.signal`,
- :func:`scipy.signal.get_window`, etc. The default is
- :func:`window_hanning`. If a function is passed as the
- argument, it must take a data segment as an argument and
- return the windowed version of the segment.
-
- *noverlap*: integer
- The number of points of overlap between blocks. The default value
- is 0 (no overlap).
-
- *pad_to*: integer
- The number of points to which the data segment is padded when
- performing the FFT. This can be different from *NFFT*, which
- specifies the number of data points used. While not increasing
- the actual resolution of the psd (the minimum distance between
- resolvable peaks), this can give more points in the plot,
- allowing for more detail. This corresponds to the *n* parameter
- in the call to fft(). The default is None, which sets *pad_to*
- equal to *NFFT*
-
- *sides*: [ 'default' | 'onesided' | 'twosided' ]
- Specifies which sides of the PSD to return. Default gives the
- default behavior, which returns one-sided for real data and both
- for complex data. 'onesided' forces the return of a one-sided PSD,
- while 'twosided' forces two-sided.
-
- *scale_by_freq*: boolean
- Specifies whether the resulting density values should be scaled
- by the scaling frequency, which gives density in units of Hz^-1.
- This allows for integration over the returned frequency values.
- The default is True for MatLab compatibility.
-
- *Fc*: integer
- The center frequency of *x* (defaults to 0), which offsets
- the x extents of the plot to reflect the frequency range used
- when a signal is acquired and then filtered and downsampled to
- baseband.
-
-The return value is a tuple (*Cxy*, *f*), where *f* are the
-frequencies of the coherence vector.
-
-kwargs are applied to the lines.
-
-References:
-
- * Bendat & Piersol -- Random Data: Analysis and Measurement
- Procedures, John Wiley & Sons (1986)
-
-kwargs control the :class:`~matplotlib.lines.Line2D`
-properties of the coherence plot:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False]
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color or c: any matplotlib color
- contains: a callable function
- dash_capstyle: ['butt' | 'round' | 'projecting']
- dash_joinstyle: ['miter' | 'round' | 'bevel']
- dashes: sequence of on/off ink in points
- data: 2D array
- drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
- figure: a :class:`matplotlib.figure.Figure` instance
- fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top']
- gid: an id string
- label: any string
- linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'.
- linewidth or lw: float value in points
- lod: [True | False]
- marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ]
- markeredgecolor or mec: any matplotlib color
- markeredgewidth or mew: float value in points
- markerfacecolor or mfc: any matplotlib color
- markersize or ms: float
- markevery: None | integer | (startind, stride)
- picker: float distance in points or callable pick function ``fn(artist, event)``
- pickradius: float distance in points
- rasterized: [True | False | None]
- snap: unknown
- solid_capstyle: ['butt' | 'round' | 'projecting']
- solid_joinstyle: ['miter' | 'round' | 'bevel']
- transform: a :class:`matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- xdata: 1D array
- ydata: 1D array
- zorder: any number
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/cohere_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2620,75 +1822,12 @@
ax.hold(washold)
return ret
+if Axes.cohere.__doc__ is not None:
+ cohere.__doc__ = dedent(Axes.cohere.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def clabel(CS, *args, **kwargs):
- """call signature::
-
- clabel(cs, **kwargs)
-
-adds labels to line contours in *cs*, where *cs* is a
-:class:`~matplotlib.contour.ContourSet` object returned by
-contour.
-
-::
-
- clabel(cs, v, **kwargs)
-
-only labels contours listed in *v*.
-
-Optional keyword arguments:
-
- *fontsize*:
- See http://matplotlib.sf.net/fonts.html
-
- *colors*:
- - if *None*, the color of each label matches the color of
- the corresponding contour
-
- - if one string color, e.g. *colors* = 'r' or *colors* =
- 'red', all labels will be plotted in this color
-
- - if a tuple of matplotlib color args (string, float, rgb, etc),
- different labels will be plotted in different colors in the order
- specified
-
- *inline*:
- controls whether the underlying contour is removed or
- not. Default is *True*.
-
- *inline_spacing*:
- space in pixels to leave on each side of label when
- placing inline. Defaults to 5. This spacing will be
- exact for labels at locations where the contour is
- straight, less so for labels on curved contours.
-
- *fmt*:
- a format string for the label. Default is '%1.3f'
- Alternatively, this can be a dictionary matching contour
- levels with arbitrary strings to use for each contour level
- (i.e., fmt[level]=string)
-
- *manual*:
- if *True*, contour labels will be placed manually using
- mouse clicks. Click the first button near a contour to
- add a label, click the second button (or potentially both
- mouse buttons at once) to finish adding labels. The third
- button can be used to remove the last label added, but
- only if labels are not inline. Alternatively, the keyboard
- can be used to select label locations (enter to end label
- placement, delete or backspace act like the third mouse button,
- and any other key will select a label location).
-
- *rightside_up*:
- if *True* (default), label rotations will always be plus
- or minus 90 degrees from level.
-
-.. plot:: mpl_examples/pylab_examples/contour_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2702,172 +1841,12 @@
ax.hold(washold)
return ret
+if Axes.clabel.__doc__ is not None:
+ clabel.__doc__ = dedent(Axes.clabel.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def contour(*args, **kwargs):
- """:func:`~matplotlib.pyplot.contour` and
-:func:`~matplotlib.pyplot.contourf` draw contour lines and
-filled contours, respectively. Except as noted, function
-signatures and return values are the same for both versions.
-
-:func:`~matplotlib.pyplot.contourf` differs from the Matlab
-(TM) version in that it does not draw the polygon edges,
-because the contouring engine yields simply connected regions
-with branch cuts. To draw the edges, add line contours with
-calls to :func:`~matplotlib.pyplot.contour`.
-
-
-call signatures::
-
- contour(Z)
-
-make a contour plot of an array *Z*. The level values are chosen
-automatically.
-
-::
-
- contour(X,Y,Z)
-
-*X*, *Y* specify the (*x*, *y*) coordinates of the surface
-
-::
-
- contour(Z,N)
- contour(X,Y,Z,N)
-
-contour *N* automatically-chosen levels.
-
-::
-
- contour(Z,V)
- contour(X,Y,Z,V)
-
-draw contour lines at the values specified in sequence *V*
-
-::
-
- contourf(..., V)
-
-fill the (len(*V*)-1) regions between the values in *V*
-
-::
-
- contour(Z, **kwargs)
-
-Use keyword args to control colors, linewidth, origin, cmap ... see
-below for more details.
-
-*X*, *Y*, and *Z* must be arrays with the same dimensions.
-
-*Z* may be a masked array, but filled contouring may not
-handle internal masked regions correctly.
-
-``C = contour(...)`` returns a
-:class:`~matplotlib.contour.ContourSet` object.
-
-Optional keyword arguments:
-
- *colors*: [ None | string | (mpl_colors) ]
- If *None*, the colormap specified by cmap will be used.
-
- If a string, like 'r' or 'red', all levels will be plotted in this
- color.
-
- If a tuple of matplotlib color args (string, float, rgb, etc),
- different levels will be plotted in different colors in the order
- specified.
-
- *alpha*: float
- The alpha blending value
-
- *cmap*: [ None | Colormap ]
- A cm :class:`~matplotlib.cm.Colormap` instance or
- *None*. If *cmap* is *None* and *colors* is *None*, a
- default Colormap is used.
-
- *norm*: [ None | Normalize ]
- A :class:`matplotlib.colors.Normalize` instance for
- scaling data values to colors. If *norm* is *None* and
- *colors* is *None*, the default linear scaling is used.
-
- *origin*: [ None | 'upper' | 'lower' | 'image' ]
- If *None*, the first value of *Z* will correspond to the
- lower left corner, location (0,0). If 'image', the rc
- value for ``image.origin`` will be used.
-
- This keyword is not active if *X* and *Y* are specified in
- the call to contour.
-
- *extent*: [ None | (x0,x1,y0,y1) ]
-
- If *origin* is not *None*, then *extent* is interpreted as
- in :func:`matplotlib.pyplot.imshow`: it gives the outer
- pixel boundaries. In this case, the position of Z[0,0]
- is the center of the pixel, not a corner. If *origin* is
- *None*, then (*x0*, *y0*) is the position of Z[0,0], and
- (*x1*, *y1*) is the position of Z[-1,-1].
-
- This keyword is not active if *X* and *Y* are specified in
- the call to contour.
-
- *locator*: [ None | ticker.Locator subclass ]
- If *locator* is None, the default
- :class:`~matplotlib.ticker.MaxNLocator` is used. The
- locator is used to determine the cont...
[truncated message content] |
|
From: <jo...@us...> - 2009-08-03 19:41:43
|
Revision: 7338
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7338&view=rev
Author: jouni
Date: 2009-08-03 19:41:32 +0000 (Mon, 03 Aug 2009)
Log Message:
-----------
Fixed boilerplate.py so it doesn't break the ReST docs.
Modified Paths:
--------------
branches/v0_99_maint/CHANGELOG
branches/v0_99_maint/boilerplate.py
branches/v0_99_maint/lib/matplotlib/pyplot.py
Modified: branches/v0_99_maint/CHANGELOG
===================================================================
--- branches/v0_99_maint/CHANGELOG 2009-08-03 19:31:05 UTC (rev 7337)
+++ branches/v0_99_maint/CHANGELOG 2009-08-03 19:41:32 UTC (rev 7338)
@@ -1,3 +1,5 @@
+2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS
+
======================================================================
2009-07-31 Tagging 0.99.0.rc1 at 7314 - MGD
Modified: branches/v0_99_maint/boilerplate.py
===================================================================
--- branches/v0_99_maint/boilerplate.py 2009-08-03 19:31:05 UTC (rev 7337)
+++ branches/v0_99_maint/boilerplate.py 2009-08-03 19:41:32 UTC (rev 7338)
@@ -21,7 +21,6 @@
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def %(func)s(%(argspec)s):
- %(docstring)s
%(ax)s = gca()
# allow callers to override the hold state by passing hold=True|False
%(washold)s = %(ax)s.ishold()
@@ -35,16 +34,19 @@
%(ax)s.hold(%(washold)s)
%(mappable)s
return %(ret)s
+if Axes.%(func)s.__doc__ is not None:
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + __docstring_addendum
"""
_fmtmisc = """\
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def %(func)s(%(argspec)s):
- %(docstring)s
%(ret)s = gca().%(func)s(%(call)s)
draw_if_interactive()
return %(ret)s
+if Axes.%(func)s.__doc__ is not None:
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__)
"""
# these methods are all simple wrappers of Axes methods by the same
@@ -138,19 +140,6 @@
"""
return '\n'.join(x.rstrip() for x in string.split('\n'))
-def make_docstring(cmd, mention_hold):
- func = getattr(Axes, cmd)
- docstring = inspect.getdoc(func)
- if docstring is None:
- return ""
- escaped = re.sub(r'\\', r'\\\\', docstring)
- if mention_hold:
- escaped += '''
-
-Additional kwargs: hold = [True|False] overrides default hold state
-'''
- return '"""'+escaped+'"""'
-
for fmt,cmdlist in (_fmtplot,_plotcommands),(_fmtmisc,_misccommands):
for func in cmdlist:
# For some commands, an additional line is needed to set the
@@ -160,9 +149,6 @@
else:
mappable = ''
- # Format docstring
- docstring = make_docstring(func, fmt is _fmtplot)
-
# Get argspec of wrapped function
args, varargs, varkw, defaults = inspect.getargspec(getattr(Axes, func))
args.pop(0) # remove 'self' argument
Modified: branches/v0_99_maint/lib/matplotlib/pyplot.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/pyplot.py 2009-08-03 19:31:05 UTC (rev 7337)
+++ branches/v0_99_maint/lib/matplotlib/pyplot.py 2009-08-03 19:41:32 UTC (rev 7338)
@@ -1608,72 +1608,17 @@
draw_if_interactive()
+# This is added to docstrings of autogenerated plotting functions
+__docstring_addendum = """
+
+Additional kwargs: hold = [True|False] overrides default hold state"""
+
## Plotting part 2: autogenerated wrappers for axes methods ##
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def acorr(x, hold=None, **kwargs):
- """call signature::
-
- acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True,
- maxlags=10, **kwargs)
-
-Plot the autocorrelation of *x*. If *normed* = *True*,
-normalize the data by the autocorrelation at 0-th lag. *x* is
-detrended by the *detrend* callable (default no normalization).
-
-Data are plotted as ``plot(lags, c, **kwargs)``
-
-Return value is a tuple (*lags*, *c*, *line*) where:
-
- - *lags* are a length 2*maxlags+1 lag vector
-
- - *c* is the 2*maxlags+1 auto correlation vector
-
- - *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.
-
-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.
-
-*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.
-
-.. seealso::
-
- :meth:`~matplotlib.axes.Axes.plot` or
- :meth:`~matplotlib.axes.Axes.vlines`
- For documentation on valid kwargs.
-
-**Example:**
-
-:func:`~matplotlib.pyplot.xcorr` above, and
-:func:`~matplotlib.pyplot.acorr` below.
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/xcorr_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1687,51 +1632,12 @@
ax.hold(washold)
return ret
+if Axes.acorr.__doc__ is not None:
+ acorr.__doc__ = dedent(Axes.acorr.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def arrow(x, y, dx, dy, hold=None, **kwargs):
- """call signature::
-
- arrow(x, y, dx, dy, **kwargs)
-
-Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*,
-*y* + *dy*).
-
-Optional kwargs control the arrow properties:
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/arrow_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1745,90 +1651,12 @@
ax.hold(washold)
return ret
+if Axes.arrow.__doc__ is not None:
+ arrow.__doc__ = dedent(Axes.arrow.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axhline(y=0, xmin=0, xmax=1, hold=None, **kwargs):
- """call signature::
-
- axhline(y=0, xmin=0, xmax=1, **kwargs)
-
-Axis Horizontal Line
-
-Draw a horizontal line at *y* from *xmin* to *xmax*. With the
-default values of *xmin* = 0 and *xmax* = 1, this line will
-always span the horizontal extent of the axes, regardless of
-the xlim settings, even if you change them, eg. with the
-:meth:`set_xlim` command. That is, the horizontal extent is
-in axes coords: 0=left, 0.5=middle, 1.0=right but the *y*
-location is in data coordinates.
-
-Return value is the :class:`~matplotlib.lines.Line2D`
-instance. kwargs are the same as kwargs to plot, and can be
-used to control the line properties. Eg.,
-
-* draw a thick red hline at *y* = 0 that spans the xrange
-
- >>> axhline(linewidth=4, color='r')
-
-* draw a default hline at *y* = 1 that spans the xrange
-
- >>> axhline(y=1)
-
-* draw a default hline at *y* = .5 that spans the the middle half of
- the xrange
-
- >>> axhline(y=.5, xmin=0.25, xmax=0.75)
-
-Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False]
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color or c: any matplotlib color
- contains: a callable function
- dash_capstyle: ['butt' | 'round' | 'projecting']
- dash_joinstyle: ['miter' | 'round' | 'bevel']
- dashes: sequence of on/off ink in points
- data: 2D array
- drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
- figure: a :class:`matplotlib.figure.Figure` instance
- fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top']
- gid: an id string
- label: any string
- linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'.
- linewidth or lw: float value in points
- lod: [True | False]
- marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ]
- markeredgecolor or mec: any matplotlib color
- markeredgewidth or mew: float value in points
- markerfacecolor or mfc: any matplotlib color
- markersize or ms: float
- markevery: None | integer | (startind, stride)
- picker: float distance in points or callable pick function ``fn(artist, event)``
- pickradius: float distance in points
- rasterized: [True | False | None]
- snap: unknown
- solid_capstyle: ['butt' | 'round' | 'projecting']
- solid_joinstyle: ['miter' | 'round' | 'bevel']
- transform: a :class:`matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- xdata: 1D array
- ydata: 1D array
- zorder: any number
-
-.. seealso::
-
- :meth:`axhspan`
- for example plot and source code
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1842,72 +1670,12 @@
ax.hold(washold)
return ret
+if Axes.axhline.__doc__ is not None:
+ axhline.__doc__ = dedent(Axes.axhline.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axhspan(ymin, ymax, xmin=0, xmax=1, hold=None, **kwargs):
- """call signature::
-
- axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs)
-
-Axis Horizontal Span.
-
-*y* coords are in data units and *x* coords are in axes (relative
-0-1) units.
-
-Draw a horizontal span (rectangle) from *ymin* to *ymax*.
-With the default values of *xmin* = 0 and *xmax* = 1, this
-always spans the xrange, regardless of the xlim settings, even
-if you change them, eg. with the :meth:`set_xlim` command.
-That is, the horizontal extent is in axes coords: 0=left,
-0.5=middle, 1.0=right but the *y* location is in data
-coordinates.
-
-Return value is a :class:`matplotlib.patches.Polygon`
-instance.
-
-Examples:
-
-* draw a gray rectangle from *y* = 0.25-0.75 that spans the
- horizontal extent of the axes
-
- >>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
-
-Valid kwargs are :class:`~matplotlib.patches.Polygon` properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/axhspan_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -1921,90 +1689,12 @@
ax.hold(washold)
return ret
+if Axes.axhspan.__doc__ is not None:
+ axhspan.__doc__ = dedent(Axes.axhspan.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axvline(x=0, ymin=0, ymax=1, hold=None, **kwargs):
- """call signature::
-
- axvline(x=0, ymin=0, ymax=1, **kwargs)
-
-Axis Vertical Line
-
-Draw a vertical line at *x* from *ymin* to *ymax*. With the
-default values of *ymin* = 0 and *ymax* = 1, this line will
-always span the vertical extent of the axes, regardless of the
-ylim settings, even if you change them, eg. with the
-:meth:`set_ylim` command. That is, the vertical extent is in
-axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location
-is in data coordinates.
-
-Return value is the :class:`~matplotlib.lines.Line2D`
-instance. kwargs are the same as kwargs to plot, and can be
-used to control the line properties. Eg.,
-
-* draw a thick red vline at *x* = 0 that spans the yrange
-
- >>> axvline(linewidth=4, color='r')
-
-* draw a default vline at *x* = 1 that spans the yrange
-
- >>> axvline(x=1)
-
-* draw a default vline at *x* = .5 that spans the the middle half of
- the yrange
-
- >>> axvline(x=.5, ymin=0.25, ymax=0.75)
-
-Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False]
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color or c: any matplotlib color
- contains: a callable function
- dash_capstyle: ['butt' | 'round' | 'projecting']
- dash_joinstyle: ['miter' | 'round' | 'bevel']
- dashes: sequence of on/off ink in points
- data: 2D array
- drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
- figure: a :class:`matplotlib.figure.Figure` instance
- fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top']
- gid: an id string
- label: any string
- linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'.
- linewidth or lw: float value in points
- lod: [True | False]
- marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ]
- markeredgecolor or mec: any matplotlib color
- markeredgewidth or mew: float value in points
- markerfacecolor or mfc: any matplotlib color
- markersize or ms: float
- markevery: None | integer | (startind, stride)
- picker: float distance in points or callable pick function ``fn(artist, event)``
- pickradius: float distance in points
- rasterized: [True | False | None]
- snap: unknown
- solid_capstyle: ['butt' | 'round' | 'projecting']
- solid_joinstyle: ['miter' | 'round' | 'bevel']
- transform: a :class:`matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- xdata: 1D array
- ydata: 1D array
- zorder: any number
-
-.. seealso::
-
- :meth:`axhspan`
- for example plot and source code
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2018,73 +1708,12 @@
ax.hold(washold)
return ret
+if Axes.axvline.__doc__ is not None:
+ axvline.__doc__ = dedent(Axes.axvline.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def axvspan(xmin, xmax, ymin=0, ymax=1, hold=None, **kwargs):
- """call signature::
-
- axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs)
-
-Axis Vertical Span.
-
-*x* coords are in data units and *y* coords are in axes (relative
-0-1) units.
-
-Draw a vertical span (rectangle) from *xmin* to *xmax*. With
-the default values of *ymin* = 0 and *ymax* = 1, this always
-spans the yrange, regardless of the ylim settings, even if you
-change them, eg. with the :meth:`set_ylim` command. That is,
-the vertical extent is in axes coords: 0=bottom, 0.5=middle,
-1.0=top but the *y* location is in data coordinates.
-
-Return value is the :class:`matplotlib.patches.Polygon`
-instance.
-
-Examples:
-
-* draw a vertical green translucent rectangle from x=1.25 to 1.55 that
- spans the yrange of the axes
-
- >>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
-
-Valid kwargs are :class:`~matplotlib.patches.Polygon`
-properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-.. seealso::
-
- :meth:`axhspan`
- for example plot and source code
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2098,110 +1727,12 @@
ax.hold(washold)
return ret
+if Axes.axvspan.__doc__ is not None:
+ axvspan.__doc__ = dedent(Axes.axvspan.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def bar(left, height, width=0.80000000000000004, bottom=None, color=None, edgecolor=None, linewidth=None, yerr=None, xerr=None, ecolor=None, capsize=3, align='edge', orientation='vertical', log=False, hold=None, **kwargs):
- """call signature::
-
- bar(left, height, width=0.8, bottom=0,
- color=None, edgecolor=None, linewidth=None,
- yerr=None, xerr=None, ecolor=None, capsize=3,
- align='edge', orientation='vertical', log=False)
-
-Make a bar plot with rectangles bounded by:
-
- *left*, *left* + *width*, *bottom*, *bottom* + *height*
- (left, right, bottom and top edges)
-
-*left*, *height*, *width*, and *bottom* can be either scalars
-or sequences
-
-Return value is a list of
-:class:`matplotlib.patches.Rectangle` instances.
-
-Required arguments:
-
- ======== ===============================================
- Argument Description
- ======== ===============================================
- *left* the x coordinates of the left sides of the bars
- *height* the heights of the bars
- ======== ===============================================
-
-Optional keyword arguments:
-
- =============== ==========================================
- Keyword Description
- =============== ==========================================
- *width* the widths of the bars
- *bottom* the y coordinates of the bottom edges of
- the bars
- *color* the colors of the bars
- *edgecolor* the colors of the bar edges
- *linewidth* width of bar edges; None means use default
- linewidth; 0 means don't draw edges.
- *xerr* if not None, will be used to generate
- errorbars on the bar chart
- *yerr* if not None, will be used to generate
- errorbars on the bar chart
- *ecolor* specifies the color of any errorbar
- *capsize* (default 3) determines the length in
- points of the error bar caps
- *align* 'edge' (default) | 'center'
- *orientation* 'vertical' | 'horizontal'
- *log* [False|True] False (default) leaves the
- orientation axis as-is; True sets it to
- log scale
- =============== ==========================================
-
-For vertical bars, *align* = 'edge' aligns bars by their left
-edges in left, while *align* = 'center' interprets these
-values as the *x* coordinates of the bar centers. For
-horizontal bars, *align* = 'edge' aligns bars by their bottom
-edges in bottom, while *align* = 'center' interprets these
-values as the *y* coordinates of the bar centers.
-
-The optional arguments *color*, *edgecolor*, *linewidth*,
-*xerr*, and *yerr* can be either scalars or sequences of
-length equal to the number of bars. This enables you to use
-bar as the basis for stacked bar charts, or candlestick plots.
-
-Other optional kwargs:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-**Example:** A stacked bar chart.
-
-.. plot:: mpl_examples/pylab_examples/bar_stacked.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2215,100 +1746,12 @@
ax.hold(washold)
return ret
+if Axes.bar.__doc__ is not None:
+ bar.__doc__ = dedent(Axes.bar.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def barh(bottom, width, height=0.80000000000000004, left=None, hold=None, **kwargs):
- """call signature::
-
- barh(bottom, width, height=0.8, left=0, **kwargs)
-
-Make a horizontal bar plot with rectangles bounded by:
-
- *left*, *left* + *width*, *bottom*, *bottom* + *height*
- (left, right, bottom and top edges)
-
-*bottom*, *width*, *height*, and *left* can be either scalars
-or sequences
-
-Return value is a list of
-:class:`matplotlib.patches.Rectangle` instances.
-
-Required arguments:
-
- ======== ======================================================
- Argument Description
- ======== ======================================================
- *bottom* the vertical positions of the bottom edges of the bars
- *width* the lengths of the bars
- ======== ======================================================
-
-Optional keyword arguments:
-
- =============== ==========================================
- Keyword Description
- =============== ==========================================
- *height* the heights (thicknesses) of the bars
- *left* the x coordinates of the left edges of the
- bars
- *color* the colors of the bars
- *edgecolor* the colors of the bar edges
- *linewidth* width of bar edges; None means use default
- linewidth; 0 means don't draw edges.
- *xerr* if not None, will be used to generate
- errorbars on the bar chart
- *yerr* if not None, will be used to generate
- errorbars on the bar chart
- *ecolor* specifies the color of any errorbar
- *capsize* (default 3) determines the length in
- points of the error bar caps
- *align* 'edge' (default) | 'center'
- *log* [False|True] False (default) leaves the
- horizontal axis as-is; True sets it to log
- scale
- =============== ==========================================
-
-Setting *align* = 'edge' aligns bars by their bottom edges in
-bottom, while *align* = 'center' interprets these values as
-the *y* coordinates of the bar centers.
-
-The optional arguments *color*, *edgecolor*, *linewidth*,
-*xerr*, and *yerr* can be either scalars or sequences of
-length equal to the number of bars. This enables you to use
-barh as the basis for stacked bar charts, or candlestick
-plots.
-
-other optional kwargs:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False] or None for default
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color: matplotlib color arg or sequence of rgba tuples
- contains: a callable function
- edgecolor or ec: mpl color spec, or None for default, or 'none' for no color
- facecolor or fc: mpl color spec, or None for default, or 'none' for no color
- figure: a :class:`matplotlib.figure.Figure` instance
- fill: [True | False]
- gid: an id string
- hatch: [ '/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ]
- label: any string
- linestyle or ls: ['solid' | 'dashed' | 'dashdot' | 'dotted']
- linewidth or lw: float or None for default
- lod: [True | False]
- picker: [None|float|boolean|callable]
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- zorder: any number
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2322,77 +1765,12 @@
ax.hold(washold)
return ret
+if Axes.barh.__doc__ is not None:
+ barh.__doc__ = dedent(Axes.barh.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def broken_barh(xranges, yrange, hold=None, **kwargs):
- """call signature::
-
- broken_barh(self, xranges, yrange, **kwargs)
-
-A collection of horizontal bars spanning *yrange* with a sequence of
-*xranges*.
-
-Required arguments:
-
- ========= ==============================
- Argument Description
- ========= ==============================
- *xranges* sequence of (*xmin*, *xwidth*)
- *yrange* sequence of (*ymin*, *ywidth*)
- ========= ==============================
-
-kwargs are
-:class:`matplotlib.collections.BrokenBarHCollection`
-properties:
-
- alpha: float
- animated: [True | False]
- antialiased or antialiaseds: Boolean or sequence of booleans
- array: unknown
- axes: an :class:`~matplotlib.axes.Axes` instance
- clim: a length 2 sequence of floats
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- cmap: a colormap
- color: matplotlib color arg or sequence of rgba tuples
- colorbar: unknown
- contains: a callable function
- edgecolor or edgecolors: matplotlib color arg or sequence of rgba tuples
- facecolor or facecolors: matplotlib color arg or sequence of rgba tuples
- figure: a :class:`matplotlib.figure.Figure` instance
- gid: an id string
- label: any string
- linestyle or linestyles or dashes: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- linewidth or lw or linewidths: float or sequence of floats
- lod: [True | False]
- norm: unknown
- offsets: float or sequence of floats
- picker: [None|float|boolean|callable]
- pickradius: unknown
- rasterized: [True | False | None]
- snap: unknown
- transform: :class:`~matplotlib.transforms.Transform` instance
- url: a url string
- urls: unknown
- visible: [True | False]
- zorder: any number
-
-these can either be a single argument, ie::
-
- facecolors = 'black'
-
-or a sequence of arguments for the various bars, ie::
-
- facecolors = ('black', 'red', 'green')
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/broken_barh.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2406,55 +1784,12 @@
ax.hold(washold)
return ret
+if Axes.broken_barh.__doc__ is not None:
+ broken_barh.__doc__ = dedent(Axes.broken_barh.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def boxplot(x, notch=0, sym='b+', vert=1, whis=1.5, positions=None, widths=None, hold=None):
- """call signature::
-
- boxplot(x, notch=0, sym='+', vert=1, whis=1.5,
- positions=None, widths=None)
-
-Make a box and whisker plot for each column of *x* or each
-vector in sequence *x*. The box extends from the lower to
-upper quartile values of the data, with a line at the median.
-The whiskers extend from the box to show the range of the
-data. Flier points are those past the end of the whiskers.
-
-- *notch* = 0 (default) produces a rectangular box plot.
-- *notch* = 1 will produce a notched box plot
-
-*sym* (default 'b+') is the default symbol for flier points.
-Enter an empty string ('') if you don't want to show fliers.
-
-- *vert* = 1 (default) makes the boxes vertical.
-- *vert* = 0 makes horizontal boxes. This seems goofy, but
- that's how Matlab did it.
-
-*whis* (default 1.5) defines the length of the whiskers as
-a function of the inner quartile range. They extend to the
-most extreme data point within ( ``whis*(75%-25%)`` ) data range.
-
-*positions* (default 1,2,...,n) sets the horizontal positions of
-the boxes. The ticks and limits are automatically set to match
-the positions.
-
-*widths* is either a scalar or a vector and sets the width of
-each box. The default is 0.5, or ``0.15*(distance between extreme
-positions)`` if that is smaller.
-
-*x* is an array or a sequence of vectors.
-
-Returns a dictionary mapping each component of the boxplot
-to a list of the :class:`matplotlib.lines.Line2D`
-instances created.
-
-**Example:**
-
-.. plot:: pyplots/boxplot_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2468,145 +1803,12 @@
ax.hold(washold)
return ret
+if Axes.boxplot.__doc__ is not None:
+ boxplot.__doc__ = dedent(Axes.boxplot.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=0, pad_to=None, sides='default', scale_by_freq=None, hold=None, **kwargs):
- """call signature::
-
- cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend = mlab.detrend_none,
- window = mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', scale_by_freq=None, **kwargs)
-
-cohere the coherence between *x* and *y*. Coherence is the normalized
-cross spectral density:
-
-.. math::
-
- C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}
-
-Keyword arguments:
-
- *NFFT*: integer
- The number of data points used in each block for the FFT.
- Must be even; a power 2 is most efficient. The default value is 256.
-
- *Fs*: scalar
- The sampling frequency (samples per time unit). It is used
- to calculate the Fourier frequencies, freqs, in cycles per time
- unit. The default value is 2.
-
- *detrend*: callable
- The function applied to each segment before fft-ing,
- designed to remove the mean or linear trend. Unlike in
- matlab, where the *detrend* parameter is a vector, in
- matplotlib is it a function. The :mod:`~matplotlib.pylab`
- module defines :func:`~matplotlib.pylab.detrend_none`,
- :func:`~matplotlib.pylab.detrend_mean`, and
- :func:`~matplotlib.pylab.detrend_linear`, but you can use
- a custom function as well.
-
- *window*: callable or ndarray
- A function or a vector of length *NFFT*. To create window
- vectors see :func:`window_hanning`, :func:`window_none`,
- :func:`numpy.blackman`, :func:`numpy.hamming`,
- :func:`numpy.bartlett`, :func:`scipy.signal`,
- :func:`scipy.signal.get_window`, etc. The default is
- :func:`window_hanning`. If a function is passed as the
- argument, it must take a data segment as an argument and
- return the windowed version of the segment.
-
- *noverlap*: integer
- The number of points of overlap between blocks. The default value
- is 0 (no overlap).
-
- *pad_to*: integer
- The number of points to which the data segment is padded when
- performing the FFT. This can be different from *NFFT*, which
- specifies the number of data points used. While not increasing
- the actual resolution of the psd (the minimum distance between
- resolvable peaks), this can give more points in the plot,
- allowing for more detail. This corresponds to the *n* parameter
- in the call to fft(). The default is None, which sets *pad_to*
- equal to *NFFT*
-
- *sides*: [ 'default' | 'onesided' | 'twosided' ]
- Specifies which sides of the PSD to return. Default gives the
- default behavior, which returns one-sided for real data and both
- for complex data. 'onesided' forces the return of a one-sided PSD,
- while 'twosided' forces two-sided.
-
- *scale_by_freq*: boolean
- Specifies whether the resulting density values should be scaled
- by the scaling frequency, which gives density in units of Hz^-1.
- This allows for integration over the returned frequency values.
- The default is True for MatLab compatibility.
-
- *Fc*: integer
- The center frequency of *x* (defaults to 0), which offsets
- the x extents of the plot to reflect the frequency range used
- when a signal is acquired and then filtered and downsampled to
- baseband.
-
-The return value is a tuple (*Cxy*, *f*), where *f* are the
-frequencies of the coherence vector.
-
-kwargs are applied to the lines.
-
-References:
-
- * Bendat & Piersol -- Random Data: Analysis and Measurement
- Procedures, John Wiley & Sons (1986)
-
-kwargs control the :class:`~matplotlib.lines.Line2D`
-properties of the coherence plot:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False]
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color or c: any matplotlib color
- contains: a callable function
- dash_capstyle: ['butt' | 'round' | 'projecting']
- dash_joinstyle: ['miter' | 'round' | 'bevel']
- dashes: sequence of on/off ink in points
- data: 2D array
- drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
- figure: a :class:`matplotlib.figure.Figure` instance
- fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top']
- gid: an id string
- label: any string
- linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'.
- linewidth or lw: float value in points
- lod: [True | False]
- marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ]
- markeredgecolor or mec: any matplotlib color
- markeredgewidth or mew: float value in points
- markerfacecolor or mfc: any matplotlib color
- markersize or ms: float
- markevery: None | integer | (startind, stride)
- picker: float distance in points or callable pick function ``fn(artist, event)``
- pickradius: float distance in points
- rasterized: [True | False | None]
- snap: unknown
- solid_capstyle: ['butt' | 'round' | 'projecting']
- solid_joinstyle: ['miter' | 'round' | 'bevel']
- transform: a :class:`matplotlib.transforms.Transform` instance
- url: a url string
- visible: [True | False]
- xdata: 1D array
- ydata: 1D array
- zorder: any number
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/cohere_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2620,75 +1822,12 @@
ax.hold(washold)
return ret
+if Axes.cohere.__doc__ is not None:
+ cohere.__doc__ = dedent(Axes.cohere.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def clabel(CS, *args, **kwargs):
- """call signature::
-
- clabel(cs, **kwargs)
-
-adds labels to line contours in *cs*, where *cs* is a
-:class:`~matplotlib.contour.ContourSet` object returned by
-contour.
-
-::
-
- clabel(cs, v, **kwargs)
-
-only labels contours listed in *v*.
-
-Optional keyword arguments:
-
- *fontsize*:
- See http://matplotlib.sf.net/fonts.html
-
- *colors*:
- - if *None*, the color of each label matches the color of
- the corresponding contour
-
- - if one string color, e.g. *colors* = 'r' or *colors* =
- 'red', all labels will be plotted in this color
-
- - if a tuple of matplotlib color args (string, float, rgb, etc),
- different labels will be plotted in different colors in the order
- specified
-
- *inline*:
- controls whether the underlying contour is removed or
- not. Default is *True*.
-
- *inline_spacing*:
- space in pixels to leave on each side of label when
- placing inline. Defaults to 5. This spacing will be
- exact for labels at locations where the contour is
- straight, less so for labels on curved contours.
-
- *fmt*:
- a format string for the label. Default is '%1.3f'
- Alternatively, this can be a dictionary matching contour
- levels with arbitrary strings to use for each contour level
- (i.e., fmt[level]=string)
-
- *manual*:
- if *True*, contour labels will be placed manually using
- mouse clicks. Click the first button near a contour to
- add a label, click the second button (or potentially both
- mouse buttons at once) to finish adding labels. The third
- button can be used to remove the last label added, but
- only if labels are not inline. Alternatively, the keyboard
- can be used to select label locations (enter to end label
- placement, delete or backspace act like the third mouse button,
- and any other key will select a label location).
-
- *rightside_up*:
- if *True* (default), label rotations will always be plus
- or minus 90 degrees from level.
-
-.. plot:: mpl_examples/pylab_examples/contour_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2702,172 +1841,12 @@
ax.hold(washold)
return ret
+if Axes.clabel.__doc__ is not None:
+ clabel.__doc__ = dedent(Axes.clabel.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def contour(*args, **kwargs):
- """:func:`~matplotlib.pyplot.contour` and
-:func:`~matplotlib.pyplot.contourf` draw contour lines and
-filled contours, respectively. Except as noted, function
-signatures and return values are the same for both versions.
-
-:func:`~matplotlib.pyplot.contourf` differs from the Matlab
-(TM) version in that it does not draw the polygon edges,
-because the contouring engine yields simply connected regions
-with branch cuts. To draw the edges, add line contours with
-calls to :func:`~matplotlib.pyplot.contour`.
-
-
-call signatures::
-
- contour(Z)
-
-make a contour plot of an array *Z*. The level values are chosen
-automatically.
-
-::
-
- contour(X,Y,Z)
-
-*X*, *Y* specify the (*x*, *y*) coordinates of the surface
-
-::
-
- contour(Z,N)
- contour(X,Y,Z,N)
-
-contour *N* automatically-chosen levels.
-
-::
-
- contour(Z,V)
- contour(X,Y,Z,V)
-
-draw contour lines at the values specified in sequence *V*
-
-::
-
- contourf(..., V)
-
-fill the (len(*V*)-1) regions between the values in *V*
-
-::
-
- contour(Z, **kwargs)
-
-Use keyword args to control colors, linewidth, origin, cmap ... see
-below for more details.
-
-*X*, *Y*, and *Z* must be arrays with the same dimensions.
-
-*Z* may be a masked array, but filled contouring may not
-handle internal masked regions correctly.
-
-``C = contour(...)`` returns a
-:class:`~matplotlib.contour.ContourSet` object.
-
-Optional keyword arguments:
-
- *colors*: [ None | string | (mpl_colors) ]
- If *None*, the colormap specified by cmap will be used.
-
- If a string, like 'r' or 'red', all levels will be plotted in this
- color.
-
- If a tuple of matplotlib color args (string, float, rgb, etc),
- different levels will be plotted in different colors in the order
- specified.
-
- *alpha*: float
- The alpha blending value
-
- *cmap*: [ None | Colormap ]
- A cm :class:`~matplotlib.cm.Colormap` instance or
- *None*. If *cmap* is *None* and *colors* is *None*, a
- default Colormap is used.
-
- *norm*: [ None | Normalize ]
- A :class:`matplotlib.colors.Normalize` instance for
- scaling data values to colors. If *norm* is *None* and
- *colors* is *None*, the default linear scaling is used.
-
- *origin*: [ None | 'upper' | 'lower' | 'image' ]
- If *None*, the first value of *Z* will correspond to the
- lower left corner, location (0,0). If 'image', the rc
- value for ``image.origin`` will be used.
-
- This keyword is not active if *X* and *Y* are specified in
- the call to contour.
-
- *extent*: [ None | (x0,x1,y0,y1) ]
-
- If *origin* is not *None*, then *extent* is interpreted as
- in :func:`matplotlib.pyplot.imshow`: it gives the outer
- pixel boundaries. In this case, the position of Z[0,0]
- is the center of the pixel, not a corner. If *origin* is
- *None*, then (*x0*, *y0*) is the position of Z[0,0], and
- (*x1*, *y1*) is the position of Z[-1,-1].
-
- This keyword is not active if *X* and *Y* are specified in
- the call to contour.
-
- *locator*: [ None | ticker.Locator subclass ]
- If *locator* is None, the default
- :class:`~matplotlib.ticker.MaxNLocator` is used. The
- locator is used to determine the contour levels if they
- are not given explicitly via the *V* argument.
-
- *extend*: [ 'neither' | 'both' | 'min' | 'max' ]
- Unless this is 'neither', contour levels are automatically
- added to one or both ends of the range so that all data
- are included. These added ranges are then mapped to the
- special colormap values which default to the ends of the
- colormap range, but can be set via
- :meth:`matplotlib.cm.Colormap.set_under` and
- :meth:`matplotlib.cm.Colormap.set_over` methods.
-
-contour-only keyword arguments:
-
- *linewidths*: [ None | number | tuple of numbers ]
- If *linewidths* is *None*, the default width in
- ``lines.linewidth`` in ``matplotlibrc`` is used.
-
- If a number, all levels will be plotted with this linewidth.
-
- If a tuple, different levels will be plotted with different
- linewidths in the order specified
-
- *linestyles*: [None | 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
- If *linestyles* is *None*, the 'solid' is used.
-
- *linestyles* can also be an iterable of the above strings
- specifying a set of linestyles to be used. If this
- iterable is shorter than the number of contour levels
- it will be repeated as necessary.
-
- If contour is using a monochrome colormap and the contour
- level is less than 0, then the linestyle specified
- in ``contour.negative_linestyle`` in ``matplotlibrc``
- will be used.
-
-contourf-only keyword arguments:
-
- *antialiased*: [ True | False ]
- enable antialiasing
-
- *nchunk*: [ 0 | integer ]
- If 0, no subdivision of the domain. Specify a positive integer to
- divide the domain into subdomains of roughly *nchunk* by *nchunk*
- points. This may never actually be advantageous, so this option may
- be removed. Chunking introduces artifacts at the chunk boundaries
- unless *antialiased* is *False*.
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/contour_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -2881,172 +1860,12 @@
ax.hold(washold)
if ret._A is not None: gci._current = ret
return ret
+if Axes.contour.__doc__ is not None:
+ contour.__doc__ = dedent(Axes.contour.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def contourf(*args, **kwargs):
- """:func:`~matplotlib.pyplot.contour` and
-:func:`~matplotlib.pyplot.contourf` draw contour lines and
-filled contours, respectively. Except as noted, function
-signatures and return values are the same for both versions.
-
-:func:`~matplotlib.pyplot.contourf` differs from the Matlab
-(TM) version in that it does not draw the polygon edges,
-because the contouring engine yields simply connected regions
-with branch cuts. To draw the edges, add line contours with
-calls to :func:`~matplotlib.pyplot.contour`.
-
-
-call signatures::
-
- contour(Z)
-
-make a contour plot of an array *Z*. The level values are chosen
-automatically.
-
-::
-
- contour(X,Y,Z)
-
-*X*, *Y* specify the (*x*, *y*) coordinates of the surface
-
-::
-
- contour(Z,N)
- contour(X,Y,Z,N)
-
-contour *N* automatically-chosen levels.
-
-::
-
- contour(Z,V)
- contour(X,Y,Z,V)
-
-draw contour lines at the values specified in sequence *V*
-
-::
-
- contourf(..., V)
-
-fill the (len(*V*)-1) regions between the values in *V*
-
-::
-
- contour(Z, **kwargs)
-
-Use keyword args to control colors, linewidth, origin, cmap ... see
-below for more details.
-
-*X*, *Y*, and *Z* must be arrays with the same dimensions.
-
-*Z* may be a masked array, but filled contouring may not
-handle internal masked regions correctly.
-
-``C = contour(...)`` returns a
-:class:`~matplotlib.contour.ContourSet` object.
-
-Optional keyword arguments:
-
- *colors*: [ None | string | (mpl_colors) ]
- If *None*, the colormap specified by cmap will be used.
-
- If a string, like 'r' or 'red', all levels will be plotted in this
- color.
-
- If a tuple of matplotlib color args (string, float, rgb, etc),
- different levels will be plotted in different colors in the order
- specified.
-
- *alpha*: float
- The alpha blending value
-
- *cmap*: [ None | Colormap ]
- A cm :class:`~matplotlib.cm.Colormap` instance or
- *None*. If *cmap* is *None* and *colors* is *None*, a
- default Colormap is used.
-
- *norm*: [ None | Normalize ]
- A :class:`matplotlib.colors.Normalize` instance for
- scaling data values to colors. If *norm* is *None* and
- *colors* is *None*, the default linear scaling is used.
-
- *origin*: [ None | 'upper' | 'lower' | 'image' ]
- If *None*, the first value of *Z* will correspond to the
- lower left corner, location (0,0). If 'image', the rc
- value for ``image.origin`` will be used.
-
- This keyword is not active if *X* and *Y* are specified in
- the call to contour.
-
- *extent*: [ None | (x0,x1,y0,y1) ]
-
- If *origin* is not *None*, then *extent* is interpreted as
- in :func:`matplotlib.pyplot.imshow`: it gives the outer
- pixel boundaries. In this case, the position of Z[0,0]
- is the center of the pixel, not a corner. If *origin* is
- *None*, then (*x0*, *y0*) is the position of Z[0,0], and
- (*x1*, *y1*) is the position of Z[-1,-1].
-
- This keyword is not active if *X* and *Y* are specified in
- the call to contour.
-
- *locator*: [ None | ticker.Locator subclass ]
- If *locator* is None, the default
- :class:`~matplotlib.ticker.MaxNLocator` is used. The
- locator is used to determine the contour levels if they
- are not given explicitly via the *V* argument.
-
- *extend*: [ 'neither' | 'both' | 'min' | 'max' ]
- Unless this is 'neither', contour levels are automatically
- added to one or both ends of the range so that all data
- are included. These added ranges are then mapped to the
- special colormap values which default to the ends of the
- colormap range, but can be set via
- :meth:`matplotlib.cm.Colormap.set_under` and
- :meth:`matplotlib.cm.Colormap.set_over` methods.
-
-contour-only keyword arguments:
-
- *linewidths*: [ None | number | tuple of numbers ]
- If *linewidths* is *None*, the default width in
- ``lines.linewidth`` in ``matplotlibrc`` is used.
-
- If a number, all levels will be plotted with this linewidth.
-
- If a tuple, different levels will be plotted with different
- linewidths in the order specified
-
- *linestyles*: [None | 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
- If *linestyles* is *None*, the 'solid' is used.
-
- *linestyles* can also be an iterable of the above strings
- specifying a set of linestyles to be used. If this
- iterable is shorter than the number of contour levels
- it will be repeated as necessary.
-
- If contour is using a monochrome colormap and the contour
- level is less than 0, then the linestyle specified
- in ``contour.negative_linestyle`` in ``matplotlibrc``
- will be used.
-
-contourf-only keyword arguments:
-
- *antialiased*: [ True | False ]
- enable antialiasing
-
- *nchunk*: [ 0 | integer ]
- If 0, no subdivision of the domain. Specify a positive integer to
- divide the domain into subdomains of roughly *nchunk* by *nchunk*
- points. This may never actually be advantageous, so this option may
- be removed. Chunking introduces artifacts at the chunk boundaries
- unless *antialiased* is *False*.
-
-**Example:**
-
-.. plot:: mpl_examples/pylab_examples/contour_demo.py
-
-Additional kwargs: hold = [True|False] overrides default hold state
-"""
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
@@ -3060,148 +1879,12 @@
ax.hold(washold)
if ret._A is not None: gci._current = ret
return ret
+if Axes.contourf.__doc__ is not None:
+ contourf.__doc__ = dedent(Axes.contourf.__doc__) + __docstring_addendum
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=0, pad_to=None, sides='default', scale_by_freq=None, hold=None, **kwargs):
- """call signature::
-
- csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
- window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', scale_by_freq=None, **kwargs)
-
-The cross spectral density :math:`P_{xy}` by Welch's average
-periodogram method. The vectors *x* and *y* are divided into
-*NFFT* length segments. Each segment is detrended by function
-*detrend* and windowed by function *window*. The product of
-the direct FFTs of *x* and *y* are averaged over each segment
-to compute :math:`P_{xy}`, with a scaling to correct for power
-loss due to windowing.
-
-Returns the tuple (*Pxy*, *freqs*). *P* is the cross spectrum
-(complex valued), and :math:`10\\log_{10}|P_{xy}|` is
-plotted.
-
-Keyword arguments:
-
- *NFFT*: integer
- The number of data points used in each block for the FFT.
- Must be even; a power 2 is most efficient. The default value is 256.
-
- *Fs*: scalar
- The sampling frequency (samples per time unit). It is used
- to calculate the Fourier frequencies, freqs, in cycles per time
- unit. The default value is 2.
-
- *detrend*: callable
- The function applied to each segment before fft-ing,
- designed to remove the mean or linear trend. Unlike in
- matlab, where the *detrend* parameter is a vector, in
- matplotlib is it a function. The :mod:`~matplotlib.pylab`
- module defines :func:`~matplotlib.pylab.detrend_none`,
- :func:`~matplotlib.pylab.detrend_mean`, and
- :func:`~matplotlib.pylab.detrend_linear`, but you can use
- a custom function as well.
-
- *window*: callable or ndarray
- A function or a vector of length *NFFT*. To create window
- vectors see :func:`window_hanning`, :func:`window_none`,
- :func:`numpy.blackman`, :func:`numpy.hamming`,
- :func:`numpy.bartlett`, :func:`scipy.signal`,
- :func:`scipy.signal.get_window`, etc. The default is
- :func:`window_hanning`. If a function is passed as the
- argument, it must take a data segment as an argument and
- return the windowed version of the segment.
-
- *noverlap*: integer
- The number of points of overlap between blocks. The default value
- is 0 (no overlap).
-
- *pad_to*: integer
- The number of points to which the data segment is padded when
- performing the FFT. This can be different from *NFFT*, which
- specifies the number of data points used. While not increasing
- the actual resolution of the psd (the minimum distance between
- resolvable peaks), this can give more points in the plot,
- allowing for more detail. This corresponds to the *n* parameter
- in the call to fft(). The default is None, which sets *pad_to*
- equal to *NFFT*
-
- *sides*: [ 'default' | 'onesided' | 'twosided' ]
- Specifies which sides of the PSD to return. Default gives the
- default behavior, which returns one-sided for real data and both
- for complex data. 'onesided' forces the return of a one-sided PSD,
- while 'twosided' forces two-sided.
-
- *scale_by_freq*: boolean
- Specifies whether the resulting density values should be scaled
- by the scaling frequency, which gives density in units of Hz^-1.
- This allows for integration over the returned frequency values.
- The default is True for MatLab compatibility.
-
- *Fc*: integer
- The center frequency of *x* (defaults to 0), which offsets
- the x extents of the plot to reflect the frequency range used
- when a signal is acquired and then filtered and downsampled to
- baseband.
-
-References:
- Bendat & Piersol -- Random Data: Analysis and Measurement
- Procedures, John Wiley & Sons (1986)
-
-kwargs control the Line2D properties:
-
- alpha: float (0.0 transparent through 1.0 opaque)
- animated: [True | False]
- antialiased or aa: [True | False]
- axes: an :class:`~matplotlib.axes.Axes` instance
- clip_box: a :class:`matplotlib.transforms.Bbox` instance
- clip_on: [True | False]
- clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]
- color or c: any matplotlib color
- contains: a callable function
- dash_capstyle: ['butt' | 'round' | 'projecting']
- dash_joinstyle: ['miter' | 'round' | 'bevel']
- dashes: sequence of on/off ink in points
- data: 2D array
- drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
- figure: a :class:`matplotlib.figure.Figure` instance
- fillstyle: ['full' | 'left' | 'right' | 'bottom' | 'top']
- gid: an id string
- label: any string
- linestyle or ls: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and any drawstyle in combination with a linestyle, e.g. 'steps--'.
- linewidth or lw: float value in points
- lod: [True | False]
- marker: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|' | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT | 'None' | ' ' | '' ]
- markeredgecolor or mec: any matplotlib color
- markeredgewidth or mew: float value in points
- markerfacecolor or mfc: any matplotlib color
- markersize or ms: float
- markevery: None | integer | (startind, stride)
- picker: float distance in points or callable pick function ``fn(artist, event)``
- pickradius: float distance in points
- rasterized: [True | False | None]
- snap: unknown
- solid_capstyle: ['butt' | 'round' | 'projecting']
- solid_joinstyle: ['miter' | 'round' | 'be...
[truncated message content] |