You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(3) |
2
(7) |
3
|
4
|
5
(7) |
6
(7) |
7
(5) |
8
(3) |
9
(3) |
10
|
11
|
12
|
13
|
14
(4) |
15
(4) |
16
(22) |
17
(21) |
18
(2) |
19
(7) |
20
(11) |
21
(6) |
22
(8) |
23
(28) |
24
(7) |
25
(15) |
26
(6) |
27
(4) |
28
(16) |
29
(16) |
30
(27) |
31
(6) |
Revision: 5345 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5345&view=rev Author: jswhit Date: 2008年05月31日 07:30:09 -0700 (2008年5月31日) Log Message: ----------- add missing example Modified Paths: -------------- trunk/toolkits/basemap/MANIFEST.in Modified: trunk/toolkits/basemap/MANIFEST.in =================================================================== --- trunk/toolkits/basemap/MANIFEST.in 2008年05月31日 13:12:55 UTC (rev 5344) +++ trunk/toolkits/basemap/MANIFEST.in 2008年05月31日 14:30:09 UTC (rev 5345) @@ -43,6 +43,7 @@ include examples/ortho_demo.py include examples/geos_demo.py include examples/geos_demo_2.py +include examples/geos_demo_3.py include examples/200706041200-msg-ch01-SAfrica.jpg include examples/fcstmaps.py include examples/plotsst.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5344 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5344&view=rev Author: jswhit Date: 2008年05月31日 06:12:55 -0700 (2008年5月31日) Log Message: ----------- fix to warpimage method Modified Paths: -------------- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2008年05月31日 13:05:26 UTC (rev 5343) +++ trunk/toolkits/basemap/Changelog 2008年05月31日 13:12:55 UTC (rev 5344) @@ -1,4 +1,5 @@ -version 0.99 (svn revision 5339) +version 0.99 (svn revision 5344) + * fix to warpimage method for API change in matplotlib 0.98.0. * updated pyproj to 1.8.6. * fixed bug in NetCDFFile creating masked arrays when both _FillValue and missing_value exist. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5343 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5343&view=rev Author: jswhit Date: 2008年05月31日 06:05:26 -0700 (2008年5月31日) Log Message: ----------- use "import numpy.ma as ma" instead of "from numpy import ma" Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008年05月31日 13:03:28 UTC (rev 5342) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008年05月31日 13:05:26 UTC (rev 5343) @@ -34,7 +34,7 @@ import pyproj, sys, os, math, dbflib from proj import Proj import numpy as np -from numpy import ma +import numpy.ma as ma from shapelib import ShapeFile import _geoslib, pupynere, netcdftime This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5342 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5342&view=rev Author: jswhit Date: 2008年05月31日 06:03:28 -0700 (2008年5月31日) Log Message: ----------- use "import numpy.ma as ma" instead of "from numpy import ma" Modified Paths: -------------- trunk/toolkits/basemap/examples/ccsm_popgrid.py trunk/toolkits/basemap/examples/fcstmaps.py trunk/toolkits/basemap/examples/plotmap_masked.py trunk/toolkits/basemap/examples/pnganim.py Modified: trunk/toolkits/basemap/examples/ccsm_popgrid.py =================================================================== --- trunk/toolkits/basemap/examples/ccsm_popgrid.py 2008年05月31日 12:57:10 UTC (rev 5341) +++ trunk/toolkits/basemap/examples/ccsm_popgrid.py 2008年05月31日 13:03:28 UTC (rev 5342) @@ -21,7 +21,7 @@ POP grids are used extensively locally in oceanographic and ice models. """ from matplotlib import rcParams -from numpy import ma +import numpy.ma as ma import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap, NetCDFFile Modified: trunk/toolkits/basemap/examples/fcstmaps.py =================================================================== --- trunk/toolkits/basemap/examples/fcstmaps.py 2008年05月31日 12:57:10 UTC (rev 5341) +++ trunk/toolkits/basemap/examples/fcstmaps.py 2008年05月31日 13:03:28 UTC (rev 5342) @@ -3,7 +3,7 @@ import numpy as np import matplotlib.pyplot as plt import sys -from numpy import ma +import numpy.ma as ma import datetime from mpl_toolkits.basemap import Basemap, NetCDFFile, addcyclic, num2date Modified: trunk/toolkits/basemap/examples/plotmap_masked.py =================================================================== --- trunk/toolkits/basemap/examples/plotmap_masked.py 2008年05月31日 12:57:10 UTC (rev 5341) +++ trunk/toolkits/basemap/examples/plotmap_masked.py 2008年05月31日 13:03:28 UTC (rev 5342) @@ -6,7 +6,7 @@ # (in this case the oceans) from mpl_toolkits.basemap import Basemap, shiftgrid -from numpy import ma +import numpy.ma as ma import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab Modified: trunk/toolkits/basemap/examples/pnganim.py =================================================================== --- trunk/toolkits/basemap/examples/pnganim.py 2008年05月31日 12:57:10 UTC (rev 5341) +++ trunk/toolkits/basemap/examples/pnganim.py 2008年05月31日 13:03:28 UTC (rev 5342) @@ -7,7 +7,7 @@ import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab -from numpy import ma +import numpy.ma as ma import datetime, sys, time, subprocess from mpl_toolkits.basemap import Basemap, shiftgrid, NetCDFFile, num2date This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5341 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5341&view=rev Author: jswhit Date: 2008年05月31日 05:57:10 -0700 (2008年5月31日) Log Message: ----------- fixed warpimage method to work with recent matplotlib change "2008-05-29 matplotlib.image.imread now no longer always returns RGBA" Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008年05月31日 12:26:21 UTC (rev 5340) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008年05月31日 12:57:10 UTC (rev 5341) @@ -2802,12 +2802,12 @@ dx = 2.*np.pi*self.rmajor/float(nlons) nx = int((self.xmax-self.xmin)/dx)+1 ny = int((self.ymax-self.ymin)/dx)+1 - self._bm_rgba_warped = np.zeros((ny,nx,4),np.float64) + self._bm_rgba_warped = np.ones((ny,nx,4),np.float64) # interpolate rgba values from geographic coords (proj='cyl') # to map projection coords. # if masked=True, values outside of # projection limb will be masked. - for k in range(4): + for k in range(3): self._bm_rgba_warped[:,:,k],x,y = \ self.transform_scalar(self._bm_rgba[:,:,k],\ self._bm_lons,self._bm_lats,nx,ny,returnxy=True) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5340 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5340&view=rev Author: jswhit Date: 2008年05月31日 05:26:21 -0700 (2008年5月31日) Log Message: ----------- replace "faceted=False" with "edgecolors='none' to suppress deprecation warning Modified Paths: -------------- trunk/toolkits/basemap/examples/plotcities.py trunk/toolkits/basemap/examples/randompoints.py Modified: trunk/toolkits/basemap/examples/plotcities.py =================================================================== --- trunk/toolkits/basemap/examples/plotcities.py 2008年05月30日 22:24:06 UTC (rev 5339) +++ trunk/toolkits/basemap/examples/plotcities.py 2008年05月31日 12:26:21 UTC (rev 5340) @@ -18,6 +18,6 @@ colors.append(plt.cm.jet(float(rank)/100.)) m.drawcoastlines() m.fillcontinents() -m.scatter(x,y,25,colors,marker='o',faceted=False,zorder=10) +m.scatter(x,y,25,colors,marker='o',edgecolors='none',zorder=10) plt.title('City Locations colored by Population Rank') plt.show() Modified: trunk/toolkits/basemap/examples/randompoints.py =================================================================== --- trunk/toolkits/basemap/examples/randompoints.py 2008年05月30日 22:24:06 UTC (rev 5339) +++ trunk/toolkits/basemap/examples/randompoints.py 2008年05月31日 12:26:21 UTC (rev 5340) @@ -28,7 +28,7 @@ # draw colored markers. # use zorder=10 to make sure markers are drawn last. # (otherwise they are covered up when continents are filled) -#m.scatter(x,y,25,z,cmap=plt.cm.jet,marker='o',faceted=False,zorder=10) +#m.scatter(x,y,25,z,cmap=plt.cm.jet,marker='o',edgecolors='none',zorder=10) # create a list of strings containing z values # or, plot actual numbers as color-coded text strings. zn = [ '%2i' % zz for zz in z ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5339 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5339&view=rev Author: jswhit Date: 2008年05月30日 15:24:06 -0700 (2008年5月30日) Log Message: ----------- updated pyproj to 1.8.6 Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pyproj.py trunk/toolkits/basemap/src/_geod.c trunk/toolkits/basemap/src/_geod.pyx trunk/toolkits/basemap/src/_pyproj.pxi Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2008年05月30日 20:55:24 UTC (rev 5338) +++ trunk/toolkits/basemap/Changelog 2008年05月30日 22:24:06 UTC (rev 5339) @@ -1,5 +1,5 @@ -version 0.99 (svn revision 5338) - * updated pyproj to 1.8.5. +version 0.99 (svn revision 5339) + * updated pyproj to 1.8.6. * fixed bug in NetCDFFile creating masked arrays when both _FillValue and missing_value exist. * drawparallels and drawmeridians return a dictionary containing Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pyproj.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pyproj.py 2008年05月30日 20:55:24 UTC (rev 5338) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pyproj.py 2008年05月30日 22:24:06 UTC (rev 5339) @@ -53,7 +53,7 @@ from array import array from types import TupleType, ListType, NoneType import os -import numpy as np +#import numpy as np pyproj_datadir = os.sep.join([os.path.dirname(__file__), 'data']) set_datapath(pyproj_datadir) @@ -369,10 +369,11 @@ """ initialize a Geod class instance. - Geodetic parameters for specifying the ellipsoid or sphere to - use must either be given in a dictionary 'initparams' or as - keyword arguments. Following is a list of the ellipsoids that - may be defined using the 'ellps' keyword: + Geodetic parameters for specifying the ellipsoid + can be given in a dictionary 'initparams', as keyword arguments, + or as as proj4 geod initialization string. + Following is a list of the ellipsoids that may be defined using the + 'ellps' keyword: MERIT a=6378137.0 rf=298.257 MERIT 1983 SGS85 a=6378136.0 rf=298.257 Soviet Geodetic System 85 @@ -457,20 +458,35 @@ 54.663 -123.448 288303.720 -65.463 79.342 4013037.318 51.254 -71.576 5579916.649 + >>> g2 = Geod('+ellps=clrk66') # use proj4 style initialization string + >>> az12,az21,dist = g2.inv(boston_lon,boston_lat,portland_lon,portland_lat) + >>> print "%7.3f %6.3f %12.3f" % (az12,az21,dist) + -66.531 75.654 4164192.708 """ - # if projparams is None, use kwargs. + # if initparams is None, use kwargs. if initparams is None: if len(kwargs) == 0: raise RuntimeError('no ellipsoid control parameters specified') else: - initparams = kwargs - # set units to meters. - if not initparams.has_key('units'): - initparams['units']='m' - elif initparams['units'] != 'm': - print 'resetting units to meters ...' - initparams['units']='m' - return _Geod.__new__(self, initparams) + initstring = _dict2string(kwargs) + elif type(initparams) == str: + # if projparams is a string, interpret as a proj4 init string. + initstring = initparams + else: # projparams a dict + initstring = _dict2string(initparams) + # make sure units are meters. + if not initstring.count('+units='): + initstring = '+units=m '+initstring + else: + kvpairs = [] + for kvpair in initstring.split(): + if kvpair.startswith('+units'): + k,v = kvpair.split('=') + kvpairs.append(k+'=m ') + else: + kvpairs.append(kvpair+' ') + initstring = ''.join(kvpairs) + return _Geod.__new__(self, initstring) def fwd(self, lons, lats, az, dist, radians=False): """ Modified: trunk/toolkits/basemap/src/_geod.c =================================================================== --- trunk/toolkits/basemap/src/_geod.c 2008年05月30日 20:55:24 UTC (rev 5338) +++ trunk/toolkits/basemap/src/_geod.c 2008年05月30日 22:24:06 UTC (rev 5339) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.14 on Tue May 20 09:25:55 2008 */ +/* Generated by Cython 0.9.6.14 on Fri May 30 16:08:08 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -103,20 +103,6 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ - -static inline PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (PyList_Append(L, x) < 0) return NULL; - Py_INCREF(Py_None); - return Py_None; // this is just to have an accurate signature - } - else { - return PyObject_CallMethod(L, "append", "(O)", x); - } -} - static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ @@ -127,18 +113,18 @@ /* Declarations */ -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":5 +/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":5 * include "_pyproj.pxi" * * cdef class Geod: # <<<<<<<<<<<<<< * cdef GEODESIC_T geodesic_t - * cdef public object geodparams + * cdef public object geodstring */ struct __pyx_obj_5_geod_Geod { PyObject_HEAD GEODESIC_T geodesic_t; - PyObject *geodparams; + PyObject *geodstring; PyObject *proj_version; char *geodinitstring; }; @@ -148,7 +134,7 @@ /* Implementation of _geod */ -static char __pyx_k_2[] = "1.8.4"; +static char __pyx_k_2[] = "1.8.5"; static PyObject *__pyx_n___cinit__; static PyObject *__pyx_n___reduce__; @@ -165,179 +151,61 @@ static PyObject *__pyx_k_2p; -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":11 +/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":11 * cdef char *geodinitstring * - * def __new__(self, geodparams): # <<<<<<<<<<<<<< + * def __new__(self, geodstring): # <<<<<<<<<<<<<< * cdef GEODESIC_T GEOD_T - * self.geodparams = geodparams + * # setup geod initialization string. */ -static PyObject *__pyx_n_iteritems; -static PyObject *__pyx_n_append; -static PyObject *__pyx_n_join; static PyObject *__pyx_n_RuntimeError; -static PyObject *__pyx_k_3p; -static PyObject *__pyx_k_4p; -static PyObject *__pyx_k_5p; -static PyObject *__pyx_k_6p; - static PyObject *__pyx_builtin_RuntimeError; -static char __pyx_k_3[] = "+"; -static char __pyx_k_4[] = "="; -static char __pyx_k_5[] = " "; -static char __pyx_k_6[] = ""; - static int __pyx_pf_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_geodparams = 0; + PyObject *__pyx_v_geodstring = 0; GEODESIC_T __pyx_v_GEOD_T; - PyObject *__pyx_v_geodargs; - PyObject *__pyx_v_key; - PyObject *__pyx_v_value; int __pyx_r; - PyObject *__pyx_1 = 0; - Py_ssize_t __pyx_2 = 0; + int __pyx_1; + PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - int __pyx_6; - static char *__pyx_argnames[] = {"geodparams",0}; + static char *__pyx_argnames[] = {"geodstring",0}; if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 1)) { - __pyx_v_geodparams = PyTuple_GET_ITEM(__pyx_args, 0); + __pyx_v_geodstring = PyTuple_GET_ITEM(__pyx_args, 0); } else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geodparams))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L2;} + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geodstring))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L2;} } goto __pyx_L3; __pyx_L2:; __Pyx_AddTraceback("_geod.Geod.__cinit__"); return -1; __pyx_L3:; - __pyx_v_geodargs = Py_None; Py_INCREF(Py_None); - __pyx_v_key = Py_None; Py_INCREF(Py_None); - __pyx_v_value = Py_None; Py_INCREF(Py_None); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":13 - * def __new__(self, geodparams): + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":14 * cdef GEODESIC_T GEOD_T - * self.geodparams = geodparams # <<<<<<<<<<<<<< - * # setup proj initialization string. - * geodargs = [] - */ - Py_INCREF(__pyx_v_geodparams); - Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams); - ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams = __pyx_v_geodparams; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":15 - * self.geodparams = geodparams - * # setup proj initialization string. - * geodargs = [] # <<<<<<<<<<<<<< - * for key,value in geodparams.iteritems(): - * geodargs.append('+'+key+"="+str(value)+' ') - */ - __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_v_geodargs); - __pyx_v_geodargs = ((PyObject *)__pyx_1); - __pyx_1 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":16 - * # setup proj initialization string. - * geodargs = [] - * for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<< - * geodargs.append('+'+key+"="+str(value)+' ') - * self.geodinitstring = PyString_AsString(''.join(geodargs)) - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_geodparams, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyList_CheckExact(__pyx_3)) { __pyx_2 = 0; __pyx_1 = __pyx_3; Py_INCREF(__pyx_1); } - else { __pyx_1 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1;} } - Py_DECREF(__pyx_3); __pyx_3 = 0; - for (;;) { - if (PyList_CheckExact(__pyx_1)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_2++); Py_INCREF(__pyx_3); } - else { - __pyx_3 = PyIter_Next(__pyx_1); - if (!__pyx_3) { - break; - } - } - if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) { - PyObject* tuple = __pyx_3; - __pyx_5 = PyTuple_GET_ITEM(tuple, 0); - Py_INCREF(__pyx_5); - Py_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_5; - __pyx_5 = 0; - __pyx_5 = PyTuple_GET_ITEM(tuple, 1); - Py_INCREF(__pyx_5); - Py_DECREF(__pyx_v_value); - __pyx_v_value = __pyx_5; - __pyx_5 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - } - else { - __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_5; - __pyx_5 = 0; - __pyx_5 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_v_value); - __pyx_v_value = __pyx_5; - __pyx_5 = 0; - if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - } - - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":17 - * geodargs = [] - * for key,value in geodparams.iteritems(): - * geodargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<< - * self.geodinitstring = PyString_AsString(''.join(geodargs)) + * # setup geod initialization string. + * self.geodstring = geodstring # <<<<<<<<<<<<<< + * self.geodinitstring = PyString_AsString(self.geodstring) * # initialize projection */ - __pyx_5 = PyNumber_Add(__pyx_k_3p, __pyx_v_key); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_3 = PyNumber_Add(__pyx_5, __pyx_k_4p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_INCREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_value); - __pyx_5 = PyObject_Call(((PyObject*)&PyString_Type), ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_4 = PyNumber_Add(__pyx_3, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyNumber_Add(__pyx_4, __pyx_k_5p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_PyObject_Append(__pyx_v_geodargs, __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - } - Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_INCREF(__pyx_v_geodstring); + Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring); + ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring = __pyx_v_geodstring; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":18 - * for key,value in geodparams.iteritems(): - * geodargs.append('+'+key+"="+str(value)+' ') - * self.geodinitstring = PyString_AsString(''.join(geodargs)) # <<<<<<<<<<<<<< + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":15 + * # setup geod initialization string. + * self.geodstring = geodstring + * self.geodinitstring = PyString_AsString(self.geodstring) # <<<<<<<<<<<<<< * # initialize projection * self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] */ - __pyx_4 = PyObject_GetAttr(__pyx_k_6p, __pyx_n_join); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_INCREF(__pyx_v_geodargs); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_geodargs); - __pyx_5 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring = PyString_AsString(__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring = PyString_AsString(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":20 - * self.geodinitstring = PyString_AsString(''.join(geodargs)) + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":17 + * self.geodinitstring = PyString_AsString(self.geodstring) * # initialize projection * self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] # <<<<<<<<<<<<<< * if pj_errno != 0: @@ -345,70 +213,65 @@ */ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t = (GEOD_init_plus(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring, (&__pyx_v_GEOD_T))[0]); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":21 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":18 * # initialize projection * self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] * if pj_errno != 0: # <<<<<<<<<<<<<< * raise RuntimeError(pj_strerrno(pj_errno)) * self.proj_version = PJ_VERSION/100. */ - __pyx_6 = (pj_errno != 0); - if (__pyx_6) { + __pyx_1 = (pj_errno != 0); + if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":22 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":19 * self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< * self.proj_version = PJ_VERSION/100. * */ - __pyx_1 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1); - __pyx_1 = 0; - __pyx_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1;} - goto __pyx_L6; + __pyx_2 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L6:; + __pyx_L4:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":23 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":20 * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) * self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<< * * def __reduce__(self): */ - __pyx_5 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version); - ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version = __pyx_5; - __pyx_5 = 0; + ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version = __pyx_3; + __pyx_3 = 0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; - Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); __Pyx_AddTraceback("_geod.Geod.__cinit__"); __pyx_r = -1; __pyx_L0:; - Py_DECREF(__pyx_v_geodargs); - Py_DECREF(__pyx_v_key); - Py_DECREF(__pyx_v_value); return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":25 +/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":22 * self.proj_version = PJ_VERSION/100. * * def __reduce__(self): # <<<<<<<<<<<<<< * """special method that allows pyproj.Geod instance to be pickled""" - * return (self.__class__,(self.geodparams,)) + * return (self.__class__,(self.geodstring,)) */ static PyObject *__pyx_n___class__; @@ -421,18 +284,18 @@ PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":27 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":24 * def __reduce__(self): * """special method that allows pyproj.Geod instance to be pickled""" - * return (self.__class__,(self.geodparams,)) # <<<<<<<<<<<<<< + * return (self.__class__,(self.geodstring,)) # <<<<<<<<<<<<<< * * def _fwd(self, object lons, object lats, object az, object dist, radians=False): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_INCREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams); - PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams); - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_INCREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring); + PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring); + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_2)); __pyx_1 = 0; @@ -453,8 +316,8 @@ return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":29 - * return (self.__class__,(self.geodparams,)) +/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":26 + * return (self.__class__,(self.geodstring,)) * * def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<< * """ @@ -463,13 +326,13 @@ static PyObject *__pyx_n_ValueError; -static PyObject *__pyx_k_7p; -static PyObject *__pyx_k_8p; +static PyObject *__pyx_k_3p; +static PyObject *__pyx_k_4p; static PyObject *__pyx_builtin_ValueError; -static char __pyx_k_7[] = "Buffer lengths not the same"; -static char __pyx_k_8[] = "undefined forward geodesic (may be an equatorial arc)"; +static char __pyx_k_3[] = "Buffer lengths not the same"; +static char __pyx_k_4[] = "undefined forward geodesic (may be an equatorial arc)"; static PyObject *__pyx_pf_5_geod_4Geod__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5_geod_4Geod__fwd[] = "\n forward transformation - determine longitude, latitude and back azimuth \n of a terminus point given an initial point longitude and latitude, plus\n forward azimuth and distance.\n if radians=True, lons/lats are radians instead of degrees.\n "; @@ -514,7 +377,7 @@ } } else { - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons, &__pyx_v_lats, &__pyx_v_az, &__pyx_v_dist, &__pyx_v_radians))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L2;} + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons, &__pyx_v_lats, &__pyx_v_az, &__pyx_v_dist, &__pyx_v_radians))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L2;} } goto __pyx_L3; __pyx_L2:; @@ -522,7 +385,7 @@ return NULL; __pyx_L3:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":40 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":37 * cdef void *londata, *latdata, *azdat, *distdat * # if buffer api is supported, get pointer to data buffers. * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<< @@ -532,7 +395,7 @@ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons, (&__pyx_v_londata), (&__pyx_v_buflenlons)) != 0); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":41 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":38 * # if buffer api is supported, get pointer to data buffers. * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: * raise RuntimeError # <<<<<<<<<<<<<< @@ -540,12 +403,12 @@ * raise RuntimeError */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":42 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":39 * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: * raise RuntimeError * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<< @@ -555,7 +418,7 @@ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats, (&__pyx_v_latdata), (&__pyx_v_buflenlats)) != 0); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":43 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":40 * raise RuntimeError * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: * raise RuntimeError # <<<<<<<<<<<<<< @@ -563,12 +426,12 @@ * raise RuntimeError */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":44 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":41 * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: * raise RuntimeError * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<< @@ -578,7 +441,7 @@ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_az, (&__pyx_v_azdat), (&__pyx_v_buflenaz)) != 0); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":45 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":42 * raise RuntimeError * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: * raise RuntimeError # <<<<<<<<<<<<<< @@ -586,12 +449,12 @@ * raise RuntimeError */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":46 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":43 * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: * raise RuntimeError * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<< @@ -601,7 +464,7 @@ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_dist, (&__pyx_v_distdat), (&__pyx_v_buflend)) != 0); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":47 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":44 * raise RuntimeError * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: * raise RuntimeError # <<<<<<<<<<<<<< @@ -609,12 +472,12 @@ * if not buflenlons == buflenlats == buflenaz == buflend: */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":49 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":46 * raise RuntimeError * # process data in buffer * if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<< @@ -631,42 +494,42 @@ __pyx_2 = (!__pyx_1); if (__pyx_2) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":50 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":47 * # process data in buffer * if not buflenlons == buflenlats == buflenaz == buflend: * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< * ndim = buflenlons/_doublesize * lonsdata = <double *>londata */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_INCREF(__pyx_k_7p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_7p); - __pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_INCREF(__pyx_k_3p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_3p); + __pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":51 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":48 * if not buflenlons == buflenlats == buflenaz == buflend: * raise RuntimeError("Buffer lengths not the same") * ndim = buflenlons/_doublesize # <<<<<<<<<<<<<< * lonsdata = <double *>londata * latsdata = <double *>latdata */ - __pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely((__pyx_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely((__pyx_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; __pyx_v_ndim = __pyx_6; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":52 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":49 * raise RuntimeError("Buffer lengths not the same") * ndim = buflenlons/_doublesize * lonsdata = <double *>londata # <<<<<<<<<<<<<< @@ -675,7 +538,7 @@ */ __pyx_v_lonsdata = ((double *)__pyx_v_londata); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":53 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":50 * ndim = buflenlons/_doublesize * lonsdata = <double *>londata * latsdata = <double *>latdata # <<<<<<<<<<<<<< @@ -684,7 +547,7 @@ */ __pyx_v_latsdata = ((double *)__pyx_v_latdata); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":54 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":51 * lonsdata = <double *>londata * latsdata = <double *>latdata * azdata = <double *>azdat # <<<<<<<<<<<<<< @@ -693,7 +556,7 @@ */ __pyx_v_azdata = ((double *)__pyx_v_azdat); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":55 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":52 * latsdata = <double *>latdata * azdata = <double *>azdat * distdata = <double *>distdat # <<<<<<<<<<<<<< @@ -702,7 +565,7 @@ */ __pyx_v_distdata = ((double *)__pyx_v_distdat); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":56 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":53 * azdata = <double *>azdat * distdata = <double *>distdat * for i from 0 <= i < ndim: # <<<<<<<<<<<<<< @@ -711,17 +574,17 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i++) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":57 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":54 * distdata = <double *>distdat * for i from 0 <= i < ndim: * if radians: # <<<<<<<<<<<<<< * self.geodesic_t.p1.v = lonsdata[i] * self.geodesic_t.p1.u = latsdata[i] */ - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1;} if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":58 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":55 * for i from 0 <= i < ndim: * if radians: * self.geodesic_t.p1.v = lonsdata[i] # <<<<<<<<<<<<<< @@ -730,7 +593,7 @@ */ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = (__pyx_v_lonsdata[__pyx_v_i]); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":59 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":56 * if radians: * self.geodesic_t.p1.v = lonsdata[i] * self.geodesic_t.p1.u = latsdata[i] # <<<<<<<<<<<<<< @@ -739,7 +602,7 @@ */ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = (__pyx_v_latsdata[__pyx_v_i]); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":60 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":57 * self.geodesic_t.p1.v = lonsdata[i] * self.geodesic_t.p1.u = latsdata[i] * self.geodesic_t.ALPHA12 = azdata[i] # <<<<<<<<<<<<<< @@ -748,7 +611,7 @@ */ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = (__pyx_v_azdata[__pyx_v_i]); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":61 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":58 * self.geodesic_t.p1.u = latsdata[i] * self.geodesic_t.ALPHA12 = azdata[i] * self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<< @@ -760,55 +623,55 @@ } /*else*/ { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":63 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":60 * self.geodesic_t.DIST = distdata[i] * else: * self.geodesic_t.p1.v = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<< * self.geodesic_t.p1.u = _dg2rad*latsdata[i] * self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_7; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":64 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":61 * else: * self.geodesic_t.p1.v = _dg2rad*lonsdata[i] * self.geodesic_t.p1.u = _dg2rad*latsdata[i] # <<<<<<<<<<<<<< * self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] * self.geodesic_t.DIST = distdata[i] */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_7; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":65 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":62 * self.geodesic_t.p1.v = _dg2rad*lonsdata[i] * self.geodesic_t.p1.u = _dg2rad*latsdata[i] * self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] # <<<<<<<<<<<<<< * self.geodesic_t.DIST = distdata[i] * geod_pre(&self.geodesic_t) */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = __pyx_7; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":66 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":63 * self.geodesic_t.p1.u = _dg2rad*latsdata[i] * self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] * self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<< @@ -819,7 +682,7 @@ } __pyx_L11:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":67 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":64 * self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] * self.geodesic_t.DIST = distdata[i] * geod_pre(&self.geodesic_t) # <<<<<<<<<<<<<< @@ -828,7 +691,7 @@ */ geod_pre((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t)); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":68 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":65 * self.geodesic_t.DIST = distdata[i] * geod_pre(&self.geodesic_t) * if pj_errno != 0: # <<<<<<<<<<<<<< @@ -838,27 +701,27 @@ __pyx_2 = (pj_errno != 0); if (__pyx_2) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":69 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":66 * geod_pre(&self.geodesic_t) * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< * geod_for(&self.geodesic_t) * if pj_errno != 0: */ - __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; __Pyx_Raise(__pyx_5, 0, 0); Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L12; } __pyx_L12:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":70 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":67 * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) * geod_for(&self.geodesic_t) # <<<<<<<<<<<<<< @@ -867,7 +730,7 @@ */ geod_for((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t)); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":71 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":68 * raise RuntimeError(pj_strerrno(pj_errno)) * geod_for(&self.geodesic_t) * if pj_errno != 0: # <<<<<<<<<<<<<< @@ -877,27 +740,27 @@ __pyx_1 = (pj_errno != 0); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":72 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":69 * geod_for(&self.geodesic_t) * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< * if isnan(self.geodesic_t.ALPHA21): * raise ValueError('undefined forward geodesic (may be an equatorial arc)') */ - __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); __pyx_3 = 0; - __pyx_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; __Pyx_Raise(__pyx_5, 0, 0); Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L13; } __pyx_L13:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":73 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":70 * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) * if isnan(self.geodesic_t.ALPHA21): # <<<<<<<<<<<<<< @@ -907,36 +770,36 @@ __pyx_8 = isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (__pyx_8) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":74 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":71 * raise RuntimeError(pj_strerrno(pj_errno)) * if isnan(self.geodesic_t.ALPHA21): * raise ValueError('undefined forward geodesic (may be an equatorial arc)') # <<<<<<<<<<<<<< * if radians: * lonsdata[i] = self.geodesic_t.p2.v */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1;} - Py_INCREF(__pyx_k_8p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_8p); - __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_INCREF(__pyx_k_4p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_4p); + __pyx_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1;} goto __pyx_L14; } __pyx_L14:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":75 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":72 * if isnan(self.geodesic_t.ALPHA21): * raise ValueError('undefined forward geodesic (may be an equatorial arc)') * if radians: # <<<<<<<<<<<<<< * lonsdata[i] = self.geodesic_t.p2.v * latsdata[i] = self.geodesic_t.p2.u */ - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1;} if (__pyx_2) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":76 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":73 * raise ValueError('undefined forward geodesic (may be an equatorial arc)') * if radians: * lonsdata[i] = self.geodesic_t.p2.v # <<<<<<<<<<<<<< @@ -945,7 +808,7 @@ */ (__pyx_v_lonsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":77 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":74 * if radians: * lonsdata[i] = self.geodesic_t.p2.v * latsdata[i] = self.geodesic_t.p2.u # <<<<<<<<<<<<<< @@ -954,7 +817,7 @@ */ (__pyx_v_latsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":78 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":75 * lonsdata[i] = self.geodesic_t.p2.v * latsdata[i] = self.geodesic_t.p2.u * azdata[i] = self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<< @@ -966,51 +829,51 @@ } /*else*/ { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":80 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":77 * azdata[i] = self.geodesic_t.ALPHA21 * else: * lonsdata[i] = _rad2dg*self.geodesic_t.p2.v # <<<<<<<<<<<<<< * latsdata[i] = _rad2dg*self.geodesic_t.p2.u * azdata[i] = _rad2dg*self.geodesic_t.ALPHA21 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; (__pyx_v_lonsdata[__pyx_v_i]) = __pyx_7; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":81 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":78 * else: * lonsdata[i] = _rad2dg*self.geodesic_t.p2.v * latsdata[i] = _rad2dg*self.geodesic_t.p2.u # <<<<<<<<<<<<<< * azdata[i] = _rad2dg*self.geodesic_t.ALPHA21 * */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; (__pyx_v_latsdata[__pyx_v_i]) = __pyx_7; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":82 + /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":79 * lonsdata[i] = _rad2dg*self.geodesic_t.p2.v * latsdata[i] = _rad2dg*self.geodesic_t.p2.u * azdata[i] = _rad2dg*self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<< * * def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False): */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_7 = __pyx_PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; (__pyx_v_azdata[__pyx_v_i]) = __pyx_7; } @@ -1029,7 +892,7 @@ return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/... [truncated message content]
Revision: 5338 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5338&view=rev Author: jswhit Date: 2008年05月30日 13:55:24 -0700 (2008年5月30日) Log Message: ----------- added basemap workbook chapter pdf from py4science course. Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/MANIFEST.in Added Paths: ----------- trunk/toolkits/basemap/basemap_workbook.pdf Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2008年05月30日 20:25:57 UTC (rev 5337) +++ trunk/toolkits/basemap/Changelog 2008年05月30日 20:55:24 UTC (rev 5338) @@ -1,4 +1,4 @@ -version 0.99 (svn revision 5316) +version 0.99 (svn revision 5338) * updated pyproj to 1.8.5. * fixed bug in NetCDFFile creating masked arrays when both _FillValue and missing_value exist. Modified: trunk/toolkits/basemap/MANIFEST.in =================================================================== --- trunk/toolkits/basemap/MANIFEST.in 2008年05月30日 20:25:57 UTC (rev 5337) +++ trunk/toolkits/basemap/MANIFEST.in 2008年05月30日 20:55:24 UTC (rev 5338) @@ -4,6 +4,7 @@ include LICENSE_proj4 include LICENSE_pyshapelib include LICENSE_data +include basemap_workbook.pdf include API_CHANGES include KNOWN_BUGS include Changelog Added: trunk/toolkits/basemap/basemap_workbook.pdf =================================================================== (Binary files differ) Property changes on: trunk/toolkits/basemap/basemap_workbook.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5337 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5337&view=rev Author: jswhit Date: 2008年05月30日 13:25:57 -0700 (2008年5月30日) Log Message: ----------- convert to plt/np namespace, fix Basemap import for version 0.99 (mpl_toolkits) Modified Paths: -------------- trunk/py4science/examples/basemap1.py trunk/py4science/examples/basemap2.py trunk/py4science/examples/basemap3.py trunk/py4science/examples/basemap4.py trunk/py4science/examples/basemap5.py Modified: trunk/py4science/examples/basemap1.py =================================================================== --- trunk/py4science/examples/basemap1.py 2008年05月30日 20:05:57 UTC (rev 5336) +++ trunk/py4science/examples/basemap1.py 2008年05月30日 20:25:57 UTC (rev 5337) @@ -1,5 +1,5 @@ -import pylab, numpy -from matplotlib.toolkits.basemap import Basemap +from mpl_toolkits.basemap import Basemap +import matplotlib.pyplot as plt # create map by specifying lat/lon values at corners. resolution = 'l'; projection = 'lcc' lat_0 = 60; lon_0 = -50 @@ -18,5 +18,5 @@ # draw states and countries. m.drawcountries() m.drawstates() -pylab.title('map region specified using corner lat/lon values') -pylab.show() +plt.title('map region specified using corner lat/lon values') +plt.show() Modified: trunk/py4science/examples/basemap2.py =================================================================== --- trunk/py4science/examples/basemap2.py 2008年05月30日 20:05:57 UTC (rev 5336) +++ trunk/py4science/examples/basemap2.py 2008年05月30日 20:25:57 UTC (rev 5337) @@ -1,5 +1,5 @@ -import pylab, numpy -from matplotlib.toolkits.basemap import Basemap +from mpl_toolkits.basemap import Basemap +import matplotlib.pyplot as plt # create map by specifying width and height in km. resolution = 'l'; projection = 'lcc' lon_0 = -50; lat_0 = 60 @@ -12,5 +12,5 @@ m.fillcontinents(color='coral',lake_color='aqua') m.drawcountries() m.drawstates() -pylab.title('map region specified using width and height') -pylab.show() +plt.title('map region specified using width and height') +plt.show() Modified: trunk/py4science/examples/basemap3.py =================================================================== --- trunk/py4science/examples/basemap3.py 2008年05月30日 20:05:57 UTC (rev 5336) +++ trunk/py4science/examples/basemap3.py 2008年05月30日 20:25:57 UTC (rev 5337) @@ -1,5 +1,5 @@ -import pylab, numpy -from matplotlib.toolkits.basemap import Basemap +from mpl_toolkits.basemap import Basemap +import matplotlib.pyplot as plt # create map by specifying width and height in km. resolution = 'l'; projection = 'lcc' lon_0 = -50; lat_0 = 60 @@ -23,14 +23,14 @@ m.drawgreatcircle(nylon,nylat,lonlon,lonlat,linewidth=2,color='k') # put the names of the cities to the left of each dot, offset # by a little. Use a bold font. -pylab.text(ny_x-100000,ny_y+100000,'New York',fontsize=12,\ +plt.text(ny_x-100000,ny_y+100000,'New York',fontsize=12,\ color='k',horizontalalignment='right',fontweight='bold') -pylab.text(lon_x-100000,lon_y+100000,'London',fontsize=12,\ +plt.text(lon_x-100000,lon_y+100000,'London',fontsize=12,\ color='k',horizontalalignment='right',fontweight='bold') m.drawcoastlines(linewidth=0.5) m.drawmapboundary(fill_color='aqua') m.fillcontinents(color='coral',lake_color='aqua') m.drawcountries() m.drawstates() -pylab.title('NY to London Great Circle') -pylab.show() +plt.title('NY to London Great Circle') +plt.show() Modified: trunk/py4science/examples/basemap4.py =================================================================== --- trunk/py4science/examples/basemap4.py 2008年05月30日 20:05:57 UTC (rev 5336) +++ trunk/py4science/examples/basemap4.py 2008年05月30日 20:25:57 UTC (rev 5337) @@ -1,5 +1,6 @@ -import pylab, numpy -from matplotlib.toolkits.basemap import Basemap +from mpl_toolkits.basemap import Basemap +import matplotlib.pyplot as plt +import numpy as np # create map by specifying width and height in km. resolution = 'l' lon_0 = -50 @@ -16,9 +17,9 @@ m.drawstates() # label meridians where they intersect the left, right and bottom # of the plot frame. -m.drawmeridians(numpy.arange(-180,181,20),labels=[1,1,0,1]) +m.drawmeridians(np.arange(-180,181,20),labels=[1,1,0,1]) # label parallels where they intersect the left, right and top # of the plot frame. -m.drawparallels(numpy.arange(-80,81,20),labels=[1,1,1,0]) -pylab.title('labelled meridians and parallels',y=1.075) -pylab.show() +m.drawparallels(np.arange(-80,81,20),labels=[1,1,1,0]) +plt.title('labelled meridians and parallels',y=1.075) +plt.show() Modified: trunk/py4science/examples/basemap5.py =================================================================== --- trunk/py4science/examples/basemap5.py 2008年05月30日 20:05:57 UTC (rev 5336) +++ trunk/py4science/examples/basemap5.py 2008年05月30日 20:25:57 UTC (rev 5337) @@ -1,5 +1,6 @@ -from matplotlib.toolkits.basemap import Basemap, NetCDFFile -import pylab, numpy +from mpl_toolkits.basemap import Basemap, NetCDFFile +import matplotlib.pyplot as plt +import numpy as np # read in netCDF sea-surface temperature data # can be a local file, a URL for a remote opendap dataset, # or (if PyNIO is installed) a GRIB or HDF file. @@ -12,15 +13,15 @@ # continent processing (this speeds things up a bit) m = Basemap(projection='moll',lon_0=0,lat_0=0,resolution=None) # compute map projection coordinates of grid. -x, y = m(*numpy.meshgrid(lons, lats)) +x, y = m(*np.meshgrid(lons, lats)) # plot with pcolor -im = m.pcolormesh(x,y,sst,shading='flat',cmap=pylab.cm.gist_ncar) +im = m.pcolormesh(x,y,sst,shading='flat',cmap=plt.cm.gist_ncar) # draw parallels and meridians, but don't bother labelling them. -m.drawparallels(numpy.arange(-90.,120.,30.)) -m.drawmeridians(numpy.arange(0.,420.,60.)) +m.drawparallels(np.arange(-90.,120.,30.)) +m.drawmeridians(np.arange(0.,420.,60.)) # draw line around map projection limb. # color map region background black (missing values will be this color) m.drawmapboundary(fill_color='k') # draw horizontal colorbar. -pylab.colorbar(orientation='horizontal') -pylab.show() +plt.colorbar(orientation='horizontal') +plt.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5336 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5336&view=rev Author: jdh2358 Date: 2008年05月30日 13:05:57 -0700 (2008年5月30日) Log Message: ----------- faq updates Modified Paths: -------------- trunk/matplotlib/doc/faq/index.rst trunk/matplotlib/doc/faq/installing_faq.rst trunk/matplotlib/doc/faq/troubleshooting_faq.rst Added Paths: ----------- trunk/matplotlib/doc/faq/howto_faq.rst Removed Paths: ------------- trunk/matplotlib/doc/faq/plotting_faq.rst Copied: trunk/matplotlib/doc/faq/howto_faq.rst (from rev 5335, trunk/matplotlib/doc/faq/plotting_faq.rst) =================================================================== --- trunk/matplotlib/doc/faq/howto_faq.rst (rev 0) +++ trunk/matplotlib/doc/faq/howto_faq.rst 2008年05月30日 20:05:57 UTC (rev 5336) @@ -0,0 +1,61 @@ +***** +HOWTO +***** + +How do I use matplotlib in a web application server? +==================================================== + +Many users report initial problems trying to use maptlotlib in web +application servers, because by default matplotlib ships configured to +work with a graphical user interface which may require an X11 +connection. Since many barebones application servers do not have X11 +enabled, you may get errors if you don't configure matplotlib for use +in these environments. Most importantly, you need to decide what +kinds of images you want to generate (PNG, PDF, SVG) and configure the +appropriate default backend. For 99% of users, this will be the Agg +backend, which uses the C++ `antigrain <http://antigrain.com`_ +rendering engine to make nice PNGs. The Agg backend is also +configured to recognize requests to generate other output formats +(PDF, PS, EPS, SVG). The easiest way to configure matplotlib to use +Agg is to call:: + + # do this before importing pylab or pyplot + import matplotlib + matplotlib.use('Agg') + import matplotlib.pyplot as plt + +Alternatively, you can avoid pylab/pyplot altogeher, which will give +you a little more control, by calling the API directly as shown in +`agg_oo.py <http://matplotlib.sf.net/examples/api/agg_oo.py`_ . + +You can either generate hardcopy on the filesystem by calling savefig:: + + # do this before importing pylab or pyplot + import matplotlib + matplotlib.use('Agg') + import matplotlib.pyplot as plt + fig = plt.figure() + ax = fig.add_subplot(111) + ax.plot([1,2,3]) + fig.savefig('test.png') + +or by saving to a file handle:: + + import sys + fig.savefig(sys.stdout) + + +How do I use matplotlib with apache? +------------------------------------ + +TODO + +How do I use matplotlib with dhango? +------------------------------------ + +TODO + +How do I use matplotlib with zope? +---------------------------------- + +TODO \ No newline at end of file Modified: trunk/matplotlib/doc/faq/index.rst =================================================================== --- trunk/matplotlib/doc/faq/index.rst 2008年05月30日 19:39:37 UTC (rev 5335) +++ trunk/matplotlib/doc/faq/index.rst 2008年05月30日 20:05:57 UTC (rev 5336) @@ -13,5 +13,5 @@ installing_faq.rst troubleshooting_faq.rst - plotting_faq.rst + howto_faq.rst Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008年05月30日 19:39:37 UTC (rev 5335) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008年05月30日 20:05:57 UTC (rev 5336) @@ -21,3 +21,9 @@ * delete ``site-packages/matplotlib`` directory in the Python installation. The location of ``site-packages`` is platform-specific. + * you may also want to clear some of the cache data that + matplotlib stores in your ``.matplotlib`` directory. You can + find the location of this directory by doing:: + + import matplotlib + print matplotlib.get_configdir() \ No newline at end of file Deleted: trunk/matplotlib/doc/faq/plotting_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/plotting_faq.rst 2008年05月30日 19:39:37 UTC (rev 5335) +++ trunk/matplotlib/doc/faq/plotting_faq.rst 2008年05月30日 20:05:57 UTC (rev 5336) @@ -1,5 +0,0 @@ -************ -Plotting FAQ -************ - - Modified: trunk/matplotlib/doc/faq/troubleshooting_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/troubleshooting_faq.rst 2008年05月30日 19:39:37 UTC (rev 5335) +++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst 2008年05月30日 20:05:57 UTC (rev 5336) @@ -12,15 +12,20 @@ your problem. If not, please provide the following information in your e-mail to the -mailing list: +`mailing list +<http://lists.sourceforge.net/mailman/listinfo/matplotlib-users>`_: - * your operating system - * matplotlib version + * your operating system; on Linux/UNIX post the output of ``uname -a`` + * matplotlib version : ``import matplotlib; print matplotlib.__version__`` * where you obtained matplotlib (e.g. your Linux distribution's packages or the matplotlib Sourceforge site) * any customizations to your ``matplotlibrc`` file - * if the problem is reproducible, please try to provide a minimal, + * if the problem is reproducible, please try to provide a *minimal*, standalone Python script that demonstrates the problem + * you can get very helpful debugging output from matlotlib by + running your script with a ``verbose-helpful`` or + ``--verbose-debug`` flags and posting the verbose output the + lists. If you compiled matplotlib yourself, please also provide @@ -34,6 +39,8 @@ platform that are useful for the matplotlib developers to diagnose your problem. + * your compiler version -- eg, ``gcc --version`` + Including this information in your first e-mail to the mailing list will save a lot of time. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5335 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5335&view=rev Author: jdh2358 Date: 2008年05月30日 12:39:37 -0700 (2008年5月30日) Log Message: ----------- Merged revisions 5334 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint ........ r5334 | jdh2358 | 2008年05月30日 12:38:58 -0700 (2008年5月30日) | 1 line removed debug print statement ........ Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/texmanager.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Name: svnmerge-integrated - /branches/v0_91_maint:1-5330 + /branches/v0_91_maint:1-5334 Modified: trunk/matplotlib/lib/matplotlib/texmanager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/texmanager.py 2008年05月30日 19:38:58 UTC (rev 5334) +++ trunk/matplotlib/lib/matplotlib/texmanager.py 2008年05月30日 19:39:37 UTC (rev 5335) @@ -370,7 +370,7 @@ hack = rcParams['text.dvipnghack'] else: hack = self._dvipng_hack_alpha - print 'using hack', hack + if hack: # hack the alpha channel # dvipng assumed a constant background, whereas we want to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5334 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5334&view=rev Author: jdh2358 Date: 2008年05月30日 12:38:58 -0700 (2008年5月30日) Log Message: ----------- removed debug print statement Modified Paths: -------------- branches/v0_91_maint/lib/matplotlib/texmanager.py Modified: branches/v0_91_maint/lib/matplotlib/texmanager.py =================================================================== --- branches/v0_91_maint/lib/matplotlib/texmanager.py 2008年05月30日 19:38:42 UTC (rev 5333) +++ branches/v0_91_maint/lib/matplotlib/texmanager.py 2008年05月30日 19:38:58 UTC (rev 5334) @@ -338,7 +338,7 @@ hack = rcParams['text.dvipnghack'] else: hack = self._dvipng_hack_alpha - print 'using hack', hack + if hack: # hack the alpha channel # dvipng assumed a constant background, whereas we want to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5333 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5333&view=rev Author: jdh2358 Date: 2008年05月30日 12:38:42 -0700 (2008年5月30日) Log Message: ----------- Merged revisions 5312-5313,5329 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint ........ r5312 | cmoad | 2008年05月29日 15:59:43 -0700 (2008年5月29日) | 1 line tagging new version ........ r5313 | cmoad | 2008年05月29日 20:07:39 -0700 (2008年5月29日) | 1 line minor rev bump ........ r5329 | jdh2358 | 2008年05月30日 12:21:56 -0700 (2008年5月30日) | 1 line added support for None for dvipng and removed the sqrt in the hack which I think is wrong ........ Modified Paths: -------------- trunk/matplotlib/MIGRATION.txt trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/lib/matplotlib/texmanager.py trunk/matplotlib/matplotlibrc.template Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Name: svnmerge-integrated - /branches/v0_91_maint:1-5307 + /branches/v0_91_maint:1-5330 Modified: trunk/matplotlib/MIGRATION.txt =================================================================== --- trunk/matplotlib/MIGRATION.txt 2008年05月30日 19:29:09 UTC (rev 5332) +++ trunk/matplotlib/MIGRATION.txt 2008年05月30日 19:38:42 UTC (rev 5333) @@ -31,7 +31,7 @@ If you already have a working copy of the trunk, your next "svn up" will include the latest transforms changes. -Before installing, make sure you completely remove the old matplotlib +IMPORTANT: Before installing, make sure you completely remove the old matplotlib build and install directories, eg: > cd matplotlib Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008年05月30日 19:29:09 UTC (rev 5332) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008年05月30日 19:38:42 UTC (rev 5333) @@ -43,6 +43,16 @@ else: raise ValueError('Could not convert "%s" to boolean' % b) +def validate_bool_maybe_none(b): + 'Convert b to a boolean or raise' + if type(b) is str: + b = b.lower() + if b=='none': return None + if b in ('t', 'y', 'yes', 'on', 'true', '1', 1, True): return True + elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False): return False + else: + raise ValueError('Could not convert "%s" to boolean' % b) + def validate_float(s): 'convert s to float or raise' try: return float(s) @@ -338,7 +348,7 @@ 'text.usetex' : [False, validate_bool], 'text.latex.unicode' : [False, validate_bool], 'text.latex.preamble' : [[''], validate_stringlist], - 'text.dvipnghack' : [False, validate_bool], + 'text.dvipnghack' : [None, validate_bool_maybe_none], 'text.fontstyle' : ['normal', str], 'text.fontangle' : ['normal', str], 'text.fontvariant' : ['normal', str], Modified: trunk/matplotlib/lib/matplotlib/texmanager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/texmanager.py 2008年05月30日 19:29:09 UTC (rev 5332) +++ trunk/matplotlib/lib/matplotlib/texmanager.py 2008年05月30日 19:38:42 UTC (rev 5333) @@ -366,7 +366,12 @@ pngfile = self.make_png(tex, fontsize, dpi) X = readpng(os.path.join(self.texcache, pngfile)) - if self._dvipng_hack_alpha or rcParams['text.dvipnghack']: + if rcParams['text.dvipnghack'] is not None: + hack = rcParams['text.dvipnghack'] + else: + hack = self._dvipng_hack_alpha + print 'using hack', hack + if hack: # hack the alpha channel # dvipng assumed a constant background, whereas we want to # overlay these rasters with antialiasing over arbitrary @@ -388,7 +393,8 @@ # # Since the foreground is black (0) and the background is # white (1) this reduces to red = 1-alpha or alpha = 1-red - alpha = np.sqrt(1-X[:,:,0]) + #alpha = npy.sqrt(1-X[:,:,0]) # should this be sqrt here? + alpha = 1-X[:,:,0] else: alpha = X[:,:,-1] Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2008年05月30日 19:29:09 UTC (rev 5332) +++ trunk/matplotlib/matplotlibrc.template 2008年05月30日 19:38:42 UTC (rev 5333) @@ -147,9 +147,14 @@ # beware of package collisions: color, geometry, graphicx, # type1cm, textcomp. Adobe Postscript (PSSNFS) font packages # may also be loaded, depending on your font settings -#text.dvipnghack : False # some versions of dvipng don't handle - # alpha channel properly. Use True to correct and flush - # ~/.matplotlib/tex.cache before testing + +#text.dvipnghack : None # some versions of dvipng don't handle alpha + # channel properly. Use True to correct + # and flush ~/.matplotlib/tex.cache + # before testing and False to force + # correction off. None will try and + # guess based on your dvipng version + #text.markup : 'plain' # Affects how text, such as titles and labels, are # interpreted by default. # 'plain': As plain, unformatted text This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5332 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5332&view=rev Author: mdboom Date: 2008年05月30日 12:29:09 -0700 (2008年5月30日) Log Message: ----------- Correcting typo Modified Paths: -------------- trunk/matplotlib/doc/users/mathtext.rst Modified: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst 2008年05月30日 19:28:56 UTC (rev 5331) +++ trunk/matplotlib/doc/users/mathtext.rst 2008年05月30日 19:29:09 UTC (rev 5332) @@ -202,7 +202,7 @@ ------- You can also use a large number of the TeX symbols, as in ``\infty``, -``\leftarrow``, ``\sum``, ``\int``; see :class:`matplotlib.mathtext` for a +``\leftarrow``, ``\sum``, ``\int``; see :mod:`matplotlib.mathtext` for a complete list. If a particular symbol does not have a name (as is true of many of the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5331 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5331&view=rev Author: mdboom Date: 2008年05月30日 12:28:56 -0700 (2008年5月30日) Log Message: ----------- Adding some FAQs Modified Paths: -------------- trunk/matplotlib/doc/faq/index.rst trunk/matplotlib/doc/faq/installing_faq.rst Added Paths: ----------- trunk/matplotlib/doc/faq/troubleshooting_faq.rst Modified: trunk/matplotlib/doc/faq/index.rst =================================================================== --- trunk/matplotlib/doc/faq/index.rst 2008年05月30日 19:24:37 UTC (rev 5330) +++ trunk/matplotlib/doc/faq/index.rst 2008年05月30日 19:28:56 UTC (rev 5331) @@ -12,5 +12,6 @@ .. toctree:: installing_faq.rst + troubleshooting_faq.rst plotting_faq.rst Modified: trunk/matplotlib/doc/faq/installing_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/installing_faq.rst 2008年05月30日 19:24:37 UTC (rev 5330) +++ trunk/matplotlib/doc/faq/installing_faq.rst 2008年05月30日 19:28:56 UTC (rev 5331) @@ -1,7 +1,23 @@ -**************** -Installation FAQ -**************** +================== + Installation FAQ +================== +How do I report a compilation problem? +====================================== +See :ref:`reporting_problems`. +How do I cleanly rebuild and reinstall everything? +================================================== +Unfortunately:: + + python setup.py clean + +does not properly clean the build directory, and does nothing to the +install directory. To cleanly rebuild: + + * delete the ``build`` directory in the source tree + * delete ``site-packages/matplotlib`` directory in the Python + installation. The location of ``site-packages`` is + platform-specific. Added: trunk/matplotlib/doc/faq/troubleshooting_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/troubleshooting_faq.rst (rev 0) +++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst 2008年05月30日 19:28:56 UTC (rev 5331) @@ -0,0 +1,45 @@ +=================== +Troubleshooting FAQ +=================== + +.. _reporting_problems: + +How do I report a problem? +========================== + +If you are having a problem with matplotlib, search the mailing +lists first: There's a good chance someone else has already run into +your problem. + +If not, please provide the following information in your e-mail to the +mailing list: + + * your operating system + * matplotlib version + * where you obtained matplotlib (e.g. your Linux distribution's + packages or the matplotlib Sourceforge site) + * any customizations to your ``matplotlibrc`` file + * if the problem is reproducible, please try to provide a minimal, + standalone Python script that demonstrates the problem + +If you compiled matplotlib yourself, please also provide + + * any changes you have made to ``setup.py`` or ``setupext.py`` + * the output of:: + + rm -rf build + python setup.py build + + The beginning of the build output contains lots of details about your + platform that are useful for the matplotlib developers to diagnose + your problem. + +Including this information in your first e-mail to the mailing list +will save a lot of time. + +You will likely get a faster response writing to the mailing list than +filing a bug in the bug tracker. Most developers check the bug +tracker only periodically. If your problem has been determined to be +a bug and can not be quickly solved, you may be asked to file a bug in +the tracker so the issue doesn't get lost. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5330 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5330&view=rev Author: jdh2358 Date: 2008年05月30日 12:24:37 -0700 (2008年5月30日) Log Message: ----------- fixed some finance mod bugs Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/finance.py Modified: trunk/matplotlib/lib/matplotlib/finance.py =================================================================== --- trunk/matplotlib/lib/matplotlib/finance.py 2008年05月30日 19:21:56 UTC (rev 5329) +++ trunk/matplotlib/lib/matplotlib/finance.py 2008年05月30日 19:24:37 UTC (rev 5330) @@ -335,7 +335,7 @@ scale = ax.figure.dpi * (1.0/72.0) - tickTransform = Affine2D().scaled(scale, 0.0) + tickTransform = Affine2D().scale(scale, 0.0) r,g,b = colorConverter.to_rgb(colorup) colorup = r,g,b,1 @@ -411,24 +411,14 @@ # note this code assumes if any value open, close, low, high is # missing they all are missing - right = width/2.0 - left = -width/2.0 + + delta = width/2. + barVerts = [ ( (i-delta, open), (i-delta, close), (i+delta, close), (i+delta, open) ) for i, open, close in zip(xrange(len(opens)), opens, closes) if open != -1 and close!=-1 ] - barVerts = [ ( (left, 0), (left, close-open), (right, close-open), (right, 0) ) for open, close in zip(opens, closes) if open != -1 and close!=-1 ] - rangeSegments = [ ((i, low), (i, high)) for i, low, high in zip(xrange(len(lows)), lows, highs) if low != -1 ] - offsetsBars = [ (i, open) for i,open in zip(xrange(len(opens)), opens) if open != -1 ] - - sx = ax.figure.dpi * (1.0/72.0) # scale for points - sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) - - barTransform = Affine2D().scaled(sx,sy) - - - r,g,b = colorConverter.to_rgb(colorup) colorup = r,g,b,alpha r,g,b = colorConverter.to_rgb(colordown) @@ -440,8 +430,6 @@ assert(len(barVerts)==len(rangeSegments)) - assert(len(rangeSegments)==len(offsetsBars)) - assert(len(offsetsBars)==len(colors)) useAA = 0, # use tuple here lw = 0.5, # and here @@ -457,19 +445,13 @@ edgecolors = ( (0,0,0,1), ), antialiaseds = useAA, linewidths = lw, - offsets = offsetsBars, - transOffset = ax.transData, ) - barCollection.set_transform(barTransform) - - - - minpy, maxx = (0, len(rangeSegments)) + minx, maxx = 0, len(rangeSegments) miny = min([low for low in lows if low !=-1]) maxy = max([high for high in highs if high != -1]) - corners = (minpy, miny), (maxx, maxy) + corners = (minx, miny), (maxx, maxy) ax.update_datalim(corners) ax.autoscale_view() @@ -504,38 +486,17 @@ } colors = [colord[open<close] for open, close in zip(opens, closes) if open!=-1 and close !=-1] - right = width/2.0 - left = -width/2.0 + delta = width/2. + bars = [ ( (i-delta, 0), (i-delta, v), (i+delta, v), (i+delta, 0)) for i, v in enumerate(volumes) if v != -1 ] - - bars = [ ( (left, 0), (left, v), (right, v), (right, 0)) for v in volumes if v != -1 ] - - sx = ax.figure.dpi * (1.0/72.0) # scale for points - sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) - - barTransform = Affine2D().scaled(sx,sy) - - offsetsBars = [ (i, 0) for i,v in enumerate(volumes) if v != -1 ] - barCollection = PolyCollection(bars, facecolors = colors, edgecolors = ( (0,0,0,1), ), antialiaseds = (0,), linewidths = (0.5,), - offsets = offsetsBars, - transOffset = ax.transData, ) - barCollection.set_transform(barTransform) - - - - - - minpy, maxx = (0, len(offsetsBars)) - miny = 0 - maxy = max([v for v in volumes if v!=-1]) - corners = (minpy, miny), (maxx, maxy) + corners = (0, 0), (len(bars), max(volumes)) ax.update_datalim(corners) ax.autoscale_view() @@ -601,9 +562,9 @@ bars = [ ( (left, 0), (left, volume), (right, volume), (right, 0)) for d, open, close, high, low, volume in quotes] sx = ax.figure.dpi * (1.0/72.0) # scale for points - sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) + sy = ax.bbox.height / ax.viewLim.height - barTransform = Affine2D().scaled(sx,sy) + barTransform = Affine2D().scale(sx,sy) dates = [d for d, open, close, high, low, volume in quotes] offsetsBars = [(d, 0) for d in dates] @@ -661,9 +622,9 @@ bars = [ ( (left, 0), (left, v), (right, v), (right, 0)) for v in vals if v != -1 ] sx = ax.figure.dpi * (1.0/72.0) # scale for points - sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) + sy = ax.bbox.height / ax.viewLim.height - barTransform = Affine2D().scaled(sx,sy) + barTransform = Affine2D().scale(sx,sy) offsetsBars = [ (i, 0) for i,v in enumerate(vals) if v != -1 ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5329 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5329&view=rev Author: jdh2358 Date: 2008年05月30日 12:21:56 -0700 (2008年5月30日) Log Message: ----------- added support for None for dvipng and removed the sqrt in the hack which I think is wrong Modified Paths: -------------- branches/v0_91_maint/lib/matplotlib/rcsetup.py branches/v0_91_maint/lib/matplotlib/texmanager.py branches/v0_91_maint/matplotlibrc.template Modified: branches/v0_91_maint/lib/matplotlib/rcsetup.py =================================================================== --- branches/v0_91_maint/lib/matplotlib/rcsetup.py 2008年05月30日 18:59:44 UTC (rev 5328) +++ branches/v0_91_maint/lib/matplotlib/rcsetup.py 2008年05月30日 19:21:56 UTC (rev 5329) @@ -42,6 +42,16 @@ else: raise ValueError('Could not convert "%s" to boolean' % b) +def validate_bool_maybe_none(b): + 'Convert b to a boolean or raise' + if type(b) is str: + b = b.lower() + if b=='none': return None + if b in ('t', 'y', 'yes', 'on', 'true', '1', 1, True): return True + elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False): return False + else: + raise ValueError('Could not convert "%s" to boolean' % b) + def validate_float(s): 'convert s to float or raise' try: return float(s) @@ -339,7 +349,7 @@ 'text.usetex' : [False, validate_bool], 'text.latex.unicode' : [False, validate_bool], 'text.latex.preamble' : [[''], validate_stringlist], - 'text.dvipnghack' : [False, validate_bool], + 'text.dvipnghack' : [None, validate_bool_maybe_none], 'text.fontstyle' : ['normal', str], 'text.fontangle' : ['normal', str], 'text.fontvariant' : ['normal', str], Modified: branches/v0_91_maint/lib/matplotlib/texmanager.py =================================================================== --- branches/v0_91_maint/lib/matplotlib/texmanager.py 2008年05月30日 18:59:44 UTC (rev 5328) +++ branches/v0_91_maint/lib/matplotlib/texmanager.py 2008年05月30日 19:21:56 UTC (rev 5329) @@ -334,7 +334,12 @@ pngfile = self.make_png(tex, fontsize, dpi) X = readpng(os.path.join(self.texcache, pngfile)) - if self._dvipng_hack_alpha or rcParams['text.dvipnghack']: + if rcParams['text.dvipnghack'] is not None: + hack = rcParams['text.dvipnghack'] + else: + hack = self._dvipng_hack_alpha + print 'using hack', hack + if hack: # hack the alpha channel # dvipng assumed a constant background, whereas we want to # overlay these rasters with antialiasing over arbitrary @@ -356,7 +361,9 @@ # # Since the foreground is black (0) and the background is # white (1) this reduces to red = 1-alpha or alpha = 1-red - alpha = npy.sqrt(1-X[:,:,0]) + #alpha = npy.sqrt(1-X[:,:,0]) # should this be sqrt here? + alpha = 1-X[:,:,0] + else: alpha = X[:,:,-1] Modified: branches/v0_91_maint/matplotlibrc.template =================================================================== --- branches/v0_91_maint/matplotlibrc.template 2008年05月30日 18:59:44 UTC (rev 5328) +++ branches/v0_91_maint/matplotlibrc.template 2008年05月30日 19:21:56 UTC (rev 5329) @@ -147,9 +147,14 @@ # beware of package collisions: color, geometry, graphicx, # type1cm, textcomp. Adobe Postscript (PSSNFS) font packages # may also be loaded, depending on your font settings -#text.dvipnghack : False # some versions of dvipng don't handle - # alpha channel properly. Use True to correct and flush - # ~/.matplotlib/tex.cache before testing + +#text.dvipnghack : None # some versions of dvipng don't handle alpha + # channel properly. Use True to correct + # and flush ~/.matplotlib/tex.cache + # before testing and False to force + # correction off. None will try and + # guess based on your dvipng version + #text.markup : 'plain' # Affects how text, such as titles and labels, are # interpreted by default. # 'plain': As plain, unformatted text This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5328 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5328&view=rev Author: mdboom Date: 2008年05月30日 11:59:44 -0700 (2008年5月30日) Log Message: ----------- Elaborate on mathtext documentation. Modified Paths: -------------- trunk/matplotlib/doc/users/index.rst trunk/matplotlib/doc/users/pyplot_tutorial.rst Added Paths: ----------- trunk/matplotlib/doc/users/mathtext.rst Modified: trunk/matplotlib/doc/users/index.rst =================================================================== --- trunk/matplotlib/doc/users/index.rst 2008年05月30日 17:34:24 UTC (rev 5327) +++ trunk/matplotlib/doc/users/index.rst 2008年05月30日 18:59:44 UTC (rev 5328) @@ -93,6 +93,7 @@ .. toctree:: pyplot_tutorial.rst + mathtext.rst navigation_toolbar.rst customizing.rst artists.rst Added: trunk/matplotlib/doc/users/mathtext.rst =================================================================== --- trunk/matplotlib/doc/users/mathtext.rst (rev 0) +++ trunk/matplotlib/doc/users/mathtext.rst 2008年05月30日 18:59:44 UTC (rev 5328) @@ -0,0 +1,225 @@ +Writing mathematical expressions +================================ + +You can use TeX markup in any matplotlib text string; see the +:mod:`matplotlib.mathtext` module documentation for details. Note +that you do not need to have TeX installed, since matplotlib ships its +own TeX expression parser, layout engine and fonts. The layout engine +is a fairly direct adaptation of the layout algorithms in Donald +Knuth's TeX, so the quality is quite good (matplotlib also provides a +``usetex`` option for those who do want to call out to TeX to generate +their text). + +Any text element can use math text. You need to use raw strings +(preceed the quotes with an ``'r'``), and surround the string text +with dollar signs, as in TeX. Regular text and mathtext can be +interleaved within the same string. Mathtext can use the Computer +Modern fonts (from (La)TeX), `STIX <http://www.aip.org/stixfonts/>`_ +fonts (with are designed to blend well with Times) or a Unicode font +that you provide. The mathtext font can be selected with the +customization variable ``mathtext.fontset``. + +Here is a simple example:: + + # plain text + plt.title('alpha > beta') + +produces "alpha > beta". + +Whereas this:: + + # math text + plt.title(r'$\alpha > \beta$') + +produces ":math:`\alpha > \beta`". + +.. TODO: Include a complete list here + +Subscripts and superscripts +--------------------------- + +To make subscripts and superscripts, use the ``'_'`` and ``'^'`` symbols:: + + r'$\alpha_i > \beta_i$' + +.. math:: + + \alpha_i > \beta_i + +Some symbols automatically put their sub/superscripts under and over +the operator. For example, to write the sum of :math:`x_i` from :math:`0` to +:math:`\infty`, you could do:: + + r'$\sum_{i=0}^\infty x_i$' + +.. math:: + + \sum_{i=0}^\infty x_i + +Fractions +--------- + +Fractions can be created with the ``\frac{}{}`` command:: + + r'$\frac{3}{4}$' + +produces + +.. math:: + + \frac{3}{4} + +Fractions can be arbitrarily nested:: + + r'$\frac{5 - \frac{1}{x}}{4}$' + +produces + +.. math:: + + \frac{5 - \frac{1}{x}}{4} + +Note that special care needs to be taken to place parentheses and brackets around +fractions. Doing things the obvious way produces brackets that are +too small:: + + r'$(\frac{5 - \frac{1}{x}}{4})$' + +.. math :: + + (\frac{5 - \frac{1}{x}}{4}) + +The solution is to precede the bracket with ``\left`` and ``\right`` +to inform the parser that those brackets encompass the entire object:: + + r'$\left(\frac{5 - \frac{1}{x}}{4}\right)$' + +.. math :: + + \left(\frac{5 - \frac{1}{x}}{4}\right) + +Radicals +-------- + +Radicals can be produced with the ``\sqrt[]{}`` command. For example: + + r'$\sqrt{2}$' + +.. math :: + + \sqrt{2} + +Any base can (optionally) be provided inside square brackets. Note +that the base must be a simple expression, and can not contain layout +commands such as fractions or sub/superscripts. + + r'$\sqrt[3]{x}$' + +.. math :: + + \sqrt[3]{x} + +Fonts +----- + +The default font is *italics* for mathematical symbols. To change +fonts, eg, to write "sin" in a Roman font, enclose the text in a font +command:: + + r'$s(t) = \mathcal{A}\mathrm{sin}(2 \omega t)$' + +.. math:: + + s(t) = \mathcal{A}\mathrm{sin}(2 \omega t) + +More conveniently, many commonly used function names that are typeset in a +Roman font have shortcuts. So the expression above could be written +as follows:: + + r'$s(t) = \mathcal{A}\sin(2 \omega t)$' + +.. math:: + + s(t) = \mathcal{A}\sin(2 \omega t) + +Here "s" and "t" are variable in italics font (default), "sin" is in +Roman font, and the amplitude "A" is in calligraphy font. + +The choices available with all fonts are: + + =============== ================================= + Command Result + =============== ================================= + ``\mathrm`` :math:`\mathrm{Roman}` + ``\mathit`` :math:`\mathit{Italic}` + ``\mathtt`` :math:`\mathtt{Typewriter}` + ``\mathcal`` :math:`\mathcal{CALLIGRAPHY}` + =============== ================================= + +When using the STIX fonts, you also have the choice of: + + ================ ================================= + Command Result + ================ ================================= + ``\mathbb`` :math:`\mathbb{Blackboard}` + ``\mathcircled`` :math:`\mathcircled{Circled}` + ``\mathfrak`` :math:`\mathfrak{Fraktur}` + ``\mathsf`` :math:`\mathsf{sans-serif}` + ================ ================================= + +Accents +------- + +An accent command may precede any symbol to add an accent above it. +There are long and short forms for some of them. + + ============================== ================================= + Command Result + ============================== ================================= + ``\acute a`` or ``\'a`` :math:`\acute a` + ``\bar a`` :math:`\bar a` + ``\breve a`` :math:`\breve a` + ``\ddot a`` or ``\"a`` :math:`\ddot a` + ``\dot a`` or ``\.a`` :math:`\dot a` + ``\grave a`` or ``\\`a`` :math:`\grave a` + ``\hat a`` or ``\^a`` :math:`\hat a` + ``\tilde a`` or ``\~a`` :math:`\tilde a` + ``\vec a`` :math:`\vec a` + ============================== ================================= + +In addition, there are two special accents that automatically adjust +to the width of the symbols below: + + ============================== ================================= + Command Result + ============================== ================================= + ``\widehat{xyz}`` :math:`\widehat{xyz}` + ``\widetilde{xyz}`` :math:`\widetilde{xyz}` + ============================== ================================= + + +Symbols +------- + +You can also use a large number of the TeX symbols, as in ``\infty``, +``\leftarrow``, ``\sum``, ``\int``; see :class:`matplotlib.mathtext` for a +complete list. + +If a particular symbol does not have a name (as is true of many of the +more obscure symbols in the STIX fonts), Unicode characters can +also be used:: + + ur'Generic symbol: $\u23ce$' + +Example +------- + +Here is an example illustrating many of these features in context. + +.. literalinclude:: figures/pyplot_mathtext.py + +.. image:: figures/pyplot_mathtext.png + :scale: 50 + + + Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst =================================================================== --- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008年05月30日 17:34:24 UTC (rev 5327) +++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008年05月30日 18:59:44 UTC (rev 5328) @@ -76,7 +76,7 @@ * Use the setter methods of the ``Line2D`` instance. ``plot`` returns a list of lines; eg ``line1, line2 = plot(x1,y1,x2,x2)``. Below I have only - one line so it is a list of length 1. I use tuple unpacking in the + one line so it is a list of7 length 1. I use tuple unpacking in the ``line, = plot(x, y, 'o')`` to get the first element of the list:: line, = plt.plot(x, y, 'o') @@ -266,77 +266,3 @@ -Writing mathematical expressions -================================ - -You may have noticed in the histogram example above that we slipped a -little TeX markup into the expression ``r'$\mu=100,\ \sigma=15$')`` -You can use TeX markup in any matplotlib text string; see the -:mod:`matplotlib.mathtext` module documentation for details. Note -that you do not need to have TeX installed, since matplotlib ships -its own TeX expression parser, layout engine and fonts. Michael -Droettboom has implemented the Knuth layout algorithms in python, so -the quality is quite good (matplotlib also provides a ``usetex`` option -for those who do want to call out to TeX to generate their text). - -Any text element can use math text. You need to use raw strings -(preceed the quotes with an ``'r'``), and surround the string text -with dollar signs, as in TeX. Regular text and mathtext can be -interleaved within the same string. Mathtext can use the Bakoma -Computer Modern fonts, STIX fonts or a Unicode font that you provide. -The mathtext font can be selected with the customization variable -``mathtext.fontset``:: - - # plain text - plt.title('alpha > beta') - - # math text - plt.title(r'$\alpha > \beta$') - - -To make subscripts and superscripts use the '_' and '^' symbols:: - - plt.title(r'$\alpha_i > \beta_i$') - -You can also use a large number of the TeX symbols, as in ``\infty, -\leftarrow, \sum, \int``; see :class:`matplotlib.mathtext` for a -complete list. The over/under subscript/superscript style is also -supported. To write the sum of x_i from 0 to infinity, you could do:: - - plt.text(1, -0.6, r'$\sum_{i=0}^\infty x_i$') - -The default font is *italics* for mathematical symbols. To change -fonts, eg, to write "sin" in a Roman font, enclose the text in a font -command:: - - plt.text(1,2, r's(t) = $\mathcal{A}\mathrm{sin}(2 \omega t)$') - - -Even better, many commonly used function names that are typeset in a -Roman font have shortcuts. So the expression above could be written -as follows:: - - plt.text(1,2, r's(t) = $\mathcal{A}\sin(2 \omega t)$') - - -Here "s" and "t" are variable in italics font (default), "sin" is in -Roman font, and the amplitude "A" is in caligraphy font. The font -choices are Roman ``\mathrm``, italics ``\mathit``, caligraphy -``\mathcal``, and typewriter ``\mathtt``. If using the STIX fonts, -you also have the choice of blackboard (double-struck) ``\mathbb``, -circled ``\mathcircled``, Fraktur ``\mathfrak``, script (cursive) -``\mathscr`` and sans-serif ``\mathsf``. - -The following accents are provided: ``\hat``, ``\breve``, ``\grave``, -``\bar``, ``\acute``, ``\tilde``, ``\vec``, ``\dot``, ``\ddot``. All -of them have the same syntax, eg to make an overbar you do ``\bar{o}`` -or to make an o umlaut you do ``\ddot{o}``. - -.. literalinclude:: figures/pyplot_mathtext.py - -.. image:: figures/pyplot_mathtext.png - :scale: 50 - - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5327 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5327&view=rev Author: jdh2358 Date: 2008年05月30日 10:34:24 -0700 (2008年5月30日) Log Message: ----------- updated site docs for 0.98 Modified Paths: -------------- trunk/htdocs/API_CHANGES trunk/htdocs/CHANGELOG trunk/htdocs/convert.py trunk/htdocs/credits.html.template trunk/htdocs/license.html.template trunk/htdocs/make.py trunk/htdocs/matplotlib.afm.html.template trunk/htdocs/matplotlib.artist.html.template trunk/htdocs/matplotlib.axes.html.template trunk/htdocs/matplotlib.axis.html.template trunk/htdocs/matplotlib.backend_bases.html.template trunk/htdocs/matplotlib.backends.backend_agg.html.template trunk/htdocs/matplotlib.backends.backend_cairo.html.template trunk/htdocs/matplotlib.backends.backend_gtk.html.template trunk/htdocs/matplotlib.backends.backend_gtkagg.html.template trunk/htdocs/matplotlib.backends.backend_gtkcairo.html.template trunk/htdocs/matplotlib.backends.backend_ps.html.template trunk/htdocs/matplotlib.backends.backend_qt.html.template trunk/htdocs/matplotlib.backends.backend_qtagg.html.template trunk/htdocs/matplotlib.backends.backend_svg.html.template trunk/htdocs/matplotlib.backends.backend_template.html.template trunk/htdocs/matplotlib.backends.backend_tkagg.html.template trunk/htdocs/matplotlib.backends.backend_wx.html.template trunk/htdocs/matplotlib.backends.backend_wxagg.html.template trunk/htdocs/matplotlib.cbook.html.template trunk/htdocs/matplotlib.cm.html.template trunk/htdocs/matplotlib.collections.html.template trunk/htdocs/matplotlib.colorbar.html.template trunk/htdocs/matplotlib.colors.html.template trunk/htdocs/matplotlib.contour.html.template trunk/htdocs/matplotlib.dates.html.template trunk/htdocs/matplotlib.dviread.html.template trunk/htdocs/matplotlib.figure.html.template trunk/htdocs/matplotlib.finance.html.template trunk/htdocs/matplotlib.font_manager.html.template trunk/htdocs/matplotlib.fontconfig_pattern.html.template trunk/htdocs/matplotlib.ft2font.html.template trunk/htdocs/matplotlib.image.html.template trunk/htdocs/matplotlib.legend.html.template trunk/htdocs/matplotlib.lines.html.template trunk/htdocs/matplotlib.mathtext.html trunk/htdocs/matplotlib.mathtext.html.template trunk/htdocs/matplotlib.mlab.html.template trunk/htdocs/matplotlib.numerix.html.template trunk/htdocs/matplotlib.patches.html.template trunk/htdocs/matplotlib.pylab.html.template trunk/htdocs/matplotlib.pyplot.html.template trunk/htdocs/matplotlib.quiver.html.template trunk/htdocs/matplotlib.rcsetup.html.template trunk/htdocs/matplotlib.table.html.template trunk/htdocs/matplotlib.texmanager.html.template trunk/htdocs/matplotlib.text.html.template trunk/htdocs/matplotlib.ticker.html.template trunk/htdocs/matplotlib.transforms.html.template trunk/htdocs/matplotlib.type1font.html.template trunk/htdocs/matplotlib.units.html.template trunk/htdocs/matplotlib.widgets.html.template trunk/htdocs/matplotlibrc trunk/htdocs/screenshots/makeshots.py trunk/htdocs/screenshots.html.template trunk/htdocs/tut/custom_axes.png trunk/htdocs/tut/date_demo2.png trunk/htdocs/tut/firstfig.png trunk/htdocs/tut/mathtext_tut.png trunk/htdocs/tut/secondfig.png trunk/htdocs/tut/subplot.png trunk/htdocs/tut/text_dict.png trunk/htdocs/tut/text_simple.png trunk/htdocs/tut/thirdfig.png trunk/htdocs/whats_new.html.template Added Paths: ----------- trunk/htdocs/screenshots/ellipse_demo.py Removed Paths: ------------- trunk/htdocs/screenshots/ellipse_large.py Modified: trunk/htdocs/API_CHANGES =================================================================== --- trunk/htdocs/API_CHANGES 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/API_CHANGES 2008年05月30日 17:34:24 UTC (rev 5327) @@ -1,3 +1,209 @@ + + matplotlib.image.imread now no longer always returns RGBA -- if + the image is luminance or RGB, it will return a MxN or MxNx3 array + if possible. Also uint8 is no longer always forced to float. + + Rewrote the cm.ScalarMappable callback infrastructure to use + cbook.CallbackRegistry rather than custom callback handling. Amy + users of add_observer/notify of the cm.ScalarMappable should uae + the cm.ScalarMappable.callbacksSM CallbackRegistry instead. + + New axes function and Axes method provide control over the plot + color cycle: axes.set_default_color_cycle(clist) and + Axes.set_color_cycle(clist). + + matplotlib now requires python2.4, so matplotlib.cbook will no + loner provide set, enumerate, reversed or izip compatability functions + + In numpy 1.0 bins are specified by the left edges only. The axes + method "hist" now uses future numpy 1.3 semantic for histograms. + Providing binedges, the last value gives the upper-right edge now, + which was implicitly set to +infinity in numpy 1.0. This also means + that the last bin doesn't contain upper outliers any more by default. + + New axes method and pyplot function, hexbin, is an alternative + to scatter for large datasets. It makes something like a + pcolor of a 2-D histogram, but uses hexagonal bins. + + New kwarg, "symmetric", in MaxNLocator + allows one require an axis to be centered on zero. + + toolkits must now be imported from mpl_toolkits (not matplotlib.toolkits) + +TRANSFORMS REFACTORING + + The primary goal of this refactoring was to make it easier to + extend matplotlib to support new kinds of projections. This is + primarily an internal improvement, and the possible user-visible + changes it allows are yet to come. + + See transforms.py for a description of the design of the new + transformation framework. + + The view intervals are now stored only in one place -- in the Axes + instance, not in the formatter instances as well. This means + formatters must get their limits from their Axis, which in turn + looks up its limits from the Axes. If a Locator is used + temporarily and not assigned to an Axis or Axes, (e.g. in + contour.py), a dummy axis must be created to store its bounds. + Call Locator.create_dummy_axis() to do so. + + The functionality of Pbox has been merged with Bbox. Its methods + now all return copies rather than modifying in place. + + The following lists many of the simple changes necessary to update + code from the old transformation framework to the new one. In + particular, methods that return a copy are named with a verb in + the past tense, whereas methods that alter an object in place are + named with a very in the present tense. + + transforms.py + Bbox.get_bounds() Bbox.bounds + + Bbox.width() Bbox.width + + Bbox.height() Bbox.height + + Bbox.intervalx().get_bounds() Bbox.intervalx + Bbox.intervalx().set_bounds() + [Bbox.intervalx is now a property.] + + Bbox.intervaly().get_bounds() Bbox.intervaly + Bbox.intervaly().set_bounds() + [Bbox.intervaly is now a property.] + + Bbox.xmin() Bbox.x0 or Bbox.xmin + Bbox.ymin() Bbox.y0 or Bbox.ymin + Bbox.xmax() Bbox.x1 or Bbox.xmax + Bbox.ymax() Bbox.y1 or Bbox.ymax + [The Bbox is bound by the points (x0, y0) to (x1, y1) and + there is no defined order to these points, that is, x0 is not + necessarily the left edge of the box. To get the left edge of + the Bbox, use the read-only property xmin.] + + Bbox.overlaps(bboxes) Bbox.count_overlaps(bboxes) + + bbox_all(bboxes) Bbox.union(bboxes) + [Bbox.union is a staticmethod.] + + lbwh_to_bbox(l, b, w, h) Bbox.from_bounds(x0, y0, w, h) + + inverse_transform_bbox(trans, bbox) bbox.inverse_transformed(trans) + + Interval.contains_open(v) interval_contains_open(tuple, v) + Interval.contains(v) interval_contains_open(tuple, v) + + identity_transform() IdentityTransform() + + blend_xy_sep_transform(xtrans, ytrans) blended_transform_factory(xtrans, ytrans) + + scale_transform(xs, ys) Affine2D().scale(xs[, ys]) + + get_bbox_transform(boxin, boxout) BboxTransform(boxin, boxout) or + BboxTransformFrom(boxin) or + BboxTransformTo(boxout) + + Transform.seq_xy_tup(points) Transform.transform(points) + + Transform.inverse_xy_tup(points) Transform.inverted().transform(points) + + axes.py + Axes.get_position() Axes.get_position() + [Axes.get_position() used to return a list of points, not it + returns a transforms.Bbox instance.] + + Axes.set_position() Axes.set_position() + [Axes.set_position() now accepts either four scalars or a + transforms Bbox instance.] + + [also returns a Bbox] + Axes.toggle_log_lineary() Axes.set_yscale() + [Since the recfactoring allows for more than two scale types + ('log' or 'linear'), it no longer makes sense to have a + toggle. Axes.toggle_log_lineary() has been removed.] + + Axes.hlines(linestyle=) Axes.hlines(linestyles=) + Axes.vlines(linestyle=) Axes.vlines(linestyles=) + [The kwarg 'linestyle' has been replaced with 'linestyles', + which accepts either a single linestyle or a list of + linestyles to use.] + + Subplot class is gone -- now there is only SubplotBase. + + The Polar class has moved to projections/polar.py + + artist.py + Artist.set_clip_path(path) Artist.set_clip_path(path, transform) + [set_clip_path now accepts a path.Path instance and a + transformation that will be applied to the path immediately + before clipping.] + + collections.py + linestyle linestyles + [Linestyles are now treated like all other collection + attributes -- a single value or multiple values may be + provided.] + + colors.py + ColorConvertor.to_rgba_list(c) ColorConvertor.to_rgba_array(c) + [ColorConvertor.to_rgba_array(c) returns an Nx4 Numpy array of + RGBA color quadruples.] + + contour.py + Contour._segments Contour.get_paths() + [Contour.get_paths() now returns a list of path.Path instances.] + + figure.py + Figure.dpi.get()/set() Figure.dpi (a property) + + patches.py + get_verts() get_path() + [Patch.get_path() returns a path.Path instance.] + + backend_bases.py + GraphicsContext.set_clip_rectangle(tuple) GraphicsContext.set_clip_rectangle(bbox) + + GraphicsContext.get_clip_path() GraphicsContext.get_clip_path() + [GraphicsContext.get_clip_path() returns a tuple of the form + (path, affine_transform), where path is a path.Path instance + and affine_transform is a transforms.Affine2D instance.] + + GraphicsContext.set_clip_path(clippath) GraphicsContext.set_clip_path(clippath) + [Now accepts only an instance of transforms.TransformedPath.] + + RendererBase class: + **new methods** ---> + draw_path(self, gc, path, transform, rgbFace) + + draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace) + + draw_path_collection(self, master_transform, cliprect, clippath, + clippath_trans, paths, all_transforms, offsets, + offsetTrans, facecolors, edgecolors, linewidths, + linestyles, antialiaseds) [optional] + + + **changed methods** ---> + draw_image(self, x, y, im, bbox) draw_image(self, x, y, im, bbox, + clippath, clippath_trans) + + **removed methods** ---> + draw_arc + draw_line_collection + draw_line + draw_lines + draw_point + draw_quad_mesh + draw_poly_collection + draw_polygon + draw_rectangle + draw_regpoly_collection + +END OF TRANSFORMS REFACTORING + + + + 0.91.2 Released For csv2rec, checkrows=0 is the new default indicating all rows Modified: trunk/htdocs/CHANGELOG =================================================================== --- trunk/htdocs/CHANGELOG 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/CHANGELOG 2008年05月30日 17:34:24 UTC (rev 5327) @@ -1,4 +1,255 @@ =============================================================== +2008年05月29日 Released 0.98.0 at revision 5314 + +2008年05月29日 matplotlib.image.imread now no longer always returns RGBA + -- if the image is luminance or RGB, it will return a MxN + or MxNx3 array if possible. Also uint8 is no longer always + forced to float. + +2008年05月29日 Implement path clipping in PS backend - JDH + +2008年05月29日 Fixed two bugs in texmanager.py: + improved comparison of dvipng versions + fixed a bug introduced when get_grey method was added + - DSD + +2008年05月28日 Fix crashing of PDFs in xpdf and ghostscript when two-byte + characters are used with Type 3 fonts - MGD + +2008年05月28日 Allow keyword args to configure widget properties as + requested in + http://sourceforge.net/tracker/index.php?func=detail&aid=1866207&group_id=80706&atid=560722 + - JDH + +2008年05月28日 Replaced '-' with u'\u2212' for minus sign as requested in + http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720 + +2008年05月28日 zero width/height Rectangles no longer influence the + autoscaler. Useful for log histograms with empty bins - + JDH + +2008年05月28日 Fix rendering of composite glyphs in Type 3 conversion + (particularly as evidenced in the Eunjin.ttf Korean font) + Thanks Jae-Joon Lee for finding this! + +2008年05月27日 Rewrote the cm.ScalarMappable callback infrastructure to + use cbook.CallbackRegistry rather than custom callback + handling. Amy users of add_observer/notify of the + cm.ScalarMappable should uae the + cm.ScalarMappable.callbacksSM CallbackRegistry instead. JDH + +2008年05月27日 Fix TkAgg build on Ubuntu 8.04 (and hopefully a more + general solution for other platforms, too.) + +2008年05月24日 Added PIL support for loading images to imread (if PIL is + available) - JDH + +2008年05月23日 Provided a function and a method for controlling the + plot color cycle. - EF + +2008年05月23日 Major revision of hist(). Can handle 2D arrays and create + stacked histogram plots; keyword 'width' deprecated and + rwidth (relative width) introduced; align='edge' changed + to center of bin - MM + +2008年05月22日 Added support for ReST-based doumentation using Sphinx. + Documents are located in doc/, and are broken up into + a users guide and an API reference. To build, run the + make.py files. Sphinx-0.4 is needed to build generate xml, + which will be useful for rendering equations with mathml, + use sphinx from svn until 0.4 is released - DSD + +2008年05月21日 Fix segfault in TkAgg backend - MGD + +2008年05月21日 Fix a "local variable unreferenced" bug in plotfile - MM + +2008年05月19日 Fix crash when Windows can not access the registry to + determine font path [Bug 1966974, thanks Patrik Simons] - MGD + +2008年05月16日 removed some unneeded code w/ the python 2.4 requirement. + cbook no longer provides compatibility for reversed, + enumerate, set or izip. removed lib/subprocess, mpl1, + sandbox/units, and the swig code. This stuff should remain + on the maintenance branch for archival purposes. JDH + +2008年05月16日 Reorganized examples dir - JDH + +2008年05月16日 Added 'elinewidth' keyword arg to errorbar, based on patch + by Christopher Brown - MM + +2008年05月16日 Added 'cumulative' keyword arg to hist to plot cumulative + histograms. For normed hists, this is normalized to one - MM + +2008年05月15日 Fix Tk backend segfault on some machines - MGD + +2008年05月14日 Don't use stat on Windows (fixes font embedding problem) - MGD + +2008年05月09日 Fix /singlequote (') in Postscript backend - MGD + +2008年05月08日 Fix kerning in SVG when embedding character outlines - MGD + +2008年05月07日 Switched to future numpy histogram semantic in hist - MM + +2008年05月06日 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD + +2008年05月05日 pass notify_axes_change to the figure's add_axobserver + in the qt backends, like we do for the other backends. + Thanks Glenn Jones for the report - DSD + +2008年05月02日 Added step histograms, based on patch by Erik Tollerud. - MM + +2008年05月02日 On PyQt <= 3.14 there is no way to determine the underlying + Qt version. [1851364] - MGD + +2008年05月02日 Don't call sys.exit() when pyemf is not found [1924199] - + MGD + +2008年05月02日 Update _subprocess.c from upstream Python 2.5.2 to get a + few memory and reference-counting-related bugfixes. See + bug 1949978. - MGD + +2008年04月30日 Added some record array editing widgets for gtk -- see + examples/rec_edit*.py - JDH + +2008年04月29日 Fix bug in mlab.sqrtm - MM + +2008年04月28日 Fix bug in SVG text with Mozilla-based viewers (the symbol + tag is not supported) - MGD + +2008年04月27日 Applied patch by Michiel de Hoon to add hexbin + axes method and pyplot function - EF + +2008年04月25日 Enforce python >= 2.4; remove subprocess build - EF + +2008年04月25日 Enforce the numpy requirement at build time - JDH + +2008年04月24日 Make numpy 1.1 and python 2.3 required when importing + matplotlib - EF + +2008年04月24日 Fix compilation issues on VS2003 (Thanks Martin Spacek for + all the help) - MGD + +2008年04月24日 Fix sub/superscripts when the size of the font has been + changed - MGD + +2008年04月22日 Use "svg.embed_char_paths" consistently everywhere - MGD + +2008年04月20日 Add support to MaxNLocator for symmetric axis autoscaling. - EF + +2008年04月20日 Fix double-zoom bug. - MM + +2008年04月15日 Speed up color mapping. - EF + +2008年04月12日 Speed up zooming and panning of dense images. - EF + +2008年04月11日 Fix global font rcParam setting after initialization + time. - MGD + +2008年04月11日 Revert commits 5002 and 5031, which were intended to + avoid an unnecessary call to draw(). 5002 broke saving + figures before show(). 5031 fixed the problem created in + 5002, but broke interactive plotting. Unnecessary call to + draw still needs resolution - DSD + +2008年04月07日 Improve color validation in rc handling, suggested + by Lev Givon - EF + +2008年04月02日 Allow to use both linestyle definition arguments, '-' and + 'solid' etc. in plots/collections - MM + +2008年03月27日 Fix saving to Unicode filenames with Agg backend + (other backends appear to already work...) + (Thanks, Christopher Barker) - MGD + +2008年03月26日 Fix SVG backend bug that prevents copying and pasting in + Inkscape (thanks Kaushik Ghose) - MGD + +2008年03月24日 Removed an unnecessary call to draw() in the backend_qt* + mouseReleaseEvent. Thanks to Ted Drain - DSD + +2008年03月23日 Fix a pdf backend bug which sometimes caused the outermost + gsave to not be balanced with a grestore. - JKS + +2008年03月20日 Fixed a minor bug in ContourSet._process_linestyles when + len(linestyles)==Nlev - MM + +2008年03月19日 Changed ma import statements to "from numpy import ma"; + this should work with past and future versions of + numpy, whereas "import numpy.ma as ma" will work only + with numpy >= 1.05, and "import numerix.npyma as ma" + is obsolete now that maskedarray is replacing the + earlier implementation, as of numpy 1.05. + +2008年03月14日 Removed an apparently unnecessary call to + FigureCanvasAgg.draw in backend_qt*agg. Thanks to Ted + Drain - DSD + +2008年03月10日 Workaround a bug in backend_qt4agg's blitting due to a + buffer width/bbox width mismatch in _backend_agg's + copy_from_bbox - DSD + +2008年02月29日 Fix class Wx toolbar pan and zoom functions (Thanks Jeff + Peery) - MGD + +2008年02月16日 Added some new rec array functionality to mlab + (rec_summarize, rec2txt and rec_groupby). See + examples/rec_groupby_demo.py. Thanks to Tim M for rec2txt. + +2008年02月12日 Applied Erik Tollerud's span selector patch - JDH + +2008年02月11日 Update plotting() doc string to refer to getp/setp. - JKS + +2008年02月10日 Fixed a problem with square roots in the pdf backend with + usetex. - JKS + +2008年02月08日 Fixed minor __str__ bugs so getp(gca()) works. - JKS + +2008年02月05日 Added getters for title, xlabel, ylabel, as requested + by Brandon Kieth - EF + +2008年02月05日 Applied Gael's ginput patch and created + examples/ginput_demo.py - JDH + +2008年02月03日 Expose interpnames, a list of valid interpolation + methods, as an AxesImage class attribute. - EF + +2008年02月03日 Added BoundaryNorm, with examples in colorbar_only.py + and image_masked.py. - EF + +2008年02月03日 Force dpi=72 in pdf backend to fix picture size bug. - JKS + +2008年02月01日 Fix doubly-included font problem in Postscript backend - MGD + +2008年02月01日 Fix reference leak in ft2font Glyph objects. - MGD + +2008年01月31日 Don't use unicode strings with usetex by default - DSD + +2008年01月31日 Fix text spacing problems in PDF backend with *some* fonts, + such as STIXGeneral. + +2008年01月31日 Fix \sqrt with radical number (broken by making [ and ] + work below) - MGD + +2008年01月27日 Applied Martin Teichmann's patch to improve the Qt4 + backend. Uses Qt's builtin toolbars and statusbars. + See bug 1828848 - DSD + +2008年01月10日 Moved toolkits to mpl_toolkits, made mpl_toolkits + a namespace package - JSWHIT + +2008年01月10日 Use setup.cfg to set the default parameters (tkagg, + numpy) when building windows installers - DSD + +2008年01月10日 Fix bug displaying [ and ] in mathtext - MGD + +2008年01月10日 Fix bug when displaying a tick value offset with scientific + notation. (Manifests itself as a warning that the \times + symbol can not be found). - MGD + +2008年01月10日 Use setup.cfg to set the default parameters (tkagg, + numpy) when building windows installers - DSD + +=============================================================== 2008年01月06日 Released 0.91.2 at revision 4802 2007年12月26日 Reduce too-late use of matplotlib.use() to a warning @@ -136,6 +387,75 @@ 2007年10月31日 Made log color scale easier to use with contourf; automatic level generation now works. - EF +2007年10月29日 TRANSFORMS REFACTORING + + The primary goal of this refactoring was to make it easier + to extend matplotlib to support new kinds of projections. + This is primarily an internal improvement, and the possible + user-visible changes it allows are yet to come. + + The transformation framework was completely rewritten in + Python (with Numpy). This will make it easier to add news + kinds of transformations without writing C/C++ code. + + Transforms are composed into a 'transform tree', made of + transforms whose value depends on other transforms (their + children). When the contents of children change, their + parents are automatically updated to reflect those changes. + To do this an "invalidation" method is used: when children + change, all of their ancestors are marked as "invalid". + When the value of a transform is accessed at a later time, + its value is recomputed only if it is invalid, otherwise a + cached value may be used. This prevents unnecessary + recomputations of transforms, and contributes to better + interactive performance. + + The framework can be used for both affine and non-affine + transformations. However, for speed, we want use the + backend renderers to perform affine transformations + whenever possible. Therefore, it is possible to perform + just the affine or non-affine part of a transformation on a + set of data. The affine is always assumed to occur after + the non-affine. For any transform: + + full transform == non-affine + affine + + Much of the drawing has been refactored in terms of + compound paths. Therefore, many methods have been removed + from the backend interface and replaced with a a handful to + draw compound paths. This will make updating the backends + easier, since there is less to update. It also should make + the backends more consistent in terms of functionality. + + User visible changes: + + - POLAR PLOTS: Polar plots are now interactively zoomable, + and the r-axis labels can be interactively rotated. + Straight line segments are now interpolated to follow the + curve of the r-axis. + + - Non-rectangular clipping works in more backends and with + more types of objects. + + - Sharing an axis across figures is now done in exactly + the same way as sharing an axis between two axes in the + same figure: + + fig1 = figure() + fig2 = figure() + + ax1 = fig1.add_subplot(111) + ax2 = fig2.add_subplot(111, sharex=ax1, sharey=ax1) + + - linestyles now include steps-pre, steps-post and + steps-mid. The old step still works and is equivalent to + step-pre. + + - Multiple line styles may be provided to a collection. + + See API_CHANGES for more low-level information about this + refactoring. + 2007年10月24日 Added ax kwarg to Figure.colorbar and pyplot.colorbar - EF 2007年10月19日 Removed a gsave/grestore pair surrounding _draw_ps, which @@ -3251,3 +3571,4 @@ 2003年11月21日 - make a dash-dot dict for the GC 2003年12月15日 - fix install path bug +t Modified: trunk/htdocs/convert.py =================================================================== --- trunk/htdocs/convert.py 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/convert.py 2008年05月30日 17:34:24 UTC (rev 5327) @@ -187,17 +187,15 @@ # re-add news to the params dict 'tables' entry below for news -news1= NewsBox("""We have recetly merged significant changes in the internal matplotlib transformation infrastructure into the main matplotlib codebase. While this will not affect typical pylab users, some users of the API and transformation code will to make some code changes to work with the new transformations. Please see <a href=MIGRATION.txt>migration</a> and <a href=API_CHANGES>API_CHANGES</a> for a summary of the migration path and changes in the API, and let us know on the <a href=http://sourceforge.net/mail/?group_id=80706>mailing lists</a> if you are experiecing problems""", title='Major changes in matplotlib svn') +news1= NewsBox("""matplotlib <a +href=http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194&release_id=603020>0.98.0</a> is a major release which requires python2.4 and numpy 1.1. It contains a number of internal improvements and may require some power users to update their code; see <a href=MIGRATION.txt>migration</a> and <a href=API_CHANGES>API_CHANGES</a>. We are supporting a maintenance branch of the older code available at matplotlib <a +href=http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=603021>0.91.3</a>""", title='New release') news2 = NewsBox("""Help support matplotlib development by <a href=http://sourceforge.net/project/project_donations.php?group_id=80706>donating</a> to fund developer sprints and other matplotlib development costs.""", title='Donate') -news3 = NewsBox("""matplotlib <a -href=http://sourceforge.net/project/platformdownload.php?group_id=80706>0.91.2</a> -is out. See <a href=whats_new.html>what's new</a> for a summary of new features. """, title='New release') - table1 = LinkBox(header='Matplotlib', links=( ('Home', 'http://matplotlib.sourceforge.net'), ("What's New", 'whats_new.html'), @@ -211,8 +209,10 @@ table2 = LinkBox(header='Documentation', links=( ('Tutorial', 'tutorial.html'), - ("User's Guide (pdf)", 'users_guide_%s.pdf'%matplotlib.__version__), - ("API (pdf)", 'api.pdf'), + ("User's Guide ", 'users_guide_%s.pdf'%matplotlib.__version__), + ('API tutorial', 'pycon/event_handling_tut.pdf'), + ('Event handling', 'pycon/artist_api_tut.pdf'), + ("API ", 'api.pdf'), ('FAQ', 'faq.html'), ('Cookbook / wiki', 'http://www.scipy.org/wikis/topical_software/MatplotlibCookbook'), ('pylab interface', 'pylab_commands.html'), @@ -232,7 +232,7 @@ params = { 'myemail' : '<a href=mailto:jdh...@ac...> (jdh...@ac...)</a>', - 'tables' : (news1, news2, news3, table1, table2, table3), + 'tables' : (news1, news2, table1, table2, table3), 'default_table' : 'border=1 cellpadding=3 cellspacing=2', } Modified: trunk/htdocs/credits.html.template =================================================================== --- trunk/htdocs/credits.html.template 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/credits.html.template 2008年05月30日 17:34:24 UTC (rev 5327) @@ -140,7 +140,7 @@ support, implementing Knuth's box layout algorithms, saving to file-like objects across backends, and is responsible for numerous bug-fixes, much better font and unicode support, and feature and - performance enhancements across the matplotlib code base. </li> + performance enhancements across the matplotlib code base. He also rewrote the transformation infrastructure to support custom projections and scales/li> Modified: trunk/htdocs/license.html.template =================================================================== --- trunk/htdocs/license.html.template 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/license.html.template 2008年05月30日 17:34:24 UTC (rev 5327) @@ -6,7 +6,7 @@ <pre> -LICENSE AGREEMENT FOR MATPLOTLIB 0.91.2svn +LICENSE AGREEMENT FOR MATPLOTLIB 0.98.0 -------------------------------------- 1. This LICENSE AGREEMENT is between the John D. Hunter ("JDH"), and the @@ -17,30 +17,30 @@ 2. Subject to the terms and conditions of this License Agreement, JDH hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare -derivative works, distribute, and otherwise use matplotlib 0.91.2svn +derivative works, distribute, and otherwise use matplotlib 0.98.0 alone or in any derivative version, provided, however, that JDH's License Agreement and JDH's notice of copyright, i.e., "Copyright (c) 2002-2004 John D. Hunter; All Rights Reserved" are retained in -matplotlib 0.91.2svn alone or in any derivative version prepared by +matplotlib 0.98.0 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or -incorporates matplotlib 0.91.2svn or any part thereof, and wants to +incorporates matplotlib 0.98.0 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of -the changes made to matplotlib 0.91.2svn. +the changes made to matplotlib 0.98.0. -4. JDH is making matplotlib 0.91.2svn available to Licensee on an "AS +4. JDH is making matplotlib 0.98.0 available to Licensee on an "AS IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.91.2svn +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.98.0 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB -0.91.2svn FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR +0.98.0 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING -MATPLOTLIB 0.91.2svn, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF +MATPLOTLIB 0.98.0, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material @@ -52,7 +52,7 @@ trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. -8. By copying, installing or otherwise using matplotlib 0.91.2svn, +8. By copying, installing or otherwise using matplotlib 0.98.0, Licensee agrees to be bound by the terms and conditions of this License Agreement. Modified: trunk/htdocs/make.py =================================================================== --- trunk/htdocs/make.py 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/make.py 2008年05月30日 17:34:24 UTC (rev 5327) @@ -1,39 +1,17 @@ import os, sys, glob, shutil import matplotlib -MPL_SRC = os.environ.get('MPL_SRC', '/home/darren/src/matplotlib/matplotlib') +MPL_SRC = os.environ.get('MPL_SRC', '/home/jdhunter/mpl') MPL_SRC = '/home/jdhunter/mpl' -#copy all the examples to the htdocs examples dir -for fname in glob.glob('examples/*.py*'): - os.remove(fname) - -for pathname in glob.glob(os.path.join(MPL_SRC, 'examples', '*.py')): - path, fname = os.path.split(pathname) - if fname.startswith('_tmp'): continue - newname = os.path.join('examples', fname) - print 'copying %s to %s' % (pathname, newname) - shutil.copy(pathname, newname) -widgetfiles = glob.glob(os.path.join(MPL_SRC, 'examples', 'widgets', '*.py')) -widgetfiles.append(os.path.join(MPL_SRC, 'examples', 'widgets', 'README')) -for pathname in widgetfiles: - path, fname = os.path.split(pathname) - if fname.startswith('_tmp'): continue - newname = os.path.join('examples', 'widgets', fname) - print 'copying %s to %s' % (pathname, newname) - shutil.copy(pathname, newname) - -widgetfiles = glob.glob(os.path.join(MPL_SRC, 'examples', 'units', '*.py')) -for pathname in widgetfiles: - path, fname = os.path.split(pathname) - if fname.startswith('_tmp'): continue - newname = os.path.join('examples', 'units', fname) - print 'copying %s to %s' % (pathname, newname) - shutil.copy(pathname, newname) - +os.system('rm -rf examples') +os.system('tar -cv -C ~/mpl examples --exclude .svn --exclude Agg --exclude PDF --exclude PS --exclude Template|tar x') os.system('zip -r -o matplotlib_examples_%s.zip examples'%matplotlib.__version__) +os.system('rm -rf doc') +os.system('tar -cv -C ~/mpl doc/devel doc/users --exclude .svn --exclude png |tar x') + os.system('cp ../users_guide/users_guide.pdf users_guide_%s.pdf'%matplotlib.__version__) filenames = ( 'INSTALL', 'CHANGELOG', 'API_CHANGES', 'MIGRATION.txt') @@ -53,16 +31,16 @@ #os.system('cd screenshots; python makeshots.py; rm -f _tmp*.py') print 'Making tutorial images' -#os.system('cd tut; python runall.py') +os.system('cd tut; python runall.py') -#print 'Running process_docs' -os.system('python process_docs.py') +print 'Running process_docs' +#os.system('python process_docs.py') print 'Running convert' os.system('python convert.py') print 'Building archive' version = matplotlib.__version__ -tarcommand = 'tar cfz site.tar.gz *.html api.pdf users_guide_%(version)s.pdf matplotlib_examples_%(version)s.zip screenshots tut examples matplotlibrc CHANGELOG API_CHANGES MIGRATION.txt set_begone.py -X exclude.txt'%locals() +tarcommand = 'tar cfz site.tar.gz *.html api.pdf users_guide_%(version)s.pdf matplotlib_examples_%(version)s.zip screenshots tut doc examples matplotlibrc CHANGELOG API_CHANGES MIGRATION.txt set_begone.py -X exclude.txt'%locals() print tarcommand os.system(tarcommand) Modified: trunk/htdocs/matplotlib.afm.html.template =================================================================== --- trunk/htdocs/matplotlib.afm.html.template 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/matplotlib.afm.html.template 2008年05月30日 17:34:24 UTC (rev 5327) @@ -4,7 +4,7 @@ <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="matplotlib.html"><font color="#ffffff">matplotlib</font></a>.afm</strong></big></big></font></td ><td align=right valign=bottom -><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/afm.py">/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/afm.py</a></font></td></tr></table> +><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/afm.py">/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/afm.py</a></font></td></tr></table> <p><tt>This is a python interface to Adobe Font Metrics Files. Although a<br> number of other python implementations exist (and may be more complete<br> than mine) I decided not to go with them because either they were<br> Modified: trunk/htdocs/matplotlib.artist.html.template =================================================================== --- trunk/htdocs/matplotlib.artist.html.template 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/matplotlib.artist.html.template 2008年05月30日 17:34:24 UTC (rev 5327) @@ -4,7 +4,7 @@ <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="matplotlib.html"><font color="#ffffff">matplotlib</font></a>.artist</strong></big></big></font></td ><td align=right valign=bottom -><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/artist.py">/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/artist.py</a></font></td></tr></table> +><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/artist.py">/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/artist.py</a></font></td></tr></table> <p></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -14,9 +14,8 @@ <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="re.html">re</a><br> -</td><td width="25%" valign=top><a href="sys.html">sys</a><br> -</td><td width="25%" valign=top><a href="matplotlib.units.html">matplotlib.units</a><br> -</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> +</td><td width="25%" valign=top><a href="warnings.html">warnings</a><br> +</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> <td colspan=3 valign=bottom> <br> @@ -24,14 +23,19 @@ <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> +<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> +</font></dt><dd> +<dl> <dt><font face="helvetica, arial"><a href="matplotlib.artist.html#Artist">Artist</a> -</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.artist.html#ArtistInspector">ArtistInspector</a> </font></dt></dl> +</dd> +<dt><font face="helvetica, arial"><a href="matplotlib.artist.html#ArtistInspector">ArtistInspector</a> +</font></dt></dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> -<font color="#000000" face="helvetica, arial"><a name="Artist">class <strong>Artist</strong></a></font></td></tr> +<font color="#000000" face="helvetica, arial"><a name="Artist">class <strong>Artist</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Abstract base class for someone who renders into a FigureCanvas<br> </tt></td></tr> @@ -78,6 +82,9 @@ <dl><dt><a name="Artist-get_transform"><strong>get_transform</strong></a>(self)</dt><dd><tt>return the Transformation instance used by this artist</tt></dd></dl> +<dl><dt><a name="Artist-get_transformed_clip_path_and_affine"><strong>get_transformed_clip_path_and_affine</strong></a>(self)</dt><dd><tt>Return the clip path with the non-affine part of its transformation applied,<br> +and the remaining affine part of its transformation.</tt></dd></dl> + <dl><dt><a name="Artist-get_visible"><strong>get_visible</strong></a>(self)</dt><dd><tt>return the artist's visiblity</tt></dd></dl> <dl><dt><a name="Artist-get_zorder"><strong>get_zorder</strong></a>(self)</dt></dl> @@ -133,9 +140,22 @@ <br> ACCEPTS: [True | False]</tt></dd></dl> -<dl><dt><a name="Artist-set_clip_path"><strong>set_clip_path</strong></a>(self, path)</dt><dd><tt>Set the artist's clip path<br> +<dl><dt><a name="Artist-set_clip_path"><strong>set_clip_path</strong></a>(self, path, transform<font color="#909090">=None</font>)</dt><dd><tt>Set the artist's clip path, which may be:<br> <br> -ACCEPTS: an agg.path_storage instance</tt></dd></dl> + a) a Patch (or subclass) instance<br> + <br> + b) a Path instance, in which cas aoptional transform may<br> + be provided, which will be applied to the path before using it<br> + for clipping.<br> + <br> + c) None, to remove the clipping path<br> + <br> +For efficiency, if the path happens to be an axis-aligned<br> +rectangle, this method will set the clipping box to the<br> +corresponding rectangle and set the clipping path to None.<br> + <br> +ACCEPTS: a Path instance and a Transform instance, a Patch<br> +instance, or None</tt></dd></dl> <dl><dt><a name="Artist-set_contains"><strong>set_contains</strong></a>(self, picker)</dt><dd><tt>Replace the contains test used by this artist. The new picker should<br> be a callable function which determines whether the artist is hit by the<br> @@ -207,6 +227,14 @@ <dl><dt><a name="Artist-update_from"><strong>update_from</strong></a>(self, other)</dt><dd><tt>copy properties from other to self</tt></dd></dl> <hr> +Data descriptors defined here:<br> +<dl><dt><strong>__dict__</strong></dt> +<dd><tt>dictionary for instance variables (if defined)</tt></dd> +</dl> +<dl><dt><strong>__weakref__</strong></dt> +<dd><tt>list of weak references to the object (if defined)</tt></dd> +</dl> +<hr> Data and other attributes defined here:<br> <dl><dt><strong>aname</strong> = 'Artist'</dl> @@ -236,11 +264,13 @@ property, which does not, return 'transform'</tt></dd></dl> <dl><dt><a name="ArtistInspector-get_aliases"><strong>get_aliases</strong></a>(self)</dt><dd><tt>get a dict mapping fullname -> alias for each alias in o.<br> -Eg for lines: {'markerfacecolor': 'mfc',<br> - 'linewidth' : 'lw',<br> - }</tt></dd></dl> +Eg for lines::<br> + <br> + {'markerfacecolor': 'mfc',<br> + 'linewidth' : 'lw',<br> + }</tt></dd></dl> -<dl><dt><a name="ArtistInspector-get_setters"><strong>get_setters</strong></a>(self)</dt><dd><tt>Get the attribute strings with setters for object h. Eg, for a line,<br> +<dl><dt><a name="ArtistInspector-get_setters"><strong>get_setters</strong></a>(self)</dt><dd><tt>Get the attribute strings with setters for <a href="__builtin__.html#object">object</a> h. Eg, for a line,<br> return ['markerfacecolor', 'linewidth', ....]</tt></dd></dl> <dl><dt><a name="ArtistInspector-get_valid_values"><strong>get_valid_values</strong></a>(self, attr)</dt><dd><tt>get the legal arguments for the setter associated with attr<br> @@ -251,7 +281,7 @@ Eg, for a line linestyle, return<br> [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]</tt></dd></dl> -<dl><dt><a name="ArtistInspector-is_alias"><strong>is_alias</strong></a>(self, o)</dt><dd><tt>return true if method object o is an alias for another function</tt></dd></dl> +<dl><dt><a name="ArtistInspector-is_alias"><strong>is_alias</strong></a>(self, o)</dt><dd><tt>return true if method <a href="__builtin__.html#object">object</a> o is an alias for another function</tt></dd></dl> <dl><dt><a name="ArtistInspector-pprint_getters"><strong>pprint_getters</strong></a>(self)</dt><dd><tt>return the getters and actual values as list of strings'</tt></dd></dl> @@ -305,8 +335,8 @@ linewidth or lw = 2</tt></dd></dl> <dl><dt><a name="-kwdoc"><strong>kwdoc</strong></a>(a)</dt></dl> <dl><dt><a name="-setp"><strong>setp</strong></a>(h, *args, **kwargs)</dt><dd><tt>matplotlib supports the use of setp ("set property") and getp to set<br> -and get object properties, as well as to do introspection on the<br> -object For example, to set the linestyle of a line to be dashed, you<br> +and get <a href="__builtin__.html#object">object</a> properties, as well as to do introspection on the<br> +<a href="__builtin__.html#object">object</a> For example, to set the linestyle of a line to be dashed, you<br> can do<br> <br> >>> line, = plot([1,2,3])<br> Modified: trunk/htdocs/matplotlib.axes.html.template =================================================================== --- trunk/htdocs/matplotlib.axes.html.template 2008年05月30日 17:30:59 UTC (rev 5326) +++ trunk/htdocs/matplotlib.axes.html.template 2008年05月30日 17:34:24 UTC (rev 5327) @@ -4,7 +4,7 @@ <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="matplotlib.html"><font color="#ffffff">matplotlib</font></a>.axes</strong></big></big></font></td ><td align=right valign=bottom -><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/axes.py">/home/jdhunter/dev/lib/python2.5/site-packages/matplotlib/axes.py</a></font></td></tr></table> +><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/axes.py">/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/axes.py</a></font></td></tr></table> <p></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -13,31 +13,30 @@ <font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> -<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="matplotlib.agg.html">matplotlib.agg</a><br> -<a href="matplotlib.cbook.html">matplotlib.cbook</a><br> -<a href="matplotlib.cm.html">matplotlib.cm</a><br> +<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="matplotlib.cbook.html">matplotlib.cbook</a><br> <a href="matplotlib.font_manager.html">matplotlib.font_manager</a><br> -<a href="matplotlib.numerix.npyma.html">matplotlib.numerix.npyma</a><br> +<a href="numpy.ma.html">numpy.ma</a><br> <a href="matplotlib.artist.html">matplotlib.artist</a><br> <a href="math.html">math</a><br> -</td><td width="25%" valign=top><a href="matplotlib.html">matplotlib</a><br> +<a href="matplotlib.html">matplotlib</a><br> <a href="matplotlib.axis.html">matplotlib.axis</a><br> -<a href="matplotlib.collections.html">matplotlib.collections</a><br> +</td><td width="25%" valign=top><a href="matplotlib.collections.html">matplotlib.collections</a><br> <a href="matplotlib.colors.html">matplotlib.colors</a><br> <a href="matplotlib.contour.html">matplotlib.contour</a><br> <a href="matplotlib.dates.html">matplotlib.dates</a><br> <a href="matplotlib.image.html">matplotlib.image</a><br> -</td><td width="25%" valign=top><a href="matplotlib.mlab.html">matplotlib.mlab</a><br> +<a href="matplotlib.mlab.html">matplotlib.mlab</a><br> <a href="matplotlib.legend.html">matplotlib.legend</a><br> -<a href="matplotlib.lines.html">matplotlib.lines</a><br> +</td><td width="25%" valign=top><a href="matplotlib.lines.html">matplotlib.lines</a><br> <a href="matplotlib.patches.html">matplotlib.patches</a><br> <a href="matplotlib.quiver.html">matplotlib.quiver</a><br> +<a href="matplotlib.scale.html">matplotlib.scale</a><br> <a href="matplotlib.table.html">matplotlib.table</a><br> <a href="matplotlib.text.html">matplotlib.text</a><br> -</td><td width="25%" valign=top><a href="matplotlib.ticker.html">matplotlib.ticker</a><br> -<a href="matplotlib.transforms.html">matplotlib.transforms</a><br> +<a href="matplotlib.ticker.html">matplotlib.ticker</a><br> +</td><td width="25%" valign=top><a href="matplotlib.transforms.html">matplotlib.transforms</a><br> +<a href="new.html">new</a><br> <a href="numpy.html">numpy</a><br> -<a href="sys.html">sys</a><br> <a href="warnings.html">warnings</a><br> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -47,22 +46,16 @@ <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> -<dt><font face="helvetica, arial"><a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a> +<dt><font face="helvetica, arial"><a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a>(<a href="__builtin__.html#object">__builtin__.object</a>) </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="matplotlib.axes.html#Axes">Axes</a> -</font></dt><dd> -<dl> -<dt><font face="helvetica, arial"><a href="matplotlib.axes.html#PolarAxes">PolarAxes</a> </font></dt></dl> </dd> -</dl> -</dd> <dt><font face="helvetica, arial"><a href="matplotlib.axes.html#SubplotBase">SubplotBase</a> </font></dt><dd> <dl> -<dt><font face="helvetica, arial"><a href="matplotlib.axes.html#PolarSubplot">PolarSubplot</a>(<a href="matplotlib.axes.html#SubplotBase">SubplotBase</a>, <a href="matplotlib.axes.html#PolarAxes">PolarAxes</a>) -</font></dt><dt><font face="helvetica, arial"><a href="matplotlib.axes.html#Subplot">Subplot</a>(<a href="matplotlib.axes.html#SubplotBase">SubplotBase</a>, <a href="matplotlib.axes.html#Axes">Axes</a>) +<dt><font face="helvetica, arial">AxesSubplot(<a href="matplotlib.axes.html#SubplotBase">SubplotBase</a>, <a href="matplotlib.axes.html#Axes">Axes</a>) </font></dt></dl> </dd> </dl> @@ -81,48 +74,27 @@ connect to are 'xlim_changed' and 'ylim_changed' and the callback<br> will be called with func(ax) where ax is the <a href="#Axes">Axes</a> instance<br> </tt></td></tr> <tr><td> </td> -<td width="100%">Methods defined here:<br> -<dl><dt><a name="Axes-__init__"><strong>__init__</strong></a>(self, fig, rect, axisbg<font color="#909090">=None</font>, frameon<font color="#909090">=True</font>, sharex<font color="#909090">=None</font>, sharey<font color="#909090">=None</font>, label<font color="#909090">=''</font>, **kwargs)</dt><dd><tt>Build an <a href="#Axes">Axes</a> instance in Figure with<br> -rect=[left, bottom, width,height in Figure coords<br> - <br> -adjustable: ['box' | 'datalim']<br> -alpha: the alpha transparency<br> -anchor: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W']<br> -aspect: ['auto' | 'equal' | aspect_ratio]<br> -autoscale_on: boolean - whether or not to autoscale the viewlim<br> -axis_bgcolor: any matplotlib color - see help(colors)<br> -axisbelow: draw the grids and ticks below the other artists<br> -cursor_props: a (float, color) tuple<br> -figure: a Figure instance<br> -frame_on: a boolean - draw the axes frame<br> -label: the axes label<br> -navigate: True|False<br> -navigate_mode: the navigation toolbar button status: 'PAN', 'ZOOM', or None<br> -position: [left, bottom, width,height in Figure coords<br> -sharex : an <a href="#Axes">Axes</a> instance to share the x-axis with<br> -sharey : an <a href="#Axes">Axes</a> instance to share the y-axis with<br> -title: the title string<br> -visible: a boolean - whether the axes is visible<br> -xlabel: the xlabel<br> -xlim: (xmin, xmax) view limits<br> -xscale: ['log' | 'linear' ]<br> -xticklabels: sequence of strings<br> -xticks: sequence of floats<br> -ylabel: the ylabel strings<br> -ylim: (ymin, ymax) view limits<br> -yscale: ['log' | 'linear']<br> -yticklabels: sequence of strings<br> -yticks: sequence of floats</tt></dd></dl> +<td width="100%"><dl><dt>Method resolution order:</dt> +<dd><a href="matplotlib.axes.html#Axes">Axes</a></dd> +<dd><a href="matplotlib.artist.html#Artist">matplotlib.artist.Artist</a></dd> +<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> +</dl> +<hr> +Methods defined here:<br> +<dl><dt><a name="Axes-__init__"><strong>__init__</strong></a>(self, fig, rect, axisbg<font color="#909090">=None</font>, frameon<font color="#909090">=True</font>, sharex<font color="#909090">=None</font>, sharey<font color="#909090">=None</font>, label<font color="#909090">=''</font>, **kwargs)</dt></dl> <dl><dt><a name="Axes-__str__"><strong>__str__</strong></a>(self)</dt></dl> -<dl><dt><a name="Axes-acorr"><strong>acorr</strong></a>(self, x, **kwargs)</dt><dd><tt>ACORR(x, normed=False, detrend=mlab.detrend_none, usevlines=False,<br> - maxlags=None, **kwargs)<br> +<dl><dt><a name="Axes-acorr"><strong>acorr</strong></a>(self, x, **kwargs)</dt><dd><tt>call signature::<br> + <br> + <a href="#Axes-acorr">acorr</a>(x, normed=False, detrend=mlab.detrend_none, usevlines=False,<br> + maxlags=None, **kwargs)<br> + <br> Plot the autocorrelation of x. If normed=True, normalize the<br> data but the autocorrelation at 0-th lag. x is detrended by<br> the detrend callable (default no normalization.<br> <br> -data are plotted as <a href="#Axes-plot">plot</a>(lags, c, **kwargs)<br> +data are plotted as ``<a href="#Axes-plot">plot</a>(lags, c, **kwargs)``<br> <br> return value is lags, c, line where lags are a length<br> 2*maxlags+1 lag vector, c is the 2*maxlags+1 auto correlation<br> @@ -148,7 +120,7 @@ <dl><dt><a name="Axes-add_artist"><strong>add_artist</strong></a>(self, a)</dt><dd><tt>Add any artist to the axes</tt></dd></dl> -<dl><dt><a name="Axes-add_collection"><strong>add_collection</strong></a>(self, collection, autolim<font color="#909090">=False</font>)</dt><dd><tt>add a Collection instance to <a href="#Axes">Axes</a></tt></dd></dl> +<dl><dt><a name="Axes-add_collection"><strong>add_collection</strong></a>(self, collection, autolim<font color="#909090">=True</font>)</dt><dd><tt>add a Collection instance to <a href="#Axes">Axes</a></tt></dd></dl> <dl><dt><a name="Axes-add_line"><strong>add_line</strong></a>(self, line)</dt><dd><tt>Add a line to the list of plot lines</tt></dd></dl> @@ -158,13 +130,15 @@ <dl><dt><a name="Axes-add_table"><strong>add_table</strong></a>(self, tab)</dt><dd><tt>Add a table instance to the list of axes tables</tt></dd></dl> -<dl><dt><a name="Axes-annotate"><strong>annotate</strong></a>(self, *args, **kwargs)</dt><dd><tt><a href="#Axes-annotate">annotate</a>(s, xy,<br> - xytext=None,<br> - xycoords='data',<br> - textcoords='data',<br> - arrowprops=None,<br> - **props)<br> +<dl><dt><a name="Axes-annotate"><strong>annotate</strong></a>(self, *args, **kwargs)</dt><dd><tt>call signature::<br> <br> + <a href="#Axes-annotate">annotate</a>(s, xy,<br> + xytext=None,<br> + xycoords='data',<br> + textcoords='data',<br> + arrowprops=None,<br> + **props)<br> + <br> Annotate the x,y point xy with text s at x,y location xytext<br> (xytext if None defaults to xy and textcoords if None defaults<br> to xycoords).<br> @@ -173,36 +147,47 @@ (see matplotlib.lines.Line2D) for the arrow that connects<br> annotation to the point. Valid keys are<br> <br> - - width : the width of the arrow in points<br> - - frac : the fraction of the arrow lengt... [truncated message content]
Revision: 5326 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5326&view=rev Author: jdh2358 Date: 2008年05月30日 10:30:59 -0700 (2008年5月30日) Log Message: ----------- added ellipse demo Added Paths: ----------- trunk/htdocs/screenshots/ellipse_large.py Added: trunk/htdocs/screenshots/ellipse_large.py =================================================================== --- trunk/htdocs/screenshots/ellipse_large.py (rev 0) +++ trunk/htdocs/screenshots/ellipse_large.py 2008年05月30日 17:30:59 UTC (rev 5326) @@ -0,0 +1,149 @@ + +# This example can be boiled down to a more simplistic example +# to show the problem, but bu including the upper and lower +# bound ellipses, it demonstrates how significant this error +# is to our plots. + +import math +from pylab import * +from matplotlib.patches import Ellipse, Arc + +# given a point x, y +x = 2692.440 +y = 6720.850 + +# get is the radius of a circle through this point +r = math.sqrt( x*x+y*y ) + +# show some comparative circles +delta = 6 + + +################################################## +def custom_ellipse( ax, x, y, major, minor, theta, numpoints = 750, **kwargs ): + xs = [] + ys = [] + incr = 2.0*math.pi / numpoints + incrTheta = 0.0 + while incrTheta <= (2.0*math.pi): + a = major * math.cos( incrTheta ) + b = minor * math.sin( incrTheta ) + l = math.sqrt( ( a**2 ) + ( b**2 ) ) + phi = math.atan2( b, a ) + incrTheta += incr + + xs.append( x + ( l * math.cos( theta + phi ) ) ) + ys.append( y + ( l * math.sin( theta + phi ) ) ) + # end while + + incrTheta = 2.0*math.pi + a = major * math.cos( incrTheta ) + b = minor * math.sin( incrTheta ) + l = sqrt( ( a**2 ) + ( b**2 ) ) + phi = math.atan2( b, a ) + xs.append( x + ( l * math.cos( theta + phi ) ) ) + ys.append( y + ( l * math.sin( theta + phi ) ) ) + + ellipseLine = ax.plot( xs, ys, **kwargs ) + + + + +################################################## +# make the axes +ax1 = subplot( 311, aspect='equal' ) +ax1.set_aspect( 'equal', 'datalim' ) + +# make the lower-bound ellipse +diam = (r - delta) * 2.0 +lower_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkgreen" ) +ax1.add_patch( lower_ellipse ) + +# make the target ellipse +diam = r * 2.0 +target_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkred" ) +ax1.add_patch( target_ellipse ) + +# make the upper-bound ellipse +diam = (r + delta) * 2.0 +upper_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkblue" ) +ax1.add_patch( upper_ellipse ) + +# make the target +diam = delta * 2.0 +target = Ellipse( (x, y), diam, diam, 0.0, fill=False, edgecolor="#DD1208" ) +ax1.add_patch( target ) + +# give it a big marker +ax1.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + +################################################## +# make the axes +ax = subplot( 312, aspect='equal' , sharex=ax1, sharey=ax1) +ax.set_aspect( 'equal', 'datalim' ) + +# make the lower-bound arc +diam = (r - delta) * 2.0 +lower_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkgreen" ) +ax.add_patch( lower_arc ) + +# make the target arc +diam = r * 2.0 +target_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkred" ) +ax.add_patch( target_arc ) + +# make the upper-bound arc +diam = (r + delta) * 2.0 +upper_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkblue" ) +ax.add_patch( upper_arc ) + +# make the target +diam = delta * 2.0 +target = Arc( (x, y), diam, diam, 0.0, fill=False, edgecolor="#DD1208" ) +ax.add_patch( target ) + +# give it a big marker +ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + + + + + +################################################## +# now lets do the same thing again using a custom ellipse function + + + +# make the axes +ax = subplot( 313, aspect='equal', sharex=ax1, sharey=ax1 ) +ax.set_aspect( 'equal', 'datalim' ) + +# make the lower-bound ellipse +custom_ellipse( ax, 0.0, 0.0, r-delta, r-delta, 0.0, color="darkgreen" ) + +# make the target ellipse +custom_ellipse( ax, 0.0, 0.0, r, r, 0.0, color="darkred" ) + +# make the upper-bound ellipse +custom_ellipse( ax, 0.0, 0.0, r+delta, r+delta, 0.0, color="darkblue" ) + +# make the target +custom_ellipse( ax, x, y, delta, delta, 0.0, color="#BB1208" ) + +# give it a big marker +ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + + +# give it a big marker +ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + +################################################## +# lets zoom in to see the area of interest + +ax1.set_xlim(2650, 2735) +ax1.set_ylim(6705, 6735) + +savefig("ellipse") +show() + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5325 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5325&view=rev Author: dsdale Date: 2008年05月30日 10:29:25 -0700 (2008年5月30日) Log Message: ----------- temporary hack to make mathpng extension work with the way we organized doc/ Modified Paths: -------------- trunk/matplotlib/doc/sphinxext/mathpng.py Modified: trunk/matplotlib/doc/sphinxext/mathpng.py =================================================================== --- trunk/matplotlib/doc/sphinxext/mathpng.py 2008年05月30日 17:11:35 UTC (rev 5324) +++ trunk/matplotlib/doc/sphinxext/mathpng.py 2008年05月30日 17:29:25 UTC (rev 5325) @@ -100,6 +100,7 @@ for i in range(count): if os.path.exists(path): break path = '../'+path + path = '../'+path #specifically added for matplotlib if inline and '_' in latex: align = 'align="absmiddle" ' else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5324 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5324&view=rev Author: jdh2358 Date: 2008年05月30日 10:11:35 -0700 (2008年5月30日) Log Message: ----------- removed the pngs from svn; they can be autogenerated Removed Paths: ------------- trunk/htdocs/screenshots/align_text_large.png trunk/htdocs/screenshots/align_text_small.png trunk/htdocs/screenshots/axes_demo_large.png trunk/htdocs/screenshots/axes_demo_small.png trunk/htdocs/screenshots/barchart_demo_large.png trunk/htdocs/screenshots/barchart_demo_small.png trunk/htdocs/screenshots/contour_small.png trunk/htdocs/screenshots/date_demo_large.png trunk/htdocs/screenshots/date_demo_small.png trunk/htdocs/screenshots/eeg_large.png trunk/htdocs/screenshots/eeg_small.png trunk/htdocs/screenshots/fill_demo_large.png trunk/htdocs/screenshots/fill_demo_small.png trunk/htdocs/screenshots/finance_work2_large.png trunk/htdocs/screenshots/finance_work2_small.png trunk/htdocs/screenshots/histogram_demo_large.png trunk/htdocs/screenshots/histogram_demo_small.png trunk/htdocs/screenshots/layer_images_large.png trunk/htdocs/screenshots/layer_images_small.png trunk/htdocs/screenshots/legend_demo_large.png trunk/htdocs/screenshots/legend_demo_small.png trunk/htdocs/screenshots/log_shot.png trunk/htdocs/screenshots/log_shot_large.png trunk/htdocs/screenshots/log_shot_small.png trunk/htdocs/screenshots/logo.png trunk/htdocs/screenshots/mathtext_demo_large.png trunk/htdocs/screenshots/mathtext_demo_small.png trunk/htdocs/screenshots/mri_with_eeg_large.png trunk/htdocs/screenshots/mri_with_eeg_small.png trunk/htdocs/screenshots/pcolor_demo_large.png trunk/htdocs/screenshots/pcolor_demo_small.png trunk/htdocs/screenshots/pfm-lsm.png trunk/htdocs/screenshots/pie_demo_large.png trunk/htdocs/screenshots/pie_demo_small.png trunk/htdocs/screenshots/plotmap_large.png trunk/htdocs/screenshots/plotmap_small.png trunk/htdocs/screenshots/polar_demo_large.png trunk/htdocs/screenshots/polar_demo_small.png trunk/htdocs/screenshots/scatter_demo2_large.png trunk/htdocs/screenshots/scatter_demo2_small.png trunk/htdocs/screenshots/simple_plot_large.png trunk/htdocs/screenshots/simple_plot_small.png trunk/htdocs/screenshots/slider_demo_large.png trunk/htdocs/screenshots/slider_demo_small.png trunk/htdocs/screenshots/subplot_demo_large.png trunk/htdocs/screenshots/subplot_demo_small.png trunk/htdocs/screenshots/table_demo_large.png trunk/htdocs/screenshots/table_demo_small.png trunk/htdocs/screenshots/tex_demo_large.png trunk/htdocs/screenshots/tex_demo_small.png trunk/htdocs/screenshots/text_themes_large.png trunk/htdocs/screenshots/text_themes_small.png trunk/htdocs/screenshots/wheeler_demo_large.png trunk/htdocs/screenshots/wheeler_demo_small.png Deleted: trunk/htdocs/screenshots/align_text_large.png =================================================================== (Binary files differ) Deleted: trunk/htdocs/screenshots/align_text_small.png =================================================================== (Binary files differ) Deleted: trunk/htdocs/screenshots/axes_demo_large.png =================================================================== (Binary files differ) Deleted: trunk/htdocs/screenshots/axes_demo_small.png =================================================================== (Binary files differ) Deleted: trunk/htdocs/screenshots/barchart_demo_large.png =================================================================== (Binary files differ) Deleted: trunk/htdocs/screenshots/barchart_demo_small.png =================================================================== (Binary files differ) Deleted: trunk/htdocs/screenshots/contour_small.png =================================================================== --- trunk/htdocs/screenshots/contour_small.png 2008年05月30日 17:09:53 UTC (rev 5323) +++ trunk/htdocs/screenshots/contour_small.png 2008年05月30日 17:11:35 UTC (rev 5324) @@ -1,656 +0,0 @@ -\x89PNG - -
Revision: 5323 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5323&view=rev Author: jdh2358 Date: 2008年05月30日 10:09:53 -0700 (2008年5月30日) Log Message: ----------- updated hst and other demos Modified Paths: -------------- trunk/htdocs/screenshots/align_text_large.png trunk/htdocs/screenshots/align_text_small.png trunk/htdocs/screenshots/axes_demo_large.png trunk/htdocs/screenshots/axes_demo_small.png trunk/htdocs/screenshots/barchart_demo_large.png trunk/htdocs/screenshots/barchart_demo_small.png trunk/htdocs/screenshots/date_demo_large.png trunk/htdocs/screenshots/date_demo_small.png trunk/htdocs/screenshots/fill_demo_large.png trunk/htdocs/screenshots/fill_demo_small.png trunk/htdocs/screenshots/finance_work2.py trunk/htdocs/screenshots/finance_work2_large.png trunk/htdocs/screenshots/finance_work2_small.png trunk/htdocs/screenshots/histogram_demo_large.png trunk/htdocs/screenshots/histogram_demo_small.png trunk/htdocs/screenshots/hstdemo.py trunk/htdocs/screenshots/layer_images_large.png trunk/htdocs/screenshots/layer_images_small.png trunk/htdocs/screenshots/legend_demo_large.png trunk/htdocs/screenshots/legend_demo_small.png trunk/htdocs/screenshots/log_shot_large.png trunk/htdocs/screenshots/log_shot_small.png trunk/htdocs/screenshots/makeshots.py trunk/htdocs/screenshots/mathtext_demo_large.png trunk/htdocs/screenshots/mathtext_demo_small.png trunk/htdocs/screenshots/mathtext_examples.py trunk/htdocs/screenshots/mri_with_eeg.py trunk/htdocs/screenshots/mri_with_eeg_large.png trunk/htdocs/screenshots/mri_with_eeg_small.png trunk/htdocs/screenshots/pcolor_demo_large.png trunk/htdocs/screenshots/pcolor_demo_small.png trunk/htdocs/screenshots/pfm-lsm.png trunk/htdocs/screenshots/pie_demo_large.png trunk/htdocs/screenshots/pie_demo_small.png trunk/htdocs/screenshots/plotmap_large.png trunk/htdocs/screenshots/plotmap_small.png trunk/htdocs/screenshots/polar_demo.py trunk/htdocs/screenshots/polar_demo_large.png trunk/htdocs/screenshots/polar_demo_small.png trunk/htdocs/screenshots/scatter_demo2_large.png trunk/htdocs/screenshots/scatter_demo2_small.png trunk/htdocs/screenshots/simple_plot_large.png trunk/htdocs/screenshots/simple_plot_small.png trunk/htdocs/screenshots/slider_demo_large.png trunk/htdocs/screenshots/slider_demo_small.png trunk/htdocs/screenshots/table_demo.py trunk/htdocs/screenshots/table_demo_large.png trunk/htdocs/screenshots/table_demo_small.png trunk/htdocs/screenshots/tex_demo_large.png trunk/htdocs/screenshots/tex_demo_small.png trunk/htdocs/screenshots/text_themes_large.png trunk/htdocs/screenshots/text_themes_small.png trunk/htdocs/screenshots/wheeler_demo_large.png trunk/htdocs/screenshots/wheeler_demo_small.png Modified: trunk/htdocs/screenshots/align_text_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/align_text_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/axes_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/axes_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/barchart_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/barchart_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/date_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/date_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/fill_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/fill_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/finance_work2.py =================================================================== --- trunk/htdocs/screenshots/finance_work2.py 2008年05月30日 16:58:02 UTC (rev 5322) +++ trunk/htdocs/screenshots/finance_work2.py 2008年05月30日 17:09:53 UTC (rev 5323) @@ -82,9 +82,9 @@ rect2 = [left, 0.3, width, 0.4] rect3 = [left, 0.1, width, 0.2] axUpper = axes(rect1, axisbg=axesBG) #left, bottom, width, height -axMiddle = axes(rect2, axisbg=axesBG) -axMiddleVol = axes(rect2, axisbg=axesBG, frameon=False) # the volume overlay -axLower = axes(rect3, axisbg=axesBG) +axMiddle = axes(rect2, axisbg=axesBG, sharex=axUpper) +axMiddleVol = axes(rect2, axisbg=axesBG, frameon=False, sharex=axUpper) # the volume overlay +axLower = axes(rect3, axisbg=axesBG, sharex=axUpper) axUpper.xaxis.set_major_locator( get_locator() ) @@ -145,7 +145,7 @@ if 1: ############### Middle axes ################# #plot_day_summary2(axMiddle, opens, closes, highs, lows) - candlestick2(axMiddle, opens, closes, highs, lows) + candlestick2(axMiddle, opens, closes, highs, lows, width=0.9) # specify the text in axes (0,1) coords. 0,0 is lower left and 1,1 is # upper right @@ -215,7 +215,11 @@ allAxes = (axUpper, axMiddle, axMiddleVol, axLower) xlim = 0, len(quotes) for a in allAxes: - a.dataLim.intervalx().set_bounds(*xlim) + #a.dataLim.intervalx = xlim a.set_xlim(xlim) +for ax in axUpper, axMiddle: + for ticklabel in ax.get_xticklabels(): + ticklabel.set_visible(False) + show() Modified: trunk/htdocs/screenshots/finance_work2_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/finance_work2_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/histogram_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/histogram_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/hstdemo.py =================================================================== --- trunk/htdocs/screenshots/hstdemo.py 2008年05月30日 16:58:02 UTC (rev 5322) +++ trunk/htdocs/screenshots/hstdemo.py 2008年05月30日 17:09:53 UTC (rev 5323) @@ -1,73 +1,61 @@ """Demo of image with contour overlay -This demo displays an HST image of NGC 1275 taken with three different -filters combined as an RGB image with contours of an aligned Chandra -X-Ray image (smoothed) of the same object overplotted +This demo displays an HST image of NGC 1275 taken with three different filters +combined as an RGB image with contours of an aligned Chandra X-Ray image (smoothed) +of the same object overplotted -The data for the images are stored as simple binary files and the -necessary shape and type info is added by the loaddata function (as -well as decompression for the HST image). +The data for the images are stored as simple binary files and the necessary shape +and type info is added by the loaddata function (as well as decompression for the +HST image). -The demo creates a figure window that is the size of the HST image in -pixels so that no resampling is done, scales the plot window (axes) to -fill the figure window. Resizing the window will modify the aspect -ratio, but correspondence between the HST image and contour image will -always be correct +The demo creates a figure window that is the size of the HST image in pixels so that +no resampling is done, scales the plot window (axes) to fill the figure window. +Resizing the window will modify the aspect ratio, but correspondence between the +HST image and contour image will always be correct -The HST image was obtained from the Hubble Heritage web pages +The HST image was obtained from the Hubble Heritage web pages (http://heritage.stsci.edu/2003/14/index.html) (Credits: NASA and The Hubble Heritage Team (STScI/AURA)) The Chandra image was obtained from the Chandra web site http://chandra.harvard.edu/photo/2000/perseus/index.html (Credits: NASA/CXC/SAo) """ -from pylab import * -import matplotlib.cm as cm -import matplotlib.numerix as n -import zlib -import sys +import sys, zlib +import numpy as np +import matplotlib.pyplot as plt -from pylab import savefig - -def load_hst_data(): +def loaddata(): """reconstruct the numerix arrays from the data files""" - - #hst = n.fromfile('hst.dat',typecode=n.UInt8, shape=(812,592,3))/255. - - str = open('data/hst.zdat').read() - dstr = zlib.decompress(str) - hst = n.fromstring(dstr, n.UInt8) + #hst = np.fromfile('hst.dat',typecode=np.UInt8, shape=(812,592,3))/255. + s = file('hst.zdat').read() + dstr = zlib.decompress(s) + hst = np.fromstring(dstr, np.uint8) hst.shape = (812, 592, 3) hst = hst/255. - str = open('data/chandra.dat').read() - chandra = n.fromstring(str, n.Int16) + s = file('chandra.dat').read() + chandra = np.fromstring(s, np.int16) chandra.shape = (812,592) if sys.byteorder == 'little': - chandra = chandra.byteswapped() - + chandra = chandra.byteswap() # note that both HST and Chandra data are normalized to be between 0 and 1 return hst, chandra/16000. def hstdemo(): - rc('image',origin='lower') # correct display requires setting origin to this - hst, chandra = load_hst_data() + plt.rc('image',origin='lower') # correct display requires setting origin to this + hst, chandra = loaddata() # set size of figure window to be exactly that of the image so no resampling is done h, w, d = hst.shape dpi=80. - figure(figsize=(w/dpi, h/dpi), dpi=dpi) + plt.figure(figsize=(w/dpi, h/dpi), dpi=dpi) # set plot region to full window size - axes((0,0,1,1)) + plt.axes((0,0,1,1)) # display rgb HST image - imshow(hst) + plt.imshow(hst) # overplot X-ray contour map - contour(chandra, [.95,.85, .6], linewidths=2, cmap=cm.hot) - clim(0,1.1) - legend(loc='lower right') - text(160, 75, 'HST image of NGC 1275\n with Chandra X-Ray contours', + plt.contour(chandra, [.95,.85, .6]) + plt.legend() + plt.text(160, 75, 'HST image of NGC 1275\n with Chandra X-Ray contours', color='white', size=22) - - hstdemo() -savefig('hstdemo') -show() +plt.show() Modified: trunk/htdocs/screenshots/layer_images_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/layer_images_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/legend_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/legend_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/log_shot_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/log_shot_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/makeshots.py =================================================================== --- trunk/htdocs/screenshots/makeshots.py 2008年05月30日 16:58:02 UTC (rev 5322) +++ trunk/htdocs/screenshots/makeshots.py 2008年05月30日 17:09:53 UTC (rev 5323) @@ -32,6 +32,7 @@ 'pie_demo.py' : default, 'plotmap.py' : default, 'hstdemo.py' : default, + 'path_patch_demo.py' : default, } Modified: trunk/htdocs/screenshots/mathtext_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/mathtext_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/mathtext_examples.py =================================================================== --- trunk/htdocs/screenshots/mathtext_examples.py 2008年05月30日 16:58:02 UTC (rev 5322) +++ trunk/htdocs/screenshots/mathtext_examples.py 2008年05月30日 17:09:53 UTC (rev 5323) @@ -40,7 +40,7 @@ r"$f^'$", r'$\frac{x_2888}{y}$', r"$\sqrt[3]{\frac{X_2}{Y}}=5$", - r"$\sqrt[5x\pi]{\prod^\frac{x}{2\pi^2}_\infty}$", + r"$\sqrt[5]{\prod^\frac{x}{2\pi^2}_\infty}$", r"$\sqrt[3]{x}=5$", r'$\frac{X}{\frac{X}{Y}}$', # From UTR #25 @@ -49,7 +49,7 @@ r'$\widehat{abc}\widetilde{def}$', r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$', r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$', - #ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' + ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$' ] from pylab import * Modified: trunk/htdocs/screenshots/mri_with_eeg.py =================================================================== --- trunk/htdocs/screenshots/mri_with_eeg.py 2008年05月30日 16:58:02 UTC (rev 5322) +++ trunk/htdocs/screenshots/mri_with_eeg.py 2008年05月30日 17:09:53 UTC (rev 5323) @@ -4,24 +4,21 @@ faster* """ from __future__ import division -import numpy - from pylab import * from matplotlib.lines import Line2D -from matplotlib.transforms import get_bbox_transform, Point, Value, Bbox,\ - unit_bbox +from matplotlib.transforms import Bbox, BboxTransform, BboxTransformTo, Affine2D # I use if 1 to break up the different regions of code visually if 1: # load the data # data are 256x256 16 bit integers dfile = 'data/s1045.ima' - im = fromstring(file(dfile, 'rb').read(), numpy.uint16).astype(numpy.float) + im = fromstring(file(dfile, 'rb').read(), uint16).astype(float) im.shape = 256, 256 if 1: # plot the MRI in pcolor subplot(221) - imshow(im) + imshow(im, cmap=cm.jet) axis('off') if 1: # plot the histogram of MRI intensity @@ -30,44 +27,39 @@ im = take(im, nonzero(im)) # ignore the background im = im/(2.0**15) # normalize hist(im, 100) - xticks([]) + xticks([-1, -.5, 0, .5, 1]) yticks([]) xlabel('intensity') ylabel('MRI density') if 1: # plot the EEG # load the data + numSamples, numRows = 800,4 - data = fromstring(file('data/eeg.dat', 'rb').read(), numpy.float) + data = fromstring(file('data/eeg.dat', 'rb').read(), float) data.shape = numSamples, numRows t = arange(numSamples)/float(numSamples)*10.0 ticklocs = [] ax = subplot(212) + xlim(0,10) + xticks(arange(10)) - boxin = Bbox( - Point(ax.viewLim.ll().x(), Value(-20)), - Point(ax.viewLim.ur().x(), Value(20))) + boxin = Bbox.from_extents(ax.viewLim.x0, -20, ax.viewLim.x1, 20) + height = ax.bbox.height + boxout = Bbox.from_extents(ax.bbox.x0, -1.0 * height, + ax.bbox.x1, 1.0 * height) - height = ax.bbox.ur().y() - ax.bbox.ll().y() - boxout = Bbox( - Point(ax.bbox.ll().x(), Value(-1)*height), - Point(ax.bbox.ur().x(), Value(1) * height)) + transOffset = BboxTransformTo( + Bbox.from_extents(0.0, ax.bbox.y0, 1.0, ax.bbox.y1)) - transOffset = get_bbox_transform( - unit_bbox(), - Bbox( Point( Value(0), ax.bbox.ll().y()), - Point( Value(1), ax.bbox.ur().y()) - )) - - for i in range(numRows): # effectively a copy of transData - trans = get_bbox_transform(boxin, boxout) + trans = BboxTransform(boxin, boxout) offset = (i+1)/(numRows+1) - trans.set_offset( (0, offset), transOffset) + trans += Affine2D().translate(*transOffset.transform_point((0, offset))) thisLine = Line2D( t, data[:,i]-data[0,i], @@ -78,11 +70,8 @@ ax.add_line(thisLine) ticklocs.append(offset) - xlim(0,10) - xticks(arange(10)) + setp(gca(), 'yticklabels', ['PG3', 'PG5', 'PG7', 'PG9']) - yticks(ticklocs, ['PG3', 'PG5', 'PG7', 'PG9']) - # set the yticks to use axes coords on the y axis ax.set_yticks(ticklocs) for tick in ax.yaxis.get_major_ticks(): Modified: trunk/htdocs/screenshots/mri_with_eeg_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/mri_with_eeg_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/pcolor_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/pcolor_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/pfm-lsm.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/pie_demo_large.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/pie_demo_small.png =================================================================== (Binary files differ) Modified: trunk/htdocs/screenshots/plotmap_large.png =================================================================== --- trunk/htdocs/screenshots/plotmap_large.png 2008年05月30日 16:58:02 UTC (rev 5322) +++ trunk/htdocs/screenshots/plotmap_large.png 2008年05月30日 17:09:53 UTC (rev 5323) @@ -1,4333 +1,4195 @@ \x89PNG
Revision: 5322 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5322&view=rev Author: jdh2358 Date: 2008年05月30日 09:58:02 -0700 (2008年5月30日) Log Message: ----------- updated path example Modified Paths: -------------- trunk/matplotlib/examples/api/path_patch_demo.py trunk/matplotlib/examples/event_handling/path_editor.py Modified: trunk/matplotlib/examples/api/path_patch_demo.py =================================================================== --- trunk/matplotlib/examples/api/path_patch_demo.py 2008年05月30日 16:57:43 UTC (rev 5321) +++ trunk/matplotlib/examples/api/path_patch_demo.py 2008年05月30日 16:58:02 UTC (rev 5322) @@ -9,26 +9,28 @@ ax = fig.add_subplot(111) pathdata = [ - (Path.MOVETO, (0, 0)), - (Path.CURVE4, (-1, 0)), - (Path.CURVE4, (-1, 1)), - (Path.CURVE4, (0, 1)), - (Path.LINETO, (2, 1)), - (Path.CURVE4, (3, 1)), - (Path.CURVE4, (3, 0)), - (Path.CURVE4, (2, 0)), - (Path.CLOSEPOLY, (0, 0)), + (Path.MOVETO, (1.58, -2.57)), + (Path.CURVE4, (0.35, -1.1)), + (Path.CURVE4, (-1.75, 2.0)), + (Path.CURVE4, (0.375, 2.0)), + (Path.LINETO, (0.85, 1.15)), + (Path.CURVE4, (2.2, 3.2)), + (Path.CURVE4, (3, 0.05)), + (Path.CURVE4, (2.0, -0.5)), + (Path.CLOSEPOLY, (1.58, -2.57)), ] codes, verts = zip(*pathdata) path = mpath.Path(verts, codes) -patch = mpatches.PathPatch(path, facecolor='green', edgecolor='yellow', alpha=0.5) +patch = mpatches.PathPatch(path, facecolor='red', edgecolor='yellow', alpha=0.5) ax.add_patch(patch) - -ax.set_xlim(-5,5) -ax.set_ylim(-5,5) - +x, y = zip(*path.vertices) +line, = ax.plot(x, y, 'go-') +ax.grid() +ax.set_xlim(-3,4) +ax.set_ylim(-3,4) +ax.set_title('spline paths') plt.show() Modified: trunk/matplotlib/examples/event_handling/path_editor.py =================================================================== --- trunk/matplotlib/examples/event_handling/path_editor.py 2008年05月30日 16:57:43 UTC (rev 5321) +++ trunk/matplotlib/examples/event_handling/path_editor.py 2008年05月30日 16:58:02 UTC (rev 5322) @@ -10,15 +10,15 @@ ax = fig.add_subplot(111) pathdata = [ - (Path.MOVETO, (0, 0)), - (Path.CURVE4, (-1, 0.1)), - (Path.CURVE4, (-1, 0.9)), - (Path.CURVE4, (0, 1)), - (Path.LINETO, (2, 1)), - (Path.CURVE4, (3, 0.9)), - (Path.CURVE4, (3, 0.1)), - (Path.CURVE4, (2, 0)), - (Path.CLOSEPOLY, (0, 0)), + (Path.MOVETO, (1.58, -2.57)), + (Path.CURVE4, (0.35, -1.1)), + (Path.CURVE4, (-1.75, 2.0)), + (Path.CURVE4, (0.375, 2.0)), + (Path.LINETO, (0.85, 1.15)), + (Path.CURVE4, (2.2, 3.2)), + (Path.CURVE4, (3, 0.05)), + (Path.CURVE4, (2.0, -0.5)), + (Path.CLOSEPOLY, (1.58, -2.57)), ] codes, verts = zip(*pathdata) @@ -123,9 +123,8 @@ if event.button != 1: return x,y = event.xdata, event.ydata - # todo: expose me vertices = self.pathpatch.get_path().vertices - + vertices[self._ind] = x,y self.line.set_data(zip(*vertices)) @@ -137,8 +136,8 @@ interactor = PathInteractor(patch) ax.set_title('drag vertices to update path') -ax.set_xlim(-5,5) -ax.set_ylim(-5,5) +ax.set_xlim(-3,4) +ax.set_ylim(-3,4) plt.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5321 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5321&view=rev Author: jdh2358 Date: 2008年05月30日 09:57:43 -0700 (2008年5月30日) Log Message: ----------- added htdocs path demo Added Paths: ----------- trunk/htdocs/screenshots/path_patch_demo.py Added: trunk/htdocs/screenshots/path_patch_demo.py =================================================================== --- trunk/htdocs/screenshots/path_patch_demo.py (rev 0) +++ trunk/htdocs/screenshots/path_patch_demo.py 2008年05月30日 16:57:43 UTC (rev 5321) @@ -0,0 +1,36 @@ +import numpy as np +import matplotlib.path as mpath +import matplotlib.patches as mpatches +import matplotlib.pyplot as plt + +Path = mpath.Path + +fig = plt.figure() +ax = fig.add_subplot(111) + +pathdata = [ + (Path.MOVETO, (1.58, -2.57)), + (Path.CURVE4, (0.35, -1.1)), + (Path.CURVE4, (-1.75, 2.0)), + (Path.CURVE4, (0.375, 2.0)), + (Path.LINETO, (0.85, 1.15)), + (Path.CURVE4, (2.2, 3.2)), + (Path.CURVE4, (3, 0.05)), + (Path.CURVE4, (2.0, -0.5)), + (Path.CLOSEPOLY, (1.58, -2.57)), + ] + +codes, verts = zip(*pathdata) +path = mpath.Path(verts, codes) +patch = mpatches.PathPatch(path, facecolor='red', edgecolor='yellow', alpha=0.5) +ax.add_patch(patch) + +x, y = zip(*path.vertices) +line, = ax.plot(x, y, 'go-') +ax.grid() +ax.set_xlim(-3,4) +ax.set_ylim(-3,4) +ax.set_title('spline paths') +plt.show() + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.