You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ef...@us...> - 2008-09-20 03:21:45
|
Revision: 6115
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6115&view=rev
Author: efiring
Date: 2008-09-20 03:21:19 +0000 (Sat, 20 Sep 2008)
Log Message:
-----------
fix bug in "angles='xy'" support in quiver
Modified Paths:
--------------
trunk/matplotlib/examples/tests/backend_driver.py
trunk/matplotlib/lib/matplotlib/quiver.py
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-09-19 00:36:10 UTC (rev 6114)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-09-20 03:21:19 UTC (rev 6115)
@@ -50,6 +50,7 @@
'customize_rc.py',
'date_demo1.py',
'date_demo2.py',
+ 'ellipse_collection.py',
'equal_aspect_ratio.py',
'errorbar_limits.py',
'fancybox_demo.py',
Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/quiver.py 2008-09-19 00:36:10 UTC (rev 6114)
+++ trunk/matplotlib/lib/matplotlib/quiver.py 2008-09-20 03:21:19 UTC (rev 6115)
@@ -477,7 +477,7 @@
length = a/(self.scale*self.width)
X, Y = self._h_arrows(length)
if self.angles == 'xy':
- theta = self._angles(U, V).filled(0)
+ theta = self._angles(U, V).filled(0)[:,np.newaxis]
elif self.angles == 'uv':
theta = np.angle(ma.asarray(uv[..., np.newaxis]).filled(0))
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-09-18 17:36:12
|
Revision: 6114
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6114&view=rev
Author: efiring
Date: 2008-09-19 00:36:10 +0000 (Fri, 19 Sep 2008)
Log Message:
-----------
Change quiver angles kwarg from radians to degrees
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/quiver.py
Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/quiver.py 2008-09-19 00:30:54 UTC (rev 6113)
+++ trunk/matplotlib/lib/matplotlib/quiver.py 2008-09-19 00:36:10 UTC (rev 6114)
@@ -85,7 +85,7 @@
CCW from the *x*-axis.
With 'xy', the arrow points from (x,y) to (x+u, y+v).
Alternatively, arbitrary angles may be specified as an array
- of values in radians, CCW from the *x*-axis.
+ of values in degrees, CCW from the *x*-axis.
*scale*: [ None | float ]
data units per arrow unit, e.g. m/s per plot width; a smaller
@@ -481,7 +481,7 @@
elif self.angles == 'uv':
theta = np.angle(ma.asarray(uv[..., np.newaxis]).filled(0))
else:
- theta = ma.asarray(self.angles).filled(0)
+ theta = ma.asarray(self.angles*np.pi/180.0).filled(0)
xy = (X+Y*1j) * np.exp(1j*theta)*self.width
xy = xy[:,:,np.newaxis]
XY = ma.concatenate((xy.real, xy.imag), axis=2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-09-18 17:30:56
|
Revision: 6113
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6113&view=rev
Author: efiring
Date: 2008-09-19 00:30:54 +0000 (Fri, 19 Sep 2008)
Log Message:
-----------
Added an EllipseCollection class to collections.py
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/collections.py
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/ellipse_collection.py
Added: trunk/matplotlib/examples/pylab_examples/ellipse_collection.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/ellipse_collection.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/ellipse_collection.py 2008-09-19 00:30:54 UTC (rev 6113)
@@ -0,0 +1,34 @@
+import matplotlib.pyplot as plt
+import numpy as np
+from matplotlib.collections import EllipseCollection
+
+x = np.arange(10)
+y = np.arange(15)
+X, Y = np.meshgrid(x, y)
+
+XY = np.hstack((X.ravel()[:,np.newaxis], Y.ravel()[:,np.newaxis]))
+
+ww = X/10.0
+hh = Y/15.0
+aa = X*9
+
+
+ax = plt.subplot(1,1,1)
+
+ec = EllipseCollection(
+ ww,
+ hh,
+ aa,
+ units='x',
+ offsets=XY,
+ transOffset=ax.transData)
+ec.set_array((X+Y).ravel())
+ax.add_collection(ec)
+ax.autoscale_view()
+ax.set_xlabel('X')
+ax.set_ylabel('y')
+cbar = plt.colorbar(ec)
+cbar.set_label('X+Y')
+plt.show()
+
+
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-09-18 23:36:43 UTC (rev 6112)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-09-19 00:30:54 UTC (rev 6113)
@@ -10,7 +10,7 @@
"""
import copy, math, warnings
import numpy as np
-import numpy.ma as ma
+from numpy import ma
import matplotlib as mpl
import matplotlib.cbook as cbook
import matplotlib.colors as _colors # avoid conflict with kwarg
@@ -878,7 +878,7 @@
"""
A collection of circles, drawn using splines.
"""
- def __init__(self, sizes):
+ def __init__(self, sizes, **kwargs):
"""
*sizes*
Gives the area of the circle in points^2
@@ -900,7 +900,93 @@
for x in self._sizes]
return Collection.draw(self, renderer)
+ def get_paths(self):
+ return self._paths
+class EllipseCollection(Collection):
+ """
+ A collection of ellipses, drawn using splines.
+ """
+ def __init__(self, widths, heights, angles, units='points', **kwargs):
+ """
+ *widths*: sequence
+ half-lengths of first axes (e.g., semi-major axis lengths)
+
+ *heights*: sequence
+ half-lengths of second axes
+
+ *angles*: sequence
+ angles of first axes, degrees CCW from the X-axis
+
+ *units*: ['points' | 'inches' | 'dots' | 'width' | 'height' | 'x' | 'y']
+ units in which majors and minors are given; 'width' and 'height'
+ refer to the dimensions of the axes, while 'x' and 'y'
+ refer to the *offsets* data units.
+
+ Additional kwargs inherited from the base :class:`Collection`:
+
+ %(Collection)s
+ """
+ Collection.__init__(self,**kwargs)
+ self._widths = np.asarray(widths).ravel()
+ self._heights = np.asarray(heights).ravel()
+ self._angles = np.asarray(angles).ravel() *(np.pi/180.0)
+ self._units = units
+ self.set_transform(transforms.IdentityTransform())
+ self._transforms = []
+ self._paths = [mpath.Path.unit_circle()]
+ self._initialized = False
+
+
+ __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
+
+ def _init(self):
+ def on_dpi_change(fig):
+ self._transforms = []
+ self.figure.callbacks.connect('dpi_changed', on_dpi_change)
+ self._initialized = True
+
+ def set_transforms(self):
+ if not self._initialized:
+ self._init()
+ self._transforms = []
+ ax = self.axes
+ fig = self.figure
+ if self._units in ('x', 'y'):
+ if self._units == 'x':
+ dx0 = ax.viewLim.width
+ dx1 = ax.bbox.width
+ else:
+ dx0 = ax.viewLim.height
+ dx1 = ax.bbox.height
+ sc = dx1/dx0
+ else:
+ if self._units == 'inches':
+ sc = fig.dpi
+ elif self._units == 'points':
+ sc = fig.dpi / 72.0
+ elif self._units == 'width':
+ sc = ax.bbox.width
+ elif self._units == 'height':
+ sc = ax.bbox.height
+ elif self._units == 'dots':
+ sc = 1.0
+ else:
+ raise ValueError('unrecognized units: %s' % self._units)
+
+ _affine = transforms.Affine2D
+ for x, y, a in zip(self._widths, self._heights, self._angles):
+ trans = _affine().scale(x * sc, y * sc).rotate(a)
+ self._transforms.append(trans)
+
+ def draw(self, renderer):
+ if True: ###not self._transforms:
+ self.set_transforms()
+ return Collection.draw(self, renderer)
+
+ def get_paths(self):
+ return self._paths
+
class PatchCollection(Collection):
"""
A generic collection of patches.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-09-18 16:36:46
|
Revision: 6112
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6112&view=rev
Author: efiring
Date: 2008-09-18 23:36:43 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Added angles kwarg to quiver, fixed bugs.
Modified Paths:
--------------
trunk/matplotlib/API_CHANGES
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/quiver.py
Modified: trunk/matplotlib/API_CHANGES
===================================================================
--- trunk/matplotlib/API_CHANGES 2008-09-18 20:33:18 UTC (rev 6111)
+++ trunk/matplotlib/API_CHANGES 2008-09-18 23:36:43 UTC (rev 6112)
@@ -2,6 +2,9 @@
Changes for 0.98.x
==================
+* Added angles kwarg to quiver for more flexible specification of
+ the arrow angles.
+
* Deprecated (raise NotImplementedError) all the mlab2 functions from
matplotlib.mlab out of concern that some of them were not clean room
implementations.
@@ -19,7 +22,7 @@
maintained for the moment (in addition to their renamed versions), but they
are depricated and will eventually be removed.
-* Moved several function in mlab.py and cbook.py into a separate module
+* Moved several function in mlab.py and cbook.py into a separate module
numerical_methods.py because they were unrelated to the initial purpose of
mlab or cbook and appeared more coherent elsewhere.
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-09-18 20:33:18 UTC (rev 6111)
+++ trunk/matplotlib/CHANGELOG 2008-09-18 23:36:43 UTC (rev 6112)
@@ -1,11 +1,15 @@
+2008-09-18 Fixed quiver and quiverkey bugs (failure to scale properly
+ when resizing) and added additional methods for determining
+ the arrow angles - EF
+
2008-09-18 Fix polar interpolation to handle negative values of theta - MGD
2008-09-14 Reorganized cbook and mlab methods related to numerical
- calculations that have little to do with the goals of those two
- modules into a separate module numerical_methods.py
- Also, added ability to select points and stop point selection
- with keyboard in ginput and manual contour labeling code.
- Finally, fixed contour labeling bug. - DMK
+ calculations that have little to do with the goals of those two
+ modules into a separate module numerical_methods.py
+ Also, added ability to select points and stop point selection
+ with keyboard in ginput and manual contour labeling code.
+ Finally, fixed contour labeling bug. - DMK
2008-09-11 Fix backtick in Postscript output. - MGD
Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/quiver.py 2008-09-18 20:33:18 UTC (rev 6111)
+++ trunk/matplotlib/lib/matplotlib/quiver.py 2008-09-18 23:36:43 UTC (rev 6112)
@@ -72,17 +72,21 @@
* 'x' or 'y': *X* or *Y* data units
- In all cases the arrow aspect ratio is 1, so that if *U*==*V* the
- angle of the arrow on the plot is 45 degrees CCW from the
- *x*-axis.
-
- The arrows scale differently depending on the units, however. For
+ The arrows scale differently depending on the units. For
'x' or 'y', the arrows get larger as one zooms in; for other
units, the arrow size is independent of the zoom state. For
'width or 'height', the arrow size increases with the width and
height of the axes, respectively, when the the window is resized;
for 'dots' or 'inches', resizing does not change the arrows.
+ *angles*: ['uv' | 'xy' | array]
+ With the default 'uv', the arrow aspect ratio is 1, so that
+ if *U*==*V* the angle of the arrow on the plot is 45 degrees
+ CCW from the *x*-axis.
+ With 'xy', the arrow points from (x,y) to (x+u, y+v).
+ Alternatively, arbitrary angles may be specified as an array
+ of values in radians, CCW from the *x*-axis.
+
*scale*: [ None | float ]
data units per arrow unit, e.g. m/s per plot width; a smaller
scale parameter makes the arrow longer. If *None*, a simple
@@ -244,7 +248,7 @@
__init__.__doc__ = _quiverkey_doc
def _init(self):
- if not self._initialized:
+ if True: ##not self._initialized:
self._set_transform()
_pivot = self.Q.pivot
self.Q.pivot = self.pivot[self.labelpos]
@@ -345,6 +349,7 @@
self.minshaft = kw.pop('minshaft', 1)
self.minlength = kw.pop('minlength', 1)
self.units = kw.pop('units', 'width')
+ self.angles = kw.pop('angles', 'uv')
self.width = kw.pop('width', None)
self.color = kw.pop('color', 'k')
self.pivot = kw.pop('pivot', 'tail')
@@ -402,7 +407,9 @@
"""initialization delayed until first draw;
allow time for axes setup.
"""
- if not self._initialized:
+ # It seems that there are not enough event notifications
+ # available to have this work on an as-needed basis at present.
+ if True: ##not self._initialized:
trans = self._set_transform()
ax = self.ax
sx, sy = trans.inverted().transform_point(
@@ -414,7 +421,7 @@
def draw(self, renderer):
self._init()
- if self._new_UV:
+ if self._new_UV or self.angles == 'xy':
verts = self._make_verts(self.U, self.V)
self.set_verts(verts, closed=False)
self._new_UV = False
@@ -452,6 +459,14 @@
self.set_transform(trans)
return trans
+ def _angles(self, U, V, eps=0.001):
+ xy = self.ax.transData.transform(self.XY)
+ uv = ma.hstack((U[:,np.newaxis], V[:,np.newaxis])).filled(0)
+ xyp = self.ax.transData.transform(self.XY + eps * uv)
+ dxy = xyp - xy
+ ang = ma.arctan2(dxy[:,1], dxy[:,0])
+ return ang
+
def _make_verts(self, U, V):
uv = ma.asarray(U+V*1j)
a = ma.absolute(uv)
@@ -461,10 +476,12 @@
self.scale = scale
length = a/(self.scale*self.width)
X, Y = self._h_arrows(length)
- # There seems to be a ma bug such that indexing
- # a masked array with one element converts it to
- # an ndarray.
- theta = np.angle(ma.asarray(uv[..., np.newaxis]).filled(0))
+ if self.angles == 'xy':
+ theta = self._angles(U, V).filled(0)
+ elif self.angles == 'uv':
+ theta = np.angle(ma.asarray(uv[..., np.newaxis]).filled(0))
+ else:
+ theta = ma.asarray(self.angles).filled(0)
xy = (X+Y*1j) * np.exp(1j*theta)*self.width
xy = xy[:,:,np.newaxis]
XY = ma.concatenate((xy.real, xy.imag), axis=2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-18 13:33:21
|
Revision: 6111
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6111&view=rev
Author: jdh2358
Date: 2008-09-18 20:33:18 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
fixed last remaining known pytz setup bug
Modified Paths:
--------------
trunk/matplotlib/setup.py
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2008-09-18 20:29:37 UTC (rev 6110)
+++ trunk/matplotlib/setup.py 2008-09-18 20:33:18 UTC (rev 6111)
@@ -164,7 +164,7 @@
# only install pytz and dateutil if the user hasn't got them
def add_pytz():
- packages = ['pytz']
+ packages.append('pytz')
resources = ['zone.tab', 'locales/pytz.pot']
for dirpath, dirnames, filenames in os.walk(os.path.join('lib', 'pytz', 'zoneinfo')):
# remove the 'pytz' part of the path
@@ -229,6 +229,8 @@
if options['verbose']:
mod.extra_compile_args.append('-DVERBOSE')
+print 'pymods', py_modules
+print 'packages', packages
distrib = setup(name="matplotlib",
version= __version__,
description = "Python plotting package",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-18 13:26:08
|
Revision: 6109
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6109&view=rev
Author: jdh2358
Date: 2008-09-18 20:26:06 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
fixed a pytz setup bug
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/setup.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-09-18 20:20:55 UTC (rev 6108)
+++ trunk/matplotlib/CHANGELOG 2008-09-18 20:26:06 UTC (rev 6109)
@@ -73,7 +73,7 @@
2008-07-24 Rewrite of a significant portion of the clabel code (class
ContourLabeler) to improve inlining. - DMK
-
+
2008-07-22 Added Barbs polygon collection (similar to Quiver) for plotting
wind barbs. Added corresponding helpers to Axes and pyplot as
well. (examples/pylab_examples/barb_demo.py shows it off.) - RMM
@@ -163,7 +163,7 @@
2008-06-24 Added "transparent" kwarg to savefig. - MGD
-2008-06-24 Applied Stefan's patch to draw a sinle centered marker over
+2008-06-24 Applied Stefan's patch to draw a single centered marker over
a line with numpoints==1 - JDH
2008-06-23 Use splines to render circles in scatter plots - MGD
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2008-09-18 20:20:55 UTC (rev 6108)
+++ trunk/matplotlib/setup.py 2008-09-18 20:26:06 UTC (rev 6109)
@@ -166,7 +166,7 @@
def add_pytz():
packages = ['pytz']
resources = ['zone.tab', 'locales/pytz.pot']
- for dirpath, dirnames, filenames in os.walk(os.path.join('pytz', 'zoneinfo')):
+ for dirpath, dirnames, filenames in os.walk(os.path.join('lib', 'pytz', 'zoneinfo')):
# remove the 'pytz' part of the path
if '.svn' not in dirpath:
basepath = dirpath.split(os.path.sep, 1)[1]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-18 13:21:25
|
Revision: 6108
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6108&view=rev
Author: jdh2358
Date: 2008-09-18 20:20:55 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
adding new pytz
Added Paths:
-----------
trunk/matplotlib/lib/pytz/
trunk/matplotlib/lib/pytz/__init__.py
trunk/matplotlib/lib/pytz/reference.py
trunk/matplotlib/lib/pytz/tzfile.py
trunk/matplotlib/lib/pytz/tzinfo.py
trunk/matplotlib/lib/pytz/zoneinfo/
trunk/matplotlib/lib/pytz/zoneinfo/Africa/
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Abidjan
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Accra
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Addis_Ababa
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Algiers
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Asmara
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Asmera
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bamako
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bangui
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Banjul
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bissau
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Blantyre
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Brazzaville
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Bujumbura
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Cairo
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Casablanca
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Ceuta
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Conakry
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Dakar
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Dar_es_Salaam
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Djibouti
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Douala
trunk/matplotlib/lib/pytz/zoneinfo/Africa/El_Aaiun
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Freetown
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Gaborone
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Harare
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Johannesburg
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Kampala
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Khartoum
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Kigali
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Kinshasa
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lagos
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Libreville
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lome
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Luanda
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lubumbashi
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Lusaka
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Malabo
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Maputo
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Maseru
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Mbabane
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Mogadishu
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Monrovia
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Nairobi
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Ndjamena
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Niamey
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Nouakchott
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Ouagadougou
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Porto-Novo
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Sao_Tome
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Timbuktu
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Tripoli
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Tunis
trunk/matplotlib/lib/pytz/zoneinfo/Africa/Windhoek
trunk/matplotlib/lib/pytz/zoneinfo/America/
trunk/matplotlib/lib/pytz/zoneinfo/America/Adak
trunk/matplotlib/lib/pytz/zoneinfo/America/Anchorage
trunk/matplotlib/lib/pytz/zoneinfo/America/Anguilla
trunk/matplotlib/lib/pytz/zoneinfo/America/Antigua
trunk/matplotlib/lib/pytz/zoneinfo/America/Araguaina
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Buenos_Aires
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Catamarca
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/ComodRivadavia
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Cordoba
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Jujuy
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/La_Rioja
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Mendoza
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Rio_Gallegos
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/San_Juan
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/San_Luis
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Tucuman
trunk/matplotlib/lib/pytz/zoneinfo/America/Argentina/Ushuaia
trunk/matplotlib/lib/pytz/zoneinfo/America/Aruba
trunk/matplotlib/lib/pytz/zoneinfo/America/Asuncion
trunk/matplotlib/lib/pytz/zoneinfo/America/Atikokan
trunk/matplotlib/lib/pytz/zoneinfo/America/Atka
trunk/matplotlib/lib/pytz/zoneinfo/America/Bahia
trunk/matplotlib/lib/pytz/zoneinfo/America/Barbados
trunk/matplotlib/lib/pytz/zoneinfo/America/Belem
trunk/matplotlib/lib/pytz/zoneinfo/America/Belize
trunk/matplotlib/lib/pytz/zoneinfo/America/Blanc-Sablon
trunk/matplotlib/lib/pytz/zoneinfo/America/Boa_Vista
trunk/matplotlib/lib/pytz/zoneinfo/America/Bogota
trunk/matplotlib/lib/pytz/zoneinfo/America/Boise
trunk/matplotlib/lib/pytz/zoneinfo/America/Buenos_Aires
trunk/matplotlib/lib/pytz/zoneinfo/America/Cambridge_Bay
trunk/matplotlib/lib/pytz/zoneinfo/America/Campo_Grande
trunk/matplotlib/lib/pytz/zoneinfo/America/Cancun
trunk/matplotlib/lib/pytz/zoneinfo/America/Caracas
trunk/matplotlib/lib/pytz/zoneinfo/America/Catamarca
trunk/matplotlib/lib/pytz/zoneinfo/America/Cayenne
trunk/matplotlib/lib/pytz/zoneinfo/America/Cayman
trunk/matplotlib/lib/pytz/zoneinfo/America/Chicago
trunk/matplotlib/lib/pytz/zoneinfo/America/Chihuahua
trunk/matplotlib/lib/pytz/zoneinfo/America/Coral_Harbour
trunk/matplotlib/lib/pytz/zoneinfo/America/Cordoba
trunk/matplotlib/lib/pytz/zoneinfo/America/Costa_Rica
trunk/matplotlib/lib/pytz/zoneinfo/America/Cuiaba
trunk/matplotlib/lib/pytz/zoneinfo/America/Curacao
trunk/matplotlib/lib/pytz/zoneinfo/America/Danmarkshavn
trunk/matplotlib/lib/pytz/zoneinfo/America/Dawson
trunk/matplotlib/lib/pytz/zoneinfo/America/Dawson_Creek
trunk/matplotlib/lib/pytz/zoneinfo/America/Denver
trunk/matplotlib/lib/pytz/zoneinfo/America/Detroit
trunk/matplotlib/lib/pytz/zoneinfo/America/Dominica
trunk/matplotlib/lib/pytz/zoneinfo/America/Edmonton
trunk/matplotlib/lib/pytz/zoneinfo/America/Eirunepe
trunk/matplotlib/lib/pytz/zoneinfo/America/El_Salvador
trunk/matplotlib/lib/pytz/zoneinfo/America/Ensenada
trunk/matplotlib/lib/pytz/zoneinfo/America/Fort_Wayne
trunk/matplotlib/lib/pytz/zoneinfo/America/Fortaleza
trunk/matplotlib/lib/pytz/zoneinfo/America/Glace_Bay
trunk/matplotlib/lib/pytz/zoneinfo/America/Godthab
trunk/matplotlib/lib/pytz/zoneinfo/America/Goose_Bay
trunk/matplotlib/lib/pytz/zoneinfo/America/Grand_Turk
trunk/matplotlib/lib/pytz/zoneinfo/America/Grenada
trunk/matplotlib/lib/pytz/zoneinfo/America/Guadeloupe
trunk/matplotlib/lib/pytz/zoneinfo/America/Guatemala
trunk/matplotlib/lib/pytz/zoneinfo/America/Guayaquil
trunk/matplotlib/lib/pytz/zoneinfo/America/Guyana
trunk/matplotlib/lib/pytz/zoneinfo/America/Halifax
trunk/matplotlib/lib/pytz/zoneinfo/America/Havana
trunk/matplotlib/lib/pytz/zoneinfo/America/Hermosillo
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Indianapolis
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Knox
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Marengo
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Petersburg
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Tell_City
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Vevay
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Vincennes
trunk/matplotlib/lib/pytz/zoneinfo/America/Indiana/Winamac
trunk/matplotlib/lib/pytz/zoneinfo/America/Indianapolis
trunk/matplotlib/lib/pytz/zoneinfo/America/Inuvik
trunk/matplotlib/lib/pytz/zoneinfo/America/Iqaluit
trunk/matplotlib/lib/pytz/zoneinfo/America/Jamaica
trunk/matplotlib/lib/pytz/zoneinfo/America/Jujuy
trunk/matplotlib/lib/pytz/zoneinfo/America/Juneau
trunk/matplotlib/lib/pytz/zoneinfo/America/Kentucky/
trunk/matplotlib/lib/pytz/zoneinfo/America/Kentucky/Louisville
trunk/matplotlib/lib/pytz/zoneinfo/America/Kentucky/Monticello
trunk/matplotlib/lib/pytz/zoneinfo/America/Knox_IN
trunk/matplotlib/lib/pytz/zoneinfo/America/La_Paz
trunk/matplotlib/lib/pytz/zoneinfo/America/Lima
trunk/matplotlib/lib/pytz/zoneinfo/America/Los_Angeles
trunk/matplotlib/lib/pytz/zoneinfo/America/Louisville
trunk/matplotlib/lib/pytz/zoneinfo/America/Maceio
trunk/matplotlib/lib/pytz/zoneinfo/America/Managua
trunk/matplotlib/lib/pytz/zoneinfo/America/Manaus
trunk/matplotlib/lib/pytz/zoneinfo/America/Marigot
trunk/matplotlib/lib/pytz/zoneinfo/America/Martinique
trunk/matplotlib/lib/pytz/zoneinfo/America/Mazatlan
trunk/matplotlib/lib/pytz/zoneinfo/America/Mendoza
trunk/matplotlib/lib/pytz/zoneinfo/America/Menominee
trunk/matplotlib/lib/pytz/zoneinfo/America/Merida
trunk/matplotlib/lib/pytz/zoneinfo/America/Mexico_City
trunk/matplotlib/lib/pytz/zoneinfo/America/Miquelon
trunk/matplotlib/lib/pytz/zoneinfo/America/Moncton
trunk/matplotlib/lib/pytz/zoneinfo/America/Monterrey
trunk/matplotlib/lib/pytz/zoneinfo/America/Montevideo
trunk/matplotlib/lib/pytz/zoneinfo/America/Montreal
trunk/matplotlib/lib/pytz/zoneinfo/America/Montserrat
trunk/matplotlib/lib/pytz/zoneinfo/America/Nassau
trunk/matplotlib/lib/pytz/zoneinfo/America/New_York
trunk/matplotlib/lib/pytz/zoneinfo/America/Nipigon
trunk/matplotlib/lib/pytz/zoneinfo/America/Nome
trunk/matplotlib/lib/pytz/zoneinfo/America/Noronha
trunk/matplotlib/lib/pytz/zoneinfo/America/North_Dakota/
trunk/matplotlib/lib/pytz/zoneinfo/America/North_Dakota/Center
trunk/matplotlib/lib/pytz/zoneinfo/America/North_Dakota/New_Salem
trunk/matplotlib/lib/pytz/zoneinfo/America/Panama
trunk/matplotlib/lib/pytz/zoneinfo/America/Pangnirtung
trunk/matplotlib/lib/pytz/zoneinfo/America/Paramaribo
trunk/matplotlib/lib/pytz/zoneinfo/America/Phoenix
trunk/matplotlib/lib/pytz/zoneinfo/America/Port-au-Prince
trunk/matplotlib/lib/pytz/zoneinfo/America/Port_of_Spain
trunk/matplotlib/lib/pytz/zoneinfo/America/Porto_Acre
trunk/matplotlib/lib/pytz/zoneinfo/America/Porto_Velho
trunk/matplotlib/lib/pytz/zoneinfo/America/Puerto_Rico
trunk/matplotlib/lib/pytz/zoneinfo/America/Rainy_River
trunk/matplotlib/lib/pytz/zoneinfo/America/Rankin_Inlet
trunk/matplotlib/lib/pytz/zoneinfo/America/Recife
trunk/matplotlib/lib/pytz/zoneinfo/America/Regina
trunk/matplotlib/lib/pytz/zoneinfo/America/Resolute
trunk/matplotlib/lib/pytz/zoneinfo/America/Rio_Branco
trunk/matplotlib/lib/pytz/zoneinfo/America/Rosario
trunk/matplotlib/lib/pytz/zoneinfo/America/Santiago
trunk/matplotlib/lib/pytz/zoneinfo/America/Santo_Domingo
trunk/matplotlib/lib/pytz/zoneinfo/America/Sao_Paulo
trunk/matplotlib/lib/pytz/zoneinfo/America/Scoresbysund
trunk/matplotlib/lib/pytz/zoneinfo/America/Shiprock
trunk/matplotlib/lib/pytz/zoneinfo/America/St_Barthelemy
trunk/matplotlib/lib/pytz/zoneinfo/America/St_Johns
trunk/matplotlib/lib/pytz/zoneinfo/America/St_Kitts
trunk/matplotlib/lib/pytz/zoneinfo/America/St_Lucia
trunk/matplotlib/lib/pytz/zoneinfo/America/St_Thomas
trunk/matplotlib/lib/pytz/zoneinfo/America/St_Vincent
trunk/matplotlib/lib/pytz/zoneinfo/America/Swift_Current
trunk/matplotlib/lib/pytz/zoneinfo/America/Tegucigalpa
trunk/matplotlib/lib/pytz/zoneinfo/America/Thule
trunk/matplotlib/lib/pytz/zoneinfo/America/Thunder_Bay
trunk/matplotlib/lib/pytz/zoneinfo/America/Tijuana
trunk/matplotlib/lib/pytz/zoneinfo/America/Toronto
trunk/matplotlib/lib/pytz/zoneinfo/America/Tortola
trunk/matplotlib/lib/pytz/zoneinfo/America/Vancouver
trunk/matplotlib/lib/pytz/zoneinfo/America/Virgin
trunk/matplotlib/lib/pytz/zoneinfo/America/Whitehorse
trunk/matplotlib/lib/pytz/zoneinfo/America/Winnipeg
trunk/matplotlib/lib/pytz/zoneinfo/America/Yakutat
trunk/matplotlib/lib/pytz/zoneinfo/America/Yellowknife
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Casey
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Davis
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/DumontDUrville
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Mawson
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/McMurdo
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Palmer
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Rothera
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/South_Pole
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Syowa
trunk/matplotlib/lib/pytz/zoneinfo/Antarctica/Vostok
trunk/matplotlib/lib/pytz/zoneinfo/Arctic/
trunk/matplotlib/lib/pytz/zoneinfo/Arctic/Longyearbyen
trunk/matplotlib/lib/pytz/zoneinfo/Asia/
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Aden
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Almaty
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Amman
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Anadyr
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Aqtau
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Aqtobe
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ashgabat
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ashkhabad
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Baghdad
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Bahrain
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Baku
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Bangkok
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Beirut
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Bishkek
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Brunei
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Calcutta
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Choibalsan
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Chongqing
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Chungking
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Colombo
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dacca
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Damascus
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dhaka
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dili
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dubai
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Dushanbe
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Gaza
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Harbin
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ho_Chi_Minh
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Hong_Kong
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Hovd
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Irkutsk
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Istanbul
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Jakarta
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Jayapura
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Jerusalem
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kabul
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kamchatka
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Karachi
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kashgar
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Katmandu
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kolkata
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Krasnoyarsk
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kuala_Lumpur
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kuching
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Kuwait
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Macao
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Macau
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Magadan
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Makassar
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Manila
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Muscat
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Nicosia
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Novosibirsk
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Omsk
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Oral
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Phnom_Penh
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Pontianak
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Pyongyang
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Qatar
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Qyzylorda
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Rangoon
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh87
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh88
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Riyadh89
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Saigon
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Sakhalin
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Samarkand
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Seoul
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Shanghai
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Singapore
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Taipei
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tashkent
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tbilisi
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tehran
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tel_Aviv
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Thimbu
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Thimphu
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Tokyo
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ujung_Pandang
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ulaanbaatar
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Ulan_Bator
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Urumqi
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Vientiane
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Vladivostok
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Yakutsk
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Yekaterinburg
trunk/matplotlib/lib/pytz/zoneinfo/Asia/Yerevan
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Azores
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Bermuda
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Canary
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Cape_Verde
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Faeroe
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Faroe
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Jan_Mayen
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Madeira
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Reykjavik
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/South_Georgia
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/St_Helena
trunk/matplotlib/lib/pytz/zoneinfo/Atlantic/Stanley
trunk/matplotlib/lib/pytz/zoneinfo/Australia/
trunk/matplotlib/lib/pytz/zoneinfo/Australia/ACT
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Adelaide
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Brisbane
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Broken_Hill
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Canberra
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Currie
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Darwin
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Eucla
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Hobart
trunk/matplotlib/lib/pytz/zoneinfo/Australia/LHI
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Lindeman
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Lord_Howe
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Melbourne
trunk/matplotlib/lib/pytz/zoneinfo/Australia/NSW
trunk/matplotlib/lib/pytz/zoneinfo/Australia/North
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Perth
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Queensland
trunk/matplotlib/lib/pytz/zoneinfo/Australia/South
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Sydney
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Tasmania
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Victoria
trunk/matplotlib/lib/pytz/zoneinfo/Australia/West
trunk/matplotlib/lib/pytz/zoneinfo/Australia/Yancowinna
trunk/matplotlib/lib/pytz/zoneinfo/Brazil/
trunk/matplotlib/lib/pytz/zoneinfo/Brazil/Acre
trunk/matplotlib/lib/pytz/zoneinfo/Brazil/DeNoronha
trunk/matplotlib/lib/pytz/zoneinfo/Brazil/East
trunk/matplotlib/lib/pytz/zoneinfo/Brazil/West
trunk/matplotlib/lib/pytz/zoneinfo/CET
trunk/matplotlib/lib/pytz/zoneinfo/CST6CDT
trunk/matplotlib/lib/pytz/zoneinfo/Canada/
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Atlantic
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Central
trunk/matplotlib/lib/pytz/zoneinfo/Canada/East-Saskatchewan
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Eastern
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Mountain
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Newfoundland
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Pacific
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Saskatchewan
trunk/matplotlib/lib/pytz/zoneinfo/Canada/Yukon
trunk/matplotlib/lib/pytz/zoneinfo/Chile/
trunk/matplotlib/lib/pytz/zoneinfo/Chile/Continental
trunk/matplotlib/lib/pytz/zoneinfo/Chile/EasterIsland
trunk/matplotlib/lib/pytz/zoneinfo/Cuba
trunk/matplotlib/lib/pytz/zoneinfo/EET
trunk/matplotlib/lib/pytz/zoneinfo/EST
trunk/matplotlib/lib/pytz/zoneinfo/EST5EDT
trunk/matplotlib/lib/pytz/zoneinfo/Egypt
trunk/matplotlib/lib/pytz/zoneinfo/Eire
trunk/matplotlib/lib/pytz/zoneinfo/Etc/
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+0
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+1
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+10
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+11
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+12
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+2
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+3
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+4
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+5
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+6
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+7
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+8
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT+9
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-0
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-1
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-10
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-11
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-12
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-13
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-14
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-2
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-3
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-4
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-5
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-6
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-7
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-8
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT-9
trunk/matplotlib/lib/pytz/zoneinfo/Etc/GMT0
trunk/matplotlib/lib/pytz/zoneinfo/Etc/Greenwich
trunk/matplotlib/lib/pytz/zoneinfo/Etc/UCT
trunk/matplotlib/lib/pytz/zoneinfo/Etc/UTC
trunk/matplotlib/lib/pytz/zoneinfo/Etc/Universal
trunk/matplotlib/lib/pytz/zoneinfo/Etc/Zulu
trunk/matplotlib/lib/pytz/zoneinfo/Europe/
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Amsterdam
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Andorra
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Athens
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Belfast
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Belgrade
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Berlin
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Bratislava
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Brussels
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Bucharest
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Budapest
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Chisinau
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Copenhagen
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Dublin
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Gibraltar
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Guernsey
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Helsinki
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Isle_of_Man
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Istanbul
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Jersey
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Kaliningrad
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Kiev
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Lisbon
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Ljubljana
trunk/matplotlib/lib/pytz/zoneinfo/Europe/London
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Luxembourg
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Madrid
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Malta
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Mariehamn
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Minsk
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Monaco
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Moscow
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Nicosia
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Oslo
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Paris
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Podgorica
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Prague
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Riga
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Rome
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Samara
trunk/matplotlib/lib/pytz/zoneinfo/Europe/San_Marino
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Sarajevo
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Simferopol
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Skopje
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Sofia
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Stockholm
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Tallinn
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Tirane
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Tiraspol
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Uzhgorod
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vaduz
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vatican
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vienna
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Vilnius
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Volgograd
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Warsaw
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Zagreb
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Zaporozhye
trunk/matplotlib/lib/pytz/zoneinfo/Europe/Zurich
trunk/matplotlib/lib/pytz/zoneinfo/Factory
trunk/matplotlib/lib/pytz/zoneinfo/GB
trunk/matplotlib/lib/pytz/zoneinfo/GB-Eire
trunk/matplotlib/lib/pytz/zoneinfo/GMT
trunk/matplotlib/lib/pytz/zoneinfo/GMT+0
trunk/matplotlib/lib/pytz/zoneinfo/GMT-0
trunk/matplotlib/lib/pytz/zoneinfo/GMT0
trunk/matplotlib/lib/pytz/zoneinfo/Greenwich
trunk/matplotlib/lib/pytz/zoneinfo/HST
trunk/matplotlib/lib/pytz/zoneinfo/Hongkong
trunk/matplotlib/lib/pytz/zoneinfo/Iceland
trunk/matplotlib/lib/pytz/zoneinfo/Indian/
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Antananarivo
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Chagos
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Christmas
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Cocos
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Comoro
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Kerguelen
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Mahe
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Maldives
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Mauritius
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Mayotte
trunk/matplotlib/lib/pytz/zoneinfo/Indian/Reunion
trunk/matplotlib/lib/pytz/zoneinfo/Iran
trunk/matplotlib/lib/pytz/zoneinfo/Israel
trunk/matplotlib/lib/pytz/zoneinfo/Jamaica
trunk/matplotlib/lib/pytz/zoneinfo/Japan
trunk/matplotlib/lib/pytz/zoneinfo/Kwajalein
trunk/matplotlib/lib/pytz/zoneinfo/Libya
trunk/matplotlib/lib/pytz/zoneinfo/MET
trunk/matplotlib/lib/pytz/zoneinfo/MST
trunk/matplotlib/lib/pytz/zoneinfo/MST7MDT
trunk/matplotlib/lib/pytz/zoneinfo/Mexico/
trunk/matplotlib/lib/pytz/zoneinfo/Mexico/BajaNorte
trunk/matplotlib/lib/pytz/zoneinfo/Mexico/BajaSur
trunk/matplotlib/lib/pytz/zoneinfo/Mexico/General
trunk/matplotlib/lib/pytz/zoneinfo/Mideast/
trunk/matplotlib/lib/pytz/zoneinfo/Mideast/Riyadh87
trunk/matplotlib/lib/pytz/zoneinfo/Mideast/Riyadh88
trunk/matplotlib/lib/pytz/zoneinfo/Mideast/Riyadh89
trunk/matplotlib/lib/pytz/zoneinfo/NZ
trunk/matplotlib/lib/pytz/zoneinfo/NZ-CHAT
trunk/matplotlib/lib/pytz/zoneinfo/Navajo
trunk/matplotlib/lib/pytz/zoneinfo/PRC
trunk/matplotlib/lib/pytz/zoneinfo/PST8PDT
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Apia
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Auckland
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Chatham
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Easter
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Efate
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Enderbury
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Fakaofo
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Fiji
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Funafuti
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Galapagos
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Gambier
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Guadalcanal
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Guam
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Honolulu
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Johnston
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Kiritimati
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Kosrae
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Kwajalein
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Majuro
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Marquesas
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Midway
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Nauru
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Niue
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Norfolk
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Noumea
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Pago_Pago
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Palau
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Pitcairn
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Ponape
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Port_Moresby
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Rarotonga
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Saipan
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Samoa
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Tahiti
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Tarawa
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Tongatapu
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Truk
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Wake
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Wallis
trunk/matplotlib/lib/pytz/zoneinfo/Pacific/Yap
trunk/matplotlib/lib/pytz/zoneinfo/Poland
trunk/matplotlib/lib/pytz/zoneinfo/Portugal
trunk/matplotlib/lib/pytz/zoneinfo/ROC
trunk/matplotlib/lib/pytz/zoneinfo/ROK
trunk/matplotlib/lib/pytz/zoneinfo/Singapore
trunk/matplotlib/lib/pytz/zoneinfo/Turkey
trunk/matplotlib/lib/pytz/zoneinfo/UCT
trunk/matplotlib/lib/pytz/zoneinfo/US/
trunk/matplotlib/lib/pytz/zoneinfo/US/Alaska
trunk/matplotlib/lib/pytz/zoneinfo/US/Aleutian
trunk/matplotlib/lib/pytz/zoneinfo/US/Arizona
trunk/matplotlib/lib/pytz/zoneinfo/US/Central
trunk/matplotlib/lib/pytz/zoneinfo/US/East-Indiana
trunk/matplotlib/lib/pytz/zoneinfo/US/Eastern
trunk/matplotlib/lib/pytz/zoneinfo/US/Hawaii
trunk/matplotlib/lib/pytz/zoneinfo/US/Indiana-Starke
trunk/matplotlib/lib/pytz/zoneinfo/US/Michigan
trunk/matplotlib/lib/pytz/zoneinfo/US/Mountain
trunk/matplotlib/lib/pytz/zoneinfo/US/Pacific
trunk/matplotlib/lib/pytz/zoneinfo/US/Pacific-New
trunk/matplotlib/lib/pytz/zoneinfo/US/Samoa
trunk/matplotlib/lib/pytz/zoneinfo/UTC
trunk/matplotlib/lib/pytz/zoneinfo/Universal
trunk/matplotlib/lib/pytz/zoneinfo/W-SU
trunk/matplotlib/lib/pytz/zoneinfo/WET
trunk/matplotlib/lib/pytz/zoneinfo/Zulu
trunk/matplotlib/lib/pytz/zoneinfo/iso3166.tab
trunk/matplotlib/lib/pytz/zoneinfo/localtime
trunk/matplotlib/lib/pytz/zoneinfo/posixrules
trunk/matplotlib/lib/pytz/zoneinfo/zone.tab
Removed Paths:
-------------
trunk/matplotlib/lib/pytz_old/
Added: trunk/matplotlib/lib/pytz/__init__.py
===================================================================
--- trunk/matplotlib/lib/pytz/__init__.py (rev 0)
+++ trunk/matplotlib/lib/pytz/__init__.py 2008-09-18 20:20:55 UTC (rev 6108)
@@ -0,0 +1,1405 @@
+'''
+datetime.tzinfo timezone definitions generated from the
+Olson timezone database:
+
+ ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
+
+See the datetime section of the Python Library Reference for information
+on how to use these modules.
+'''
+
+# The Olson database has historically been updated about 4 times a year
+OLSON_VERSION = '2008c'
+VERSION = OLSON_VERSION
+#VERSION = OLSON_VERSION + '.2'
+__version__ = OLSON_VERSION
+
+OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling
+
+__all__ = [
+ 'timezone', 'utc', 'country_timezones',
+ 'AmbiguousTimeError', 'UnknownTimeZoneError',
+ 'all_timezones', 'all_timezones_set',
+ 'common_timezones', 'common_timezones_set',
+ ]
+
+import sys, datetime, os.path, gettext
+
+try:
+ from pkg_resources import resource_stream
+except ImportError:
+ resource_stream = None
+
+from tzinfo import AmbiguousTimeError, unpickler
+from tzfile import build_tzinfo
+
+# Use 2.3 sets module implementation if set builtin is not available
+try:
+ set
+except NameError:
+ from sets import Set as set
+
+
+def open_resource(name):
+ """Open a resource from the zoneinfo subdir for reading.
+
+ Uses the pkg_resources module if available.
+ """
+ if resource_stream is not None:
+ return resource_stream(__name__, 'zoneinfo/' + name)
+ else:
+ name_parts = name.lstrip('/').split('/')
+ for part in name_parts:
+ if part == os.path.pardir or os.path.sep in part:
+ raise ValueError('Bad path segment: %r' % part)
+ filename = os.path.join(os.path.dirname(__file__),
+ 'zoneinfo', *name_parts)
+ return open(filename, 'rb')
+
+
+# Enable this when we get some translations?
+# We want an i18n API that is useful to programs using Python's gettext
+# module, as well as the Zope3 i18n package. Perhaps we should just provide
+# the POT file and translations, and leave it up to callers to make use
+# of them.
+#
+# t = gettext.translation(
+# 'pytz', os.path.join(os.path.dirname(__file__), 'locales'),
+# fallback=True
+# )
+# def _(timezone_name):
+# """Translate a timezone name using the current locale, returning Unicode"""
+# return t.ugettext(timezone_name)
+
+
+class UnknownTimeZoneError(KeyError):
+ '''Exception raised when pytz is passed an unknown timezone.
+
+ >>> isinstance(UnknownTimeZoneError(), LookupError)
+ True
+
+ This class is actually a subclass of KeyError to provide backwards
+ compatibility with code relying on the undocumented behavior of earlier
+ pytz releases.
+
+ >>> isinstance(UnknownTimeZoneError(), KeyError)
+ True
+ '''
+ pass
+
+
+_tzinfo_cache = {}
+
+def timezone(zone):
+ r''' Return a datetime.tzinfo implementation for the given timezone
+
+ >>> from datetime import datetime, timedelta
+ >>> utc = timezone('UTC')
+ >>> eastern = timezone('US/Eastern')
+ >>> eastern.zone
+ 'US/Eastern'
+ >>> timezone(u'US/Eastern') is eastern
+ True
+ >>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
+ >>> loc_dt = utc_dt.astimezone(eastern)
+ >>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'
+ >>> loc_dt.strftime(fmt)
+ '2002-10-27 01:00:00 EST (-0500)'
+ >>> (loc_dt - timedelta(minutes=10)).strftime(fmt)
+ '2002-10-27 00:50:00 EST (-0500)'
+ >>> eastern.normalize(loc_dt - timedelta(minutes=10)).strftime(fmt)
+ '2002-10-27 01:50:00 EDT (-0400)'
+ >>> (loc_dt + timedelta(minutes=10)).strftime(fmt)
+ '2002-10-27 01:10:00 EST (-0500)'
+
+ Raises UnknownTimeZoneError if passed an unknown zone.
+
+ >>> timezone('Asia/Shangri-La')
+ Traceback (most recent call last):
+ ...
+ UnknownTimeZoneError: 'Asia/Shangri-La'
+
+ >>> timezone(u'\N{TRADE MARK SIGN}')
+ Traceback (most recent call last):
+ ...
+ UnknownTimeZoneError: u'\u2122'
+ '''
+ if zone.upper() == 'UTC':
+ return utc
+
+ try:
+ zone = zone.encode('US-ASCII')
+ except UnicodeEncodeError:
+ # All valid timezones are ASCII
+ raise UnknownTimeZoneError(zone)
+
+ zone = _unmunge_zone(zone)
+ if zone not in _tzinfo_cache:
+ if zone in all_timezones_set:
+ _tzinfo_cache[zone] = build_tzinfo(zone, open_resource(zone))
+ else:
+ raise UnknownTimeZoneError(zone)
+
+ return _tzinfo_cache[zone]
+
+
+def _unmunge_zone(zone):
+ """Undo the time zone name munging done by older versions of pytz."""
+ return zone.replace('_plus_', '+').replace('_minus_', '-')
+
+
+ZERO = datetime.timedelta(0)
+HOUR = datetime.timedelta(hours=1)
+
+
+class UTC(datetime.tzinfo):
+ """UTC
+
+ Identical to the reference UTC implementation given in Python docs except
+ that it unpickles using the single module global instance defined beneath
+ this class declaration.
+
+ Also contains extra attributes and methods to match other pytz tzinfo
+ instances.
+ """
+ zone = "UTC"
+
+ def utcoffset(self, dt):
+ return ZERO
+
+ def tzname(self, dt):
+ return "UTC"
+
+ def dst(self, dt):
+ return ZERO
+
+ def __reduce__(self):
+ return _UTC, ()
+
+ def localize(self, dt, is_dst=False):
+ '''Convert naive time to local time'''
+ if dt.tzinfo is not None:
+ raise ValueError, 'Not naive datetime (tzinfo is already set)'
+ return dt.replace(tzinfo=self)
+
+ def normalize(self, dt, is_dst=False):
+ '''Correct the timezone information on the given datetime'''
+ if dt.tzinfo is None:
+ raise ValueError, 'Naive time - no tzinfo set'
+ return dt.replace(tzinfo=self)
+
+ def __repr__(self):
+ return "<UTC>"
+
+ def __str__(self):
+ return "UTC"
+
+
+UTC = utc = UTC() # UTC is a singleton
+
+
+def _UTC():
+ """Factory function for utc unpickling.
+
+ Makes sure that unpickling a utc instance always returns the same
+ module global.
+
+ These examples belong in the UTC class above, but it is obscured; or in
+ the README.txt, but we are not depending on Python 2.4 so integrating
+ the README.txt examples with the unit tests is not trivial.
+
+ >>> import datetime, pickle
+ >>> dt = datetime.datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
+ >>> naive = dt.replace(tzinfo=None)
+ >>> p = pickle.dumps(dt, 1)
+ >>> naive_p = pickle.dumps(naive, 1)
+ >>> len(p), len(naive_p), len(p) - len(naive_p)
+ (60, 43, 17)
+ >>> new = pickle.loads(p)
+ >>> new == dt
+ True
+ >>> new is dt
+ False
+ >>> new.tzinfo is dt.tzinfo
+ True
+ >>> utc is UTC is timezone('UTC')
+ True
+ >>> utc is timezone('GMT')
+ False
+ """
+ return utc
+_UTC.__safe_for_unpickling__ = True
+
+
+def _p(*args):
+ """Factory function for unpickling pytz tzinfo instances.
+
+ Just a wrapper around tzinfo.unpickler to save a few bytes in each pickle
+ by shortening the path.
+ """
+ return unpickler(*args)
+_p.__safe_for_unpickling__ = True
+
+_country_timezones_cache = {}
+
+def country_timezones(iso3166_code):
+ """Return a list of timezones used in a particular country.
+
+ iso3166_code is the two letter code used to identify the country.
+
+ >>> country_timezones('ch')
+ ['Europe/Zurich']
+ >>> country_timezones('CH')
+ ['Europe/Zurich']
+ >>> country_timezones(u'ch')
+ ['Europe/Zurich']
+ >>> country_timezones('XXX')
+ Traceback (most recent call last):
+ ...
+ KeyError: 'XXX'
+ """
+ iso3166_code = iso3166_code.upper()
+ if not _country_timezones_cache:
+ zone_tab = open_resource('zone.tab')
+ for line in zone_tab:
+ if line.startswith('#'):
+ continue
+ code, coordinates, zone = line.split(None, 4)[:3]
+ try:
+ _country_timezones_cache[code].append(zone)
+ except KeyError:
+ _country_timezones_cache[code] = [zone]
+ return _country_timezones_cache[iso3166_code]
+
+
+# Time-zone info based solely on fixed offsets
+
+class _FixedOffset(datetime.tzinfo):
+
+ zone = None # to match the standard pytz API
+
+ def __init__(self, minutes):
+ if abs(minutes) >= 1440:
+ raise ValueError("absolute offset is too large", minutes)
+ self._minutes = minutes
+ self._offset = datetime.timedelta(minutes=minutes)
+
+ def utcoffset(self, dt):
+ return self._offset
+
+ def __reduce__(self):
+ return FixedOffset, (self._minutes, )
+
+ def dst(self, dt):
+ return None
+
+ def tzname(self, dt):
+ return None
+
+ def __repr__(self):
+ return 'pytz.FixedOffset(%d)' % self._minutes
+
+ def localize(self, dt, is_dst=False):
+ '''Convert naive time to local time'''
+ if dt.tzinfo is not None:
+ raise ValueError, 'Not naive datetime (tzinfo is already set)'
+ return dt.replace(tzinfo=self)
+
+ def normalize(self, dt, is_dst=False):
+ '''Correct the timezone information on the given datetime'''
+ if dt.tzinfo is None:
+ raise ValueError, 'Naive time - no tzinfo set'
+ return dt.replace(tzinfo=self)
+
+
+def FixedOffset(offset, _tzinfos = {}):
+ """return a fixed-offset timezone based off a number of minutes.
+
+ >>> one = FixedOffset(-330)
+ >>> one
+ pytz.FixedOffset(-330)
+ >>> one.utcoffset(datetime.datetime.now())
+ datetime.timedelta(-1, 66600)
+
+ >>> two = FixedOffset(1380)
+ >>> two
+ pytz.FixedOffset(1380)
+ >>> two.utcoffset(datetime.datetime.now())
+ datetime.timedelta(0, 82800)
+
+ The datetime.timedelta must be between the range of -1 and 1 day,
+ non-inclusive.
+
+ >>> FixedOffset(1440)
+ Traceback (most recent call last):
+ ...
+ ValueError: ('absolute offset is too large', 1440)
+
+ >>> FixedOffset(-1440)
+ Traceback (most recent call last):
+ ...
+ ValueError: ('absolute offset is too large', -1440)
+
+ An offset of 0 is special-cased to return UTC.
+
+ >>> FixedOffset(0) is UTC
+ True
+
+ There should always be only one instance of a FixedOffset per timedelta.
+ This should be true for multiple creation calls.
+
+ >>> FixedOffset(-330) is one
+ True
+ >>> FixedOffset(1380) is two
+ True
+
+ It should also be true for pickling.
+
+ >>> import pickle
+ >>> pickle.loads(pickle.dumps(one)) is one
+ True
+ >>> pickle.loads(pickle.dumps(two)) is two
+ True
+ """
+ if offset == 0:
+ return UTC
+
+ info = _tzinfos.get(offset)
+ if info is None:
+ # We haven't seen this one before. we need to save it.
+
+ # Use setdefault to avoid a race condition and make sure we have
+ # only one
+ info = _tzinfos.setdefault(offset, _FixedOffset(offset))
+
+ return info
+
+FixedOffset.__safe_for_unpickling__ = True
+
+
+def _test():
+ import doctest, os, sys
+ sys.path.insert(0, os.pardir)
+ import pytz
+ return doctest.testmod(pytz)
+
+if __name__ == '__main__':
+ _test()
+
+common_timezones = \
+['Africa/Abidjan',
+ 'Africa/Accra',
+ 'Africa/Addis_Ababa',
+ 'Africa/Algiers',
+ 'Africa/Asmara',
+ 'Africa/Asmera',
+ 'Africa/Bamako',
+ 'Africa/Bangui',
+ 'Africa/Banjul',
+ 'Africa/Bissau',
+ 'Africa/Blantyre',
+ 'Africa/Brazzaville',
+ 'Africa/Bujumbura',
+ 'Africa/Cairo',
+ 'Africa/Casablanca',
+ 'Africa/Ceuta',
+ 'Africa/Conakry',
+ 'Africa/Dakar',
+ 'Africa/Dar_es_Salaam',
+ 'Africa/Djibouti',
+ 'Africa/Douala',
+ 'Africa/El_Aaiun',
+ 'Africa/Freetown',
+ 'Africa/Gaborone',
+ 'Africa/Harare',
+ 'Africa/Johannesburg',
+ 'Africa/Kampala',
+ 'Africa/Khartoum',
+ 'Africa/Kigali',
+ 'Africa/Kinshasa',
+ 'Africa/Lagos',
+ 'Africa/Libreville',
+ 'Africa/Lome',
+ 'Africa/Luanda',
+ 'Africa/Lubumbashi',
+ 'Africa/Lusaka',
+ 'Africa/Malabo',
+ 'Africa/Maputo',
+ 'Africa/Maseru',
+ 'Africa/Mbabane',
+ 'Africa/Mogadishu',
+ 'Africa/Monrovia',
+ 'Africa/Nairobi',
+ 'Africa/Ndjamena',
+ 'Africa/Niamey',
+ 'Africa/Nouakchott',
+ 'Africa/Ouagadougou',
+ 'Africa/Porto-Novo',
+ 'Africa/Sao_Tome',
+ 'Africa/Timbuktu',
+ 'Africa/Tripoli',
+ 'Africa/Tunis',
+ 'Africa/Windhoek',
+ 'America/Adak',
+ 'America/Anchorage',
+ 'America/Anguilla',
+ 'America/Antigua',
+ 'America/Araguaina',
+ 'America/Aruba',
+ 'America/Asuncion',
+ 'America/Atikokan',
+ 'America/Atka',
+ 'America/Bahia',
+ 'America/Barbados',
+ 'America/Belem',
+ 'America/Belize',
+ 'America/Blanc-Sablon',
+ 'America/Boa_Vista',
+ 'America/Bogota',
+ 'America/Boise',
+ 'America/Buenos_Aires',
+ 'America/Cambridge_Bay',
+ 'America/Campo_Grande',
+ 'America/Cancun',
+ 'America/Caracas',
+ 'America/Catamarca',
+ 'America/Cayenne',
+ 'America/Cayman',
+ 'America/Chicago',
+ 'America/Chihuahua',
+ 'America/Coral_Harbour',
+ 'America/Cordoba',
+ 'America/Costa_Rica',
+ 'America/Cuiaba',
+ 'America/Curacao',
+ 'America/Danmarkshavn',
+ 'America/Dawson',
+ 'America/Dawson_Creek',
+ 'America/Denver',
+ 'America/Detroit',
+ 'America/Dominica',
+ 'America/Edmonton',
+ 'America/Eirunepe',
+ 'America/El_Salvador',
+ 'America/Ensenada',
+ 'America/Fort_Wayne',
+ 'America/Fortaleza',
+ 'America/Glace_Bay',
+ 'America/Godthab',
+ 'America/Goose_Bay',
+ 'America/Grand_Turk',
+ 'America/Grenada',
+ 'America/Guadeloupe',
+ 'America/Guatemala',
+ 'America/Guayaquil',
+ 'America/Guyana',
+ 'America/Halifax',
+ 'America/Havana',
+ 'America/Hermosillo',
+ 'America/Indianapolis',
+ 'America/Inuvik',
+ 'America/Iqaluit',
+ 'America/Jamaica',
+ 'America/Jujuy',
+ 'America/Juneau',
+ 'America/Knox_IN',
+ 'America/La_Paz',
+ 'America/Lima',
+ 'America/Los_Angeles',
+ 'America/Louisville',
+ 'America/Maceio',
+ 'America/Managua',
+ 'America/Manaus',
+ 'America/Marigot',
+ 'America/Martinique',
+ 'America/Mazatlan',
+ 'America/Mendoza',
+ 'America/Menominee',
+ 'America/Merida',
+ 'America/Mexico_City',
+ 'America/Miquelon',
+ 'America/Moncton',
+ 'America/Monterrey',
+ 'America/Montevideo',
+ 'America/Montreal',
+ 'America/Montserrat',
+ 'America/Nassau',
+ 'America/New_York',
+ 'America/Nipigon',
+ 'America/Nome',
+ 'America/Noronha',
+ 'America/Panama',
+ 'America/Pangnirtung',
+ 'America/Paramaribo',
+ 'America/Phoenix',
+ 'America/Port-au-Prince',
+ 'America/Port_of_Spain',
+ 'America/Porto_Acre',
+ 'America/Porto_Velho',
+ 'America/Puerto_Rico',
+ 'America/Rainy_River',
+ 'America/Rankin_Inlet',
+ 'America/Recife',
+ 'America/Regina',
+ 'America/Resolute',
+ 'America/Rio_Branco',
+ 'America/Rosario',
+ 'America/Santiago',
+ 'America/Santo_Domingo',
+ 'America/Sao_Paulo',
+ 'America/Scoresbysund',
+ 'America/Shiprock',
+ 'America/St_Barthelemy',
+ 'America/St_Johns',
+ 'America/St_Kitts',
+ 'America/St_Lucia',
+ 'America/St_Thomas',
+ 'America/St_Vincent',
+ 'America/Swift_Current',
+ 'America/Tegucigalpa',
+ 'America/Thule',
+ 'America/Thunder_Bay',
+ 'America/Tijuana',
+ 'America/Toronto',
+ 'America/Tortola',
+ 'America/Vancouver',
+ 'America/Virgin',
+ 'America/Whitehorse',
+ 'America/Winnipeg',
+ 'America/Yakutat',
+ 'America/Yellowknife',
+ 'Antarctica/Casey',
+ 'Antarctica/Davis',
+ 'Antarctica/DumontDUrville',
+ 'Antarctica/Mawson',
+ 'Antarctica/McMurdo',
+ 'Antarctica/Palmer',
+ 'Antarctica/Rothera',
+ 'Antarctica/South_Pole',
+ 'Antarctica/Syowa',
+ 'Antarctica/Vostok',
+ 'Arctic/Longyearbyen',
+ 'Asia/Aden',
+ 'Asia/Almaty',
+ 'Asia/Amman',
+ 'Asia/Anadyr',
+ 'Asia/Aqtau',
+ 'Asia/Aqtobe',
+ 'Asia/Ashgabat',
+ 'Asia/Ashkhabad',
+ 'Asia/Baghdad',
+ 'Asia/Bahrain',
+ 'Asia/Baku',
+ 'Asia/Bangkok',
+ 'Asia/Beirut',
+ 'Asia/Bishkek',
+ 'Asia/Brunei',
+ 'Asia/Calcutta',
+ 'Asia/Choibalsan',
+ 'Asia/Chongqing',
+ 'Asia/Chungking',
+ 'Asia/Colombo',
+ 'Asia/Dacca',
+ 'Asia/Damascus',
+ 'Asia/Dhaka',
+ 'Asia/Dili',
+ 'Asia/Dubai',
+ 'Asia/Dushanbe',
+ 'Asia/Gaza',
+ 'Asia/Harbin',
+ 'Asia/Ho_Chi_Minh',
+ 'Asia/Hong_Kong',
+ 'Asia/Hovd',
+ 'Asia/Irkutsk',
+ 'Asia/Istanbul',
+ 'Asia/Jakarta',
+ 'Asia/Jayapura',
+ 'Asia/Jerusalem',
+ 'Asia/Kabul',
+ 'Asia/Kamchatka',
+ 'Asia/Karachi',
+ 'Asia/Kashgar',
+ 'Asia/Katmandu',
+ 'Asia/Kolkata',
+ 'Asia/Krasnoyarsk',
+ 'Asia/Kuala_Lumpur',
+ 'Asia/Kuching',
+ 'Asia/Kuwait',
+ 'Asia/Macao',
+ 'Asia/Macau',
+ 'Asia/Magadan',
+ 'Asia/Makassar',
+ 'Asia/Manila',
+ 'Asia/Muscat',
+ 'Asia/Nicosia',
+ 'Asia/Novosibirsk',
+ 'Asia/Omsk',
+ 'Asia/Oral',
+ 'Asia/Phnom_Penh',
+ 'Asia/Pontianak',
+ 'Asia/Pyongyang',
+ 'Asia/Qatar',
+ 'Asia/Qyzylorda',
+ 'Asia/Rangoon',
+ 'Asia/Riyadh',
+ 'Asia/Saigon',
+ 'Asia/Sakhalin',
+ 'Asia/Samarkand',
+ 'Asia/Seoul',
+ 'Asia/Shanghai',
+ 'Asia/Singapore',
+ 'Asia/Taipei',
+ 'Asia/Tashkent',
+ 'Asia/Tbilisi',
+ 'Asia/Tehran',
+ 'Asia/Tel_Aviv',
+ 'Asia/Thimbu',
+ 'Asia/Thimphu',
+ 'Asia/Tokyo',
+ 'Asia/Ujung_Pandang',
+ 'Asia/Ulaanbaatar',
+ 'Asia/Ulan_Bator',
+ 'Asia/Urumqi',
+ 'Asia/Vientiane',
+ 'Asia/Vladivostok',
+ 'Asia/Yakutsk',
+ 'Asia/Yekaterinburg',
+ 'Asia/Yerevan',
+ 'Atlantic/Azores',
+ 'Atlantic/Bermuda',
+ 'Atlantic/Canary',
+ 'Atlantic/Cape_Verde',
+ 'Atlantic/Faeroe',
+ 'Atlantic/Faroe',
+ 'Atlantic/Jan_Mayen',
+ 'Atlantic/Madeira',
+ 'Atlantic/Reykjavik',
+ 'Atlantic/South_Georgia',
+ 'Atlantic/St_Helena',
+ 'Atlantic/Stanley',
+ 'Australia/ACT',
+ 'Australia/Adelaide',
+ 'Australia/Brisbane',
+ 'Australia/Broken_Hill',
+ 'Australia/Canberra',
+ 'Australia/Currie',
+ 'Australia/Darwin',
+ 'Australia/Eucla',
+ 'Australia/Hobart',
+ 'Australia/LHI',
+ 'Australia/Lindeman',
+ 'Australia/Lord_Howe',
+ 'Australia/Melbourne',
+ 'Australia/NSW',
+ 'Australia/North',
+ 'Australia/Perth',
+ 'Australia/Queensland',
+ 'Australia/South',
+ 'Australia/Sydney',
+ 'Australia/Tasmania',
+ 'Australia/Victoria',
+ 'Australia/West',
+ 'Australia/Yancowinna',
+ 'Brazil/Acre',
+ 'Brazil/DeNoronha',
+ 'Brazil/East',
+ 'Brazil/West',
+ 'Canada/Atlantic',
+ 'Canada/Central',
+ 'Canada/East-Saskatchewan',
+ 'Canada/Eastern',
+ 'Canada/Mountain',
+ 'Canada/Newfoundland',
+ 'Canada/Pacific',
+ 'Canada/Saskatchewan',
+ 'Canada/Yukon',
+ 'Chile/Continental',
+ 'Chile/EasterIsland',
+ 'Europe/Amsterdam',
+ 'Europe/Andorra',
+ 'Europe/Athens',
+ 'Europe/Belfast',
+ 'Europe/Belgrade',
+ 'Europe/Berlin',
+ 'Europe/Bratislava',
+ 'Europe/Brussels',
+ 'Europe/Bucharest',
+ 'Europe/Budapest',
+ 'Europe/Chisinau',
+ 'Europe/Copenhagen',
+ 'Europe/Dublin',
+ 'Europe/Gibraltar',
+ 'Europe/Guernsey',
+ 'Europe/Helsinki',
+ 'Europe/Isle_of_Man',
+ 'Europe/Istanbul',
+ 'Europe/Jersey',
+ 'Europe/Kaliningrad',
+ 'Europe/Kiev',
+ 'Europe/Lisbon',
+ 'Europe/Ljubljana',
+ 'Europe/London',
+ 'Europe/Luxembourg',
+ 'Europe/Madrid',
+ 'Europe/Malta',
+ 'Europe/Mariehamn',
+ 'Europe/Minsk',
+ 'Europe/Monaco',
+ 'Europe/Moscow',
+ 'Europe/Nicosia',
+ 'Europe/Oslo',
+ 'Europe/Paris',
+ 'Europe/Podgorica',
+ 'Europe/Prague',
+ 'Europe/Riga',
+ 'Europe/Rome',
+ 'Europe/Samara',
+ 'Europe/San_Marino',
+ 'Europe/Sarajevo',
+ 'Europe/Simferopol',
+ 'Europe/Skopje',
+ 'Europe/Sofia',
+ 'Europe/Stockholm',
+ 'Europe/Tallinn',
+ 'Europe/Tirane',
+ 'Europe/Tiraspol',
+ 'Europe/Uzhgorod',
+ 'Europe/Vaduz',
+ 'Europe/Vatican',
+ 'Europe/Vienna',
+ 'Europe/Vilnius',
+ 'Europe/Volgograd',
+ 'Europe/Warsaw',
+ 'Europe/Zagreb',
+ 'Europe/Zaporozhye',
+ 'Europe/Zurich',
+ 'GMT',
+ 'Indian/Antananarivo',
+ 'Indian/Chagos',
+ 'Indian/Christmas',
+ 'Indian/Cocos',
+ 'Indian/Comoro',
+ 'Indian/Kerguelen',
+ 'Indian/Mahe',
+ 'Indian/Maldives',
+ 'Indian/Mauritius',
+ 'Indian/Mayotte',
+ 'Indian/Reunion',
+ 'Mexico/BajaNorte',
+ 'Mexico/BajaSur',
+ 'Mexico/General',
+ 'Pacific/Apia',
+ 'Pacific/Auckland',
+ 'Pacific/Chatham',
+ 'Pacific/Easter',
+ 'Pacific/Efate',
+ 'Pacific/Enderbury',
+ 'Pacific/Fakaofo',
+ 'Pacific/Fiji',
+ 'Pacific/Funafuti',
+ 'Pacific/Galapagos',
+ 'Pacific/Gambier',
+ 'Pacific/Guadalcanal',
+ 'Pacific/Guam',
+ 'Pacific/Honolulu',
+ 'Pacific/Johnston',
+ 'Pacific/Kiritimati',
+ 'Pacific/Kosrae',
+ 'Pacific/Kwajalein',
+ 'Pacific/Majuro',
+ 'Pacific/Marquesas',
+ 'Pacific/Midway',
+ 'Pacific/Nauru',
+ 'Pacific/Niue',
+ 'Pacific/Norfolk',
+ 'Pacific/Noumea',
+ 'Pacific/Pago_Pago',
+ 'Pacific/Palau',
+ 'Pacific/Pitcairn',
+ 'Pacific/Ponape',
+ 'Pacific/Port_Moresby',
+ 'Pacific/Rarotonga',
+ 'Pacific/Saipan',
+ 'Pacific/Samoa',
+ 'Pacific/Tahiti',
+ 'Pacific/Tarawa',
+ 'Pacific/Tongatapu',
+ 'Pacific/Truk',
+ 'Pacific/Wake',
+ 'Pacific/Wallis',
+ 'Pacific/Yap',
+ 'US/Alaska',
+ 'US/Aleutian',
+ 'US/Arizona',
+ 'US/Central',
+ 'US/East-Indiana',
+ 'US/Eastern',
+ 'US/Hawaii',
+ 'US/Indiana-Starke',
+ 'US/Michigan',
+ 'US/Mountain',
+ 'US/Pacific',
+ 'US/Pacific-New',
+ 'US/Samoa',
+ 'UTC']
+common_timezones_set = set(common_timezones)
+
+all_timezones = \
+['Africa/Abidjan',
+ 'Africa/Accra',
+ 'Africa/Addis_Ababa',
+ 'Africa/Algiers',
+ 'Africa/Asmara',
+ 'Africa/Asmera',
+ 'Africa/Bamako',
+ 'Africa/Bangui',
+ 'Africa/Banjul',
+ 'Africa/Bissau',
+ 'Africa/Blantyre',
+ 'Africa/Brazzaville',
+ 'Africa/Bujumbura',
+ 'Africa/Cairo',
+ 'Africa/Casablanca',
+ 'Africa/Ceuta',
+ 'Africa/Conakry',
+ 'Africa/Dakar',
+ 'Africa/Dar_es_Salaam',
+ 'Africa/Djibouti',
+ 'Africa/Douala',
+ 'Africa/El_Aaiun',
+ 'Africa/Freetown',
+ 'Africa/Gaborone',
+ 'Africa/Harare',
+ 'Africa/Johannesburg',
+ 'Africa/Kampala',
+ 'Africa/Khartoum',
+ 'Africa/Kigali',
+ 'Africa/Kinshasa',
+ 'Africa/Lagos',
+ 'Africa/Libreville',
+ 'Africa/Lome',
+ 'Africa/Luanda',
+ 'Africa/Lubumbashi',
+ 'Africa/Lusaka',
+ 'Africa/Malabo',
+ 'Africa/Maputo',
+ 'Africa/Maseru',
+ 'Africa/Mbabane',
+ 'Africa/Mogadishu',
+ 'Africa/Monrovia',
+ 'Africa/Nairobi',
+ 'Africa/Ndjamena',
+ 'Africa/Niamey',
+ 'Africa/Nouakchott',
+ 'Africa/Ouagadougou',
+ 'Africa/Porto-Novo',
+ 'Africa/Sao_Tome',
+ 'Africa/Timbuktu',
+ 'Africa/Tripoli',
+ 'Africa/Tunis',
+ 'Africa/Windhoek',
+ 'America/Adak',
+ 'America/Anchorage',
+ 'America/Anguilla',
+ 'America/Antigua',
+ 'America/Araguaina',
+ 'America/Argentina/Buenos_Aires',
+ 'America/Argentina/Catamarca',
+ 'America/Argentina/ComodRivadavia',
+ 'America/Argentina/Cordoba',
+ 'America/Argentina/Jujuy',
+ 'America/Argentina/La_Rioja',
+ 'America/Argentina/Mendoza',
+ 'America/Argentina/Rio_Gallegos',
+ 'America/Argentina/San_Juan',
+ 'America/Argentina/San_Luis',
+ 'America/Argentina/Tucuman',
+ 'America/Argentina/Ushuaia',
+ 'America/Aruba',
+ 'America/Asuncion',
+ 'America/Atikokan',
+ 'America/Atka',
+ 'America/Bahia',
+ 'America/Barbados',
+ 'America/Belem',
+ 'America/Belize',
+ 'America/Blanc-Sablon',
+ 'America/Boa_Vista',
+ 'America/Bogota',
+ 'America/Boise',
+ 'America/Buenos_Aires',
+ 'America/Cambridge_Bay',
+ 'America/Campo_Grande',
+ 'America/Cancun',
+ 'America/Caracas',
+ 'America/Catamarca',
+ 'America/Cayenne',
+ 'America/Cayman',
+ 'America/Chicago',
+ 'America/Chihuahua',
+ 'America/Coral_Harbour',
+ 'America/Cordoba',
+ 'America/Costa_Rica',
+ 'America/Cuiaba',
+ 'America/Curacao',
+ 'America/Danmarkshavn',
+ 'America/Dawson',
+ 'America/Dawson_Creek',
+ 'America/Denver',
+ 'America/Detroit',
+ 'America/Dominica',
+ 'America/Edmonton',
+ 'America/Eirunepe',
+ 'America/El_Salvador',
+ 'America/Ensenada',
+ 'America/Fort_Wayne',
+ 'America/Fortaleza',
+ 'America/Glace_Bay',
+ 'America/Godthab',
+ 'America/Goose_Bay',
+ 'America/Grand_Turk',
+ 'America/Grenada',
+ 'America/Guadeloupe',
+ 'America/Guatemala',
+ 'America/Guayaquil',
+ 'America/Guyana',
+ 'America/Halifax',
+ 'America/Havana',
+ 'America/Hermosillo',
+ 'America/Indiana/Indianapolis',
+ 'America/Indiana/Knox',
+ 'America/Indiana/Marengo',
+ 'America/Indiana/Petersburg',
+ 'America/Indiana/Tell_City',
+ 'America/Indiana/Vevay',
+ 'America/Indiana/Vincennes',
+ 'America/Indiana/Winamac',
+ 'America/Indianapolis',
+ 'America/Inuvik',
+ 'America/Iqaluit',
+ 'America/Jamaica',
+ 'America/Jujuy',
+ 'America/Juneau',
+ 'America/Kentucky/Louisville',
+ 'America/Kentucky/Monticello',
+ 'America/Knox_IN',
+ 'America/La_Paz',
+ 'America/Lima',
+ 'America/Los_Angeles',
+ 'America/Louisville',
+ 'America/Maceio',
+ 'America/Managua',
+ 'America/Manaus',
+ 'America/Marigot',
+ 'America/Martinique',
+ 'America/Mazatlan',
+ 'America/Mendoza',
+ 'America/Menominee',
+ 'America/Merida',
+ 'America/Mexico_City',
+ 'America/Miquelon',
+ 'America/Moncton',
+ 'America/Monterrey',
+ 'America/Montevideo',
+ 'America/Montreal',
+ 'America/Montserrat',
+ 'America/Nassau',
+ 'America/New_York',
+ 'America/Nipigon',
+ 'America/Nome',
+ 'America/Noronha',
+ 'America/North_Dakota/Center',
+ 'America/North_Dakota/New_Salem',
+ 'America/Panama',
+ 'America/Pangnirtung',
+ 'America/Paramaribo',
+ 'America/Phoenix',
+ 'America/Port-au-Prince',
+ 'America/Port_of_Spain',
+ 'America/Porto_Acre',
+ 'America/Porto_Velho',
+ 'America/Puerto_Rico',
+ 'America/Rainy_River',
+ 'America/Rankin_Inlet',
+ 'America/Recife',
+ 'America/Regina',
+ 'America/Resolute',
+ 'America/Rio_Branco',
+ 'America/Rosario',
+ 'America/Santiago',
+ 'America/Santo_Domingo',
+ 'America/Sao_Paulo',
+ 'America/Scoresbysund',
+ 'America/Shiprock',
+ 'America/St_Barthelemy',
+ 'America/St_Johns',
+ 'America/St_Kitts',
+ 'America/St_Lucia',
+ 'America/St_Thomas',
+ 'America/St_Vincent',
+ 'America/Swift_Current',
+ 'America/Tegucigalpa',
+ 'America/Thule',
+ 'America/Thunder_Bay',
+ 'America/Tijuana',
+ 'America/Toronto',
+ 'America/Tortola',
+ 'America/Vancouver',
+ 'America/Virgin',
+ 'America/Whitehorse',
+ 'America/Winnipeg',
+ 'America/Yakutat',
+ 'America/Yellowknife',
+ 'Antarctica/Casey',
+ 'Antarctica/Davis',
+ 'Antarctica/DumontDUrville',
+ 'Antarctica/Mawson',
+ 'Antarctica/McMurdo',
+ 'Antarctica/Palmer',
+ 'Antarctica/Rothera',
+ 'Antarctica/South_Pole',
+ 'Antarctica/Syowa',
+ 'Antarctica/Vostok',
+ 'Arctic/Longyearbyen',
+ 'Asia/Aden',
+ 'Asia/Almaty',
+ 'Asia/Amman',
+ 'Asia/Anadyr',
+ 'Asia/Aqtau',
+ 'Asia/Aqtobe',
+ 'Asia/Ashgabat',
+ 'Asia/Ashkhabad',
+ 'Asia/Baghdad',
+ 'Asia/Bahrain',
+ 'Asia/Baku',
+ 'Asia/Bangkok',
+ 'Asia/Beirut',
+ 'Asia/Bishkek',
+ 'Asia/Brunei',
+ 'Asia/Calcutta',
+ 'Asia/Choibalsan',
+ 'Asia/Chongqing',
+ 'Asia/Chungking',
+ 'Asia/Colombo',
+ 'Asia/Dacca',
+ 'Asia/Damascus',
+ 'Asia/Dhaka',
+ 'Asia/Dili',
+ 'Asia/Dubai',
+ 'Asia/Dushanbe',
+ 'Asia/Gaza',
+ 'Asia/Harbin',
+ 'Asia/Ho_Chi_Minh',
+ 'Asia/Hong_Kong',
+ 'Asia/Hovd',
+ 'Asia/Irkutsk',
+ 'Asia/Istanbul',
+ 'Asia/Jakarta',
+ 'Asia/Jayapura',
+ 'Asia/Jerusalem',
+ 'Asia/Kabul',
+ 'Asia/Kamchatka',
+ 'Asia/Karachi',
+ 'Asia/Kashgar',
+ 'Asia/Katmandu',
+ 'Asia/Kolkata',
+ 'Asia/Krasnoyarsk',
+ 'Asia/Kuala_Lumpur',
+ 'Asia/Kuching',
+ 'Asia/Kuwait',
+ 'Asia/Macao',
+ 'Asia/Macau',
+ 'Asia/Magadan',
+ 'Asia/Makassar',
+ 'Asia/Manila',
+ 'Asia/Muscat',
+ 'Asia/Nicosia',
+ 'Asia/Novosibirsk',
+ 'Asia/Omsk',
+ 'Asia/Oral',
+ 'Asia/Phnom_Penh',
+ 'Asia/Pontianak',
+ 'Asia/Pyongyang',
+ 'Asia/Qatar',
+ 'Asia/Qyzylorda',
+ 'Asia/Rangoon',
+ 'Asia/Riyadh',
+ 'Asia/Saigon',
+ 'Asia/Sakhalin',
+ 'Asia/Samarkand',
+ 'Asia/Seoul',
+ 'Asia/Shanghai',
+ 'Asia/Singapore',
+ 'Asia/Taipei',
+ 'Asia/Tashkent',
+ 'Asia/Tbilisi',
+ 'Asia/Tehran',
+ 'Asia/Tel_Aviv',
+ 'Asia/Thimbu',
+ 'Asia/Thimphu',
+ 'Asia/Tokyo',
+ 'Asia/Ujung_Pandang',
+ 'Asia/Ulaanbaatar',
+ 'Asia/Ulan_Bator',
+ 'Asia/Urumqi',
+ 'Asia/Vientiane',
+ 'Asia/Vladivostok',
+ 'Asia/Yakutsk',
+ 'Asia/Yekaterinburg',
+ 'Asia/Yerevan',
+ 'Atlantic/Azores',
+ 'Atlantic/Bermuda',
+ 'Atlantic/Canary',
+ 'Atlantic/Cape_Verde',
+ 'Atlantic/Faeroe',
+ 'Atlantic/Faroe',
+ 'Atlantic/Jan_Mayen',
+ 'Atlantic/Madeira',
+ 'Atlantic/Reykjavik',
+ 'Atlantic/South_Georgia',
+ 'Atlantic/St_Helena',
+ 'Atlantic/Stanley',
+ 'Australia/ACT',
+ 'Australia/Adelaide',
+ 'Australia/Brisbane',
+ 'Australia/Broken_Hill',
+ 'Australia/Canberra',
+ 'Australia/Currie',
+ 'Australia/Darwin',
+ 'Australia/Eucla',
+ 'Australia/Hobart',
+ 'Australia/LHI',
+ 'Australia/Lindeman',
+ 'Australia/Lord_Howe',
+ 'Australia/Melbourne',
+ 'Australia/NSW',
+ 'Australia/North',
+ 'Australia/Perth',
+ 'Australia/Queensland',
+ 'Australia/South',
+ 'Australia/Sydney',
+ 'Australia/Tasmania',
+ 'Australia/Victoria',
+ 'Australia/West',
+ 'Australia/Yancowinna',
+ 'Brazil/Acre',
+ 'Brazil/DeNoronha',
+ 'Brazil/East...
[truncated message content] |
|
From: <jd...@us...> - 2008-09-18 13:14:23
|
Revision: 6107
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6107&view=rev
Author: jdh2358
Date: 2008-09-18 20:14:18 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
updating pytz and dateutil -- HEAD will be broken temporarily
Modified Paths:
--------------
trunk/matplotlib/lib/dateutil/NEWS
trunk/matplotlib/lib/dateutil/README
trunk/matplotlib/setup.py
Added Paths:
-----------
trunk/matplotlib/lib/dateutil/zoneinfo/zoneinfo-2008e.tar.gz
trunk/matplotlib/lib/pytz_old/
Removed Paths:
-------------
trunk/matplotlib/lib/dateutil/zoneinfo/zoneinfo-2007f.tar.gz
trunk/matplotlib/lib/pytz/
Modified: trunk/matplotlib/lib/dateutil/NEWS
===================================================================
--- trunk/matplotlib/lib/dateutil/NEWS 2008-09-18 13:09:01 UTC (rev 6106)
+++ trunk/matplotlib/lib/dateutil/NEWS 2008-09-18 20:14:18 UTC (rev 6107)
@@ -1,3 +1,49 @@
+Version 1.4.1
+-------------
+
+- Updated timezone information.
+
+
+Version 1.4
+-----------
+
+- Fixed another parser precision problem on conversion of decimal seconds
+ to microseconds, as reported by Erik Brown. Now these issues are gone
+ for real since it's not using floating point arithmetic anymore.
+
+- Fixed case where tzrange.utcoffset and tzrange.dst() might fail due
+ to a date being used where a datetime was expected (reported and fixed
+ by Lennart Regebro).
+
+- Prevent tzstr from introducing daylight timings in strings that didn't
+ specify them (reported by Lennart Regebro).
+
+- Calls like gettz("GMT+3") and gettz("UTC-2") will now return the
+ expected values, instead of the TZ variable behavior.
+
+- Fixed DST signal handling in zoneinfo files. Reported by
+ Nicholas F. Fabry and John-Mark Gurney.
+
+
+Version 1.3
+-----------
+
+- Fixed precision problem on conversion of decimal seconds to
+ microseconds, as reported by Skip Montanaro.
+
+- Fixed bug in constructor of parser, and converted parser classes to
+ new-style classes. Original report and patch by Michael Elsd\xF6rfer.
+
+- Initialize tzid and comps in tz.py, to prevent the code from ever
+ raising a NameError (even with broken files). Johan Dahlin suggested
+ the fix after a pyflakes run.
+
+- Version is now published in dateutil.__version__, as requested
+ by Darren Dale.
+
+- All code is compatible with new-style division.
+
+
Version 1.2
-----------
Modified: trunk/matplotlib/lib/dateutil/README
===================================================================
--- trunk/matplotlib/lib/dateutil/README 2008-09-18 13:09:01 UTC (rev 6106)
+++ trunk/matplotlib/lib/dateutil/README 2008-09-18 20:14:18 UTC (rev 6107)
@@ -1,13 +1,3 @@
-The dateutil module packaged with matplotlib is copied from
- http://labix.org/python-dateutil
-
-Do not make any changes in this copy of the code. They may be
-overwritten with the next update from the original source.
-
-Below is the original README text from the distribution.
-
------------------------------------------------------------------
-
## This file is in the moin format. The latest version is found
## at https://moin.conectiva.com.br/DateUtil
Property changes on: trunk/matplotlib/lib/dateutil/zoneinfo/zoneinfo-2008e.tar.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2008-09-18 13:09:01 UTC (rev 6106)
+++ trunk/matplotlib/setup.py 2008-09-18 20:14:18 UTC (rev 6107)
@@ -164,20 +164,19 @@
# only install pytz and dateutil if the user hasn't got them
def add_pytz():
- packages.append('pytz')
+ packages = ['pytz']
resources = ['zone.tab', 'locales/pytz.pot']
- # install pytz subdirs
- for dirpath, dirname, filenames in os.walk(os.path.join('lib', 'pytz',
- 'zoneinfo')):
+ for dirpath, dirnames, filenames in os.walk(os.path.join('pytz', 'zoneinfo')):
+ # remove the 'pytz' part of the path
if '.svn' not in dirpath:
- # remove the 'lib/pytz' part of the path
- basepath = dirpath.split(os.path.sep, 2)[2]
+ basepath = dirpath.split(os.path.sep, 1)[1]
resources.extend([os.path.join(basepath, filename)
for filename in filenames])
- package_data['pytz'] = resources
- assert len(resources) > 10, 'pytz zoneinfo files not found!'
-# packages.append('/'.join(dirpath.split(os.sep)[1:]))
+ package_data = {'pytz': resources}
+ assert len(resources) > 10, 'zoneinfo files not found!'
+
+
def add_dateutil():
packages.append('dateutil')
packages.append('dateutil/zoneinfo')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-09-18 06:09:12
|
Revision: 6106
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6106&view=rev
Author: mdboom
Date: 2008-09-18 13:09:01 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Fix interpolation in polar plots when theta values go negative. Thanks Jan Gillis for reporting.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/projections/polar.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-09-18 01:30:52 UTC (rev 6105)
+++ trunk/matplotlib/CHANGELOG 2008-09-18 13:09:01 UTC (rev 6106)
@@ -1,6 +1,8 @@
+2008-09-18 Fix polar interpolation to handle negative values of theta - MGD
+
2008-09-14 Reorganized cbook and mlab methods related to numerical
calculations that have little to do with the goals of those two
- modules into a separate module numerical_methods.py
+ modules into a separate module numerical_methods.py
Also, added ability to select points and stop point selection
with keyboard in ginput and manual contour labeling code.
Finally, fixed contour labeling bug. - DMK
Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-09-18 01:30:52 UTC (rev 6105)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-09-18 13:09:01 UTC (rev 6106)
@@ -56,6 +56,8 @@
def transform_path(self, path):
vertices = path.vertices
+ t = vertices[:, 0:1]
+ t[t != (npy.pi * 2.0)] %= (npy.pi * 2.0)
if len(vertices) == 2 and vertices[0, 0] == vertices[1, 0]:
return Path(self.transform(vertices), path.codes)
ipath = path.interpolated(self._resolution)
@@ -168,6 +170,7 @@
"""
self._rpad = 0.05
+ self.resolution = kwargs.pop('resolution', self.RESOLUTION)
Axes.__init__(self, *args, **kwargs)
self.set_aspect('equal', adjustable='box', anchor='C')
self.cla()
@@ -195,7 +198,7 @@
self.transScale = TransformWrapper(IdentityTransform())
# A (possibly non-linear) projection on the (already scaled) data
- self.transProjection = self.PolarTransform(self.RESOLUTION)
+ self.transProjection = self.PolarTransform(self.resolution)
# An affine transformation on the data, generally to limit the
# range of the axes
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-09-17 18:30:54
|
Revision: 6105
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6105&view=rev
Author: efiring
Date: 2008-09-18 01:30:52 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
validate num argument to figure()
Otherwise, the resulting exception can be obscure and delayed.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2008-09-18 00:49:15 UTC (rev 6104)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2008-09-18 01:30:52 UTC (rev 6105)
@@ -184,7 +184,7 @@
"""
call signature::
- figure(num = None, figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')
+ figure(num=None, figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')
Create a new figure and return a :class:`matplotlib.figure.Figure`
@@ -234,7 +234,10 @@
num = max(allnums) + 1
else:
num = 1
+ else:
+ num = int(num) # crude validation of num argument
+
figManager = _pylab_helpers.Gcf.get_fig_manager(num)
if figManager is None:
if get_backend().lower() == 'ps': dpi = 72
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-09-17 17:49:18
|
Revision: 6104
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6104&view=rev
Author: efiring
Date: 2008-09-18 00:49:15 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
More colorbar docstring improvements.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colorbar.py
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-09-17 22:19:20 UTC (rev 6103)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-09-18 00:49:15 UTC (rev 6104)
@@ -104,11 +104,11 @@
arguments:
*mappable*
- the :class:`matplotlib.image.Image`,
- :class:`matplotlib.contour.ContourSet`, etc. to
+ the :class:`~matplotlib.image.Image`,
+ :class:`~matplotlib.contour.ContourSet`, etc. to
which the colorbar applies; this argument is mandatory for the
- :meth:`matplotlib.figure.Figure.colorbar` method but optional for the
- :func:`matplotlib.pyplot.colorbar` function, which sets the
+ :meth:`~matplotlib.figure.Figure.colorbar` method but optional for the
+ :func:`~matplotlib.pyplot.colorbar` function, which sets the
default to the current image.
keyword arguments:
@@ -141,9 +141,10 @@
this case, do not use any of the axes properties kwargs.
returns:
- :class:`Colorbar` instance; see also its base class,
- :class:`ColorbarBase`. Call the :meth:`set_label` method
- to label the colorbar
+ :class:`~matplotlib.colorbar.Colorbar` instance; see also its base class,
+ :class:`~matplotlib.colorbar.ColorbarBase`. Call the
+ :meth:`~matplotlib.colorbar.ColorbarBase.set_label` method
+ to label the colorbar.
''' % (make_axes_kw_doc, colormap_kw_doc)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-09-17 15:19:24
|
Revision: 6103
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6103&view=rev
Author: efiring
Date: 2008-09-17 22:19:20 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
colorbar docstring improvements: work in progress
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colorbar.py
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-09-17 20:53:16 UTC (rev 6102)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-09-17 22:19:20 UTC (rev 6103)
@@ -13,9 +13,9 @@
a function for resizing an axes and adding a second axes
suitable for a colorbar
-The :meth:`matplotlib.Figure.colorbar` method uses :func:`make_axes`
-and :class:`Colorbar`; the :func:`matplotlib.pyplot.colorbar` function
-is a thin wrapper over :meth:`matplotlib.Figure.colorbar`.
+The :meth:`~matplotlib.figure.Figure.colorbar` method uses :func:`make_axes`
+and :class:`Colorbar`; the :func:`~matplotlib.pyplot.colorbar` function
+is a thin wrapper over :meth:`~matplotlib.figure.Figure.colorbar`.
'''
@@ -94,7 +94,7 @@
Function signatures for the :mod:`~matplotlib.pyplot` interface; all
but the first are also method signatures for the
-:meth:`matplotlib.Figure.colorbar` method::
+:meth:`~matplotlib.figure.Figure.colorbar` method::
colorbar(**kwargs)
colorbar(mappable, **kwargs)
@@ -104,9 +104,10 @@
arguments:
*mappable*
- the image, :class:`~matplotlib.contours.ContourSet`, etc. to
+ the :class:`matplotlib.image.Image`,
+ :class:`matplotlib.contour.ContourSet`, etc. to
which the colorbar applies; this argument is mandatory for the
- :meth:`matplotlib.Figure.colorbar` method but optional for the
+ :meth:`matplotlib.figure.Figure.colorbar` method but optional for the
:func:`matplotlib.pyplot.colorbar` function, which sets the
default to the current image.
@@ -126,7 +127,7 @@
colorbar properties:
%s
-If mappable is a :class:`~matplotlib.contours.ContourSet`, its *extend*
+If *mappable* is a :class:`~matplotlib.contours.ContourSet`, its *extend*
kwarg is included automatically.
Note that the *shrink* kwarg provides a simple way to keep a vertical
@@ -138,6 +139,12 @@
For more precise control, you can manually specify the positions of
the axes objects in which the mappable and the colorbar are drawn. In
this case, do not use any of the axes properties kwargs.
+
+returns:
+ :class:`Colorbar` instance; see also its base class,
+ :class:`ColorbarBase`. Call the :meth:`set_label` method
+ to label the colorbar
+
''' % (make_axes_kw_doc, colormap_kw_doc)
@@ -162,6 +169,19 @@
norm=colors.NoNorm.
+ Useful attributes:
+
+ :attr:`ax`
+ the Axes instance in which the colorbar is drawn
+
+ :attr:`lines`
+ a LineCollection if lines were drawn, otherwise None
+
+ :attr:`dividers`
+ a LineCollection if *drawedges* is True, otherwise None
+
+ Useful public methods are :meth:`set_label` and :meth:`add_lines`.
+
'''
_slice_dict = {'neither': slice(0,1000000),
'both': slice(1,-1),
@@ -196,6 +216,7 @@
self.filled = filled
self.solids = None
self.lines = None
+ self.dividers = None
self.set_label('')
if cbook.iterable(ticks):
self.locator = ticker.FixedLocator(ticks, nbins=len(ticks))
@@ -272,6 +293,9 @@
self.ax.set_xlabel(self._label, **self._labelkw)
def set_label(self, label, **kw):
+ '''
+ Label the long axis of the colorbar
+ '''
self._label = label
self._labelkw = kw
self._set_label()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-17 13:53:20
|
Revision: 6102
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6102&view=rev
Author: jdh2358
Date: 2008-09-17 20:53:16 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
committed Jae-Joons fancy box examples
Modified Paths:
--------------
trunk/matplotlib/examples/tests/backend_driver.py
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/fancybox_demo.py
trunk/matplotlib/examples/pylab_examples/fancytextbox_demo.py
Added: trunk/matplotlib/examples/pylab_examples/fancybox_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fancybox_demo.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/fancybox_demo.py 2008-09-17 20:53:16 UTC (rev 6102)
@@ -0,0 +1,171 @@
+import matplotlib.pyplot as plt
+import matplotlib.transforms as mtransforms
+from matplotlib.patches import FancyBboxPatch
+
+
+# Bbox object around which the fancy box will be drawn.
+bb = mtransforms.Bbox([[0.3, 0.4], [0.7, 0.6]])
+
+def draw_bbox(ax, bb):
+ # boxstyle=square with pad=0, i.e. bbox itself.
+ p_bbox = FancyBboxPatch((bb.xmin, bb.ymin),
+ abs(bb.width), abs(bb.height),
+ boxstyle="square,pad=0.",
+ ec="k", fc="none", zorder=10.,
+ )
+ ax.add_patch(p_bbox)
+
+def test1(ax):
+
+ # a fancy box with round corners. pad=0.1
+ p_fancy = FancyBboxPatch((bb.xmin, bb.ymin),
+ abs(bb.width), abs(bb.height),
+ boxstyle="round,pad=0.1",
+ fc=(1., .8, 1.),
+ ec=(1., 0.5, 1.))
+
+
+ ax.add_patch(p_fancy)
+
+ ax.text(0.1, 0.8,
+ r' boxstyle="round,pad=0.1"',
+ size=10, transform=ax.transAxes)
+
+ # draws control points for the fancy box.
+ #l = p_fancy.get_path().vertices
+ #ax.plot(l[:,0], l[:,1], ".")
+
+ # draw the original bbox in black
+ draw_bbox(ax, bb)
+
+
+def test2(ax):
+
+ # bbox=round has two optional argument. pad and rounding_size.
+ # They can be set during the initiallization.
+ p_fancy = FancyBboxPatch((bb.xmin, bb.ymin),
+ abs(bb.width), abs(bb.height),
+ boxstyle="round,pad=0.1",
+ fc=(1., .8, 1.),
+ ec=(1., 0.5, 1.))
+
+
+ ax.add_patch(p_fancy)
+
+ # boxstyle and its argument can be later modified with
+ # set_boxstyle method. Note that the old attributes are simply
+ # forgotten even if the boxstyle name is same.
+
+ p_fancy.set_boxstyle("round,pad=0.1, rounding_size=0.2")
+ #or
+ #p_fancy.set_boxstyle("round", pad=0.1, rounding_size=0.2)
+
+ ax.text(0.1, 0.8,
+ ' boxstyle="round,pad=0.1\n rounding\\_size=0.2"',
+ size=10, transform=ax.transAxes)
+
+ # draws control points for the fancy box.
+ #l = p_fancy.get_path().vertices
+ #ax.plot(l[:,0], l[:,1], ".")
+
+ draw_bbox(ax, bb)
+
+
+
+def test3(ax):
+
+ # mutation_scale determine overall scale of the mutation,
+ # i.e. both pad and rounding_size is scaled according to this
+ # value.
+ p_fancy = FancyBboxPatch((bb.xmin, bb.ymin),
+ abs(bb.width), abs(bb.height),
+ boxstyle="round,pad=0.1",
+ mutation_scale=2.,
+ fc=(1., .8, 1.),
+ ec=(1., 0.5, 1.))
+
+
+ ax.add_patch(p_fancy)
+
+ ax.text(0.1, 0.8,
+ ' boxstyle="round,pad=0.1"\n mutation\\_scale=2',
+ size=10, transform=ax.transAxes)
+
+ # draws control points for the fancy box.
+ #l = p_fancy.get_path().vertices
+ #ax.plot(l[:,0], l[:,1], ".")
+
+ draw_bbox(ax, bb)
+
+
+
+def test4(ax):
+
+ # When the aspect ratio of the axes is not 1, the fancy box may
+ # not be what you expected (green)
+
+ p_fancy = FancyBboxPatch((bb.xmin, bb.ymin),
+ abs(bb.width), abs(bb.height),
+ boxstyle="round,pad=0.2",
+ fc="none",
+ ec=(0., .5, 0.), zorder=4)
+
+
+ ax.add_patch(p_fancy)
+
+
+ # You can compensate this by setting the mutation_aspect (pink).
+ p_fancy = FancyBboxPatch((bb.xmin, bb.ymin),
+ abs(bb.width), abs(bb.height),
+ boxstyle="round,pad=0.3",
+ mutation_aspect=.5,
+ fc=(1., 0.8, 1.),
+ ec=(1., 0.5, 1.))
+
+
+ ax.add_patch(p_fancy)
+
+ ax.text(0.1, 0.8,
+ ' boxstyle="round,pad=0.3"\n mutation\\_aspect=.5',
+ size=10, transform=ax.transAxes)
+
+ draw_bbox(ax, bb)
+
+
+
+def test_all():
+ plt.clf()
+
+ ax = plt.subplot(2, 2, 1)
+ test1(ax)
+ ax.set_xlim(0., 1.)
+ ax.set_ylim(0., 1.)
+ ax.set_title("test1")
+ ax.set_aspect(1.)
+
+
+ ax = plt.subplot(2, 2, 2)
+ ax.set_title("test2")
+ test2(ax)
+ ax.set_xlim(0., 1.)
+ ax.set_ylim(0., 1.)
+ ax.set_aspect(1.)
+
+ ax = plt.subplot(2, 2, 3)
+ ax.set_title("test3")
+ test3(ax)
+ ax.set_xlim(0., 1.)
+ ax.set_ylim(0., 1.)
+ ax.set_aspect(1)
+
+ ax = plt.subplot(2, 2, 4)
+ ax.set_title("test4")
+ test4(ax)
+ ax.set_xlim(-0.5, 1.5)
+ ax.set_ylim(0., 1.)
+ ax.set_aspect(2.)
+
+ plt.draw()
+ plt.show()
+
+test_all()
Added: trunk/matplotlib/examples/pylab_examples/fancytextbox_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fancytextbox_demo.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/fancytextbox_demo.py 2008-09-17 20:53:16 UTC (rev 6102)
@@ -0,0 +1,21 @@
+import matplotlib.pyplot as plt
+
+plt.text(0.6, 0.5, "test", size=50, rotation=30.,
+ ha="center", va="center",
+ bbox = dict(boxstyle="round",
+ ec=(1., 0.5, 0.5),
+ fc=(1., 0.8, 0.8),
+ )
+ )
+
+plt.text(0.5, 0.4, "test", size=50, rotation=-30.,
+ ha="right", va="top",
+ bbox = dict(boxstyle="square",
+ ec=(1., 0.5, 0.5),
+ fc=(1., 0.8, 0.8),
+ )
+ )
+
+
+plt.draw()
+plt.show()
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-09-17 20:52:08 UTC (rev 6101)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-09-17 20:53:16 UTC (rev 6102)
@@ -52,6 +52,8 @@
'date_demo2.py',
'equal_aspect_ratio.py',
'errorbar_limits.py',
+ 'fancybox_demo.py',
+ 'fancytextbox_demo.py',
'figimage_demo.py',
'figlegend_demo.py',
'figure_title.py',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-17 13:52:13
|
Revision: 6101
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6101&view=rev
Author: jdh2358
Date: 2008-09-17 20:52:08 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
committed Jae-Joons facy box and textbox patch
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-09-17 15:47:02 UTC (rev 6100)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-09-17 20:52:08 UTC (rev 6101)
@@ -1270,3 +1270,429 @@
for k in ('Rectangle', 'Circle', 'RegularPolygon', 'Polygon', 'Wedge', 'Arrow',
'FancyArrow', 'YAArrow', 'CirclePolygon', 'Ellipse', 'Arc'):
artist.kwdocd[k] = patchdoc
+
+
+
+
+
+
+
+class BboxTransmuterBase(object):
+ """
+ Bbox Transmuter Base class
+
+ BBoxTransmuterBase and its derivatives are used to make a fancy box
+ around a given rectangle. The __call__ method returns the Path of
+ the fancy box. This class is not an artist and actual drawing of the
+ fancy box is done by the FancyBboxPatch class.
+
+ """
+
+ # The derived classes are required to be able to be initialized
+ # w/o arguments, i.e., all its argument (except self) must have
+ # the default values.
+
+ def __init__(self):
+ super(BboxTransmuterBase, self).__init__()
+
+
+
+
+ def transmute(self, x0, y0, width, height, mutation_size):
+ """
+ The transmute method is a very core of the BboxTransmuter class
+ and must be overriden in the subclasses. It receives the
+ location and size of the rectangle, and the mutation_size, with
+ which the amound padding and etc. will be scaled. It returns a
+ Path instance.
+ """
+ raise NotImplementedError('Derived must override')
+
+
+
+ def __call__(self, x0, y0, width, height, mutation_size,
+ aspect_ratio=1.):
+ """
+ The __call__ method a thin wrapper around the transmute method
+ and take care of the aspect.
+ """
+ if aspect_ratio is not None:
+ # Squeeze the given height by the aspect_ratio
+ y0, height = y0/aspect_ratio, height/aspect_ratio
+ # call transmute method with squeezed height.
+ path = self.transmute(x0, y0, width, height, mutation_size)
+ vertices, codes = path.vertices, path.codes
+ # Restore the height
+ vertices[:,1] = vertices[:,1] * aspect_ratio
+ return Path(vertices, codes)
+ else:
+ return self.transmute(x0, y0, width, height, mutation_size)
+
+
+
+class SquareBoxTransmuter(BboxTransmuterBase):
+ """
+ Simple square box.
+
+ 'pad' :an amount of padding.
+ """
+
+ def __init__(self, pad=0.3):
+ self.pad = pad
+ super(SquareBoxTransmuter, self).__init__()
+
+ def transmute(self, x0, y0, width, height, mutation_size):
+
+ # padding
+ pad = mutation_size * self.pad
+
+ # width and height with padding added.
+ width, height = width + 2.*pad, \
+ height + 2.*pad,
+
+ # boundary of the padded box
+ x0, y0 = x0-pad, y0-pad,
+ x1, y1 = x0+width, y0 + height
+
+ cp = [(x0, y0), (x1, y0), (x1, y1), (x0, y1),
+ (x0, y0), (x0, y0)]
+
+ com = [Path.MOVETO,
+ Path.LINETO,
+ Path.LINETO,
+ Path.LINETO,
+ Path.LINETO,
+ Path.CLOSEPOLY]
+
+ path = Path(cp, com)
+
+ return path
+
+
+class RoundBoxTransmuter(BboxTransmuterBase):
+ """
+ A box with round corners.
+ """
+
+ def __init__(self, pad=0.3, rounding_size=None):
+ self.pad = pad
+ self.rounding_size = rounding_size
+ BboxTransmuterBase.__init__(self)
+
+ def transmute(self, x0, y0, width, height, mutation_size):
+
+ # padding
+ pad = mutation_size * self.pad
+
+ # size of the roudning corner
+ if self.rounding_size:
+ dr = mutation_size * self.rounding_size
+ else:
+ dr = pad
+
+ width, height = width + 2.*pad, \
+ height + 2.*pad,
+
+
+ x0, y0 = x0-pad, y0-pad,
+ x1, y1 = x0+width, y0 + height
+
+ # Round corners are implemented as quadratic bezier. eg.
+ # [(x0, y0-dr), (x0, y0), (x0+dr, y0)] for lower left corner.
+ cp = [(x0+dr, y0),
+ (x1-dr, y0),
+ (x1, y0), (x1, y0+dr),
+ (x1, y1-dr),
+ (x1, y1), (x1-dr, y1),
+ (x0+dr, y1),
+ (x0, y1), (x0, y1-dr),
+ (x0, y0+dr),
+ (x0, y0), (x0+dr, y0),
+ (x0+dr, y0)]
+
+ com = [Path.MOVETO,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.CLOSEPOLY]
+
+ path = Path(cp, com)
+
+ return path
+
+
+
+def _list_available_boxstyles(transmuters):
+ """ a helper function of the FancyBboxPatch to list the available
+ box styles. It inspects the arguments of the __init__ methods of
+ each classes and report them
+ """
+ import inspect
+ s = []
+ for name, cls in transmuters.items():
+ args, varargs, varkw, defaults = inspect.getargspec(cls.__init__)
+ args_string = ["%s=%s" % (argname, str(argdefault)) \
+ for argname, argdefault in zip(args[1:], defaults)]
+ s.append(",".join([name]+args_string))
+ return s
+
+
+
+
+
+class FancyBboxPatch(Patch):
+ """
+ Draw a fancy box around a rectangle with lower left at *xy*=(*x*,
+ *y*) with specified width and height.
+
+ FancyBboxPatch class is similar to Rectangle class, but it draws a
+ fancy box around the rectangle. The transfomation of the rectangle
+ box to the fancy box is delgated to the BoxTransmuterBase and its
+ derived classes. The "boxstyle" argument determins what kind of
+ fancy box will be drawn. In other words, it selects the
+ BboxTransmuter class to use, and sets optional attributes. A
+ custom BboxTransmuter can be used with bbox_transmuter argument
+ (should be an instance, not a class). mutation_scale determines
+ the overall size of the mutation (by which I mean the
+ transformation of the rectangle to the fancy path) and the
+ mutation_aspect determines the aspect-ratio of the mutation.
+
+ """
+
+ _fancy_bbox_transmuters = {"square":SquareBoxTransmuter,
+ "round":RoundBoxTransmuter,
+ }
+
+ def __str__(self):
+ return self.__class__.__name__ \
+ + "FancyBboxPatch(%g,%g;%gx%g)" % (self._x, self._y, self._width, self._height)
+
+ def __init__(self, xy, width, height,
+ boxstyle="round",
+ bbox_transmuter=None,
+ mutation_scale=1.,
+ mutation_aspect=None,
+ **kwargs):
+ """
+ *xy*=lower left corner
+ *width*, *height*
+
+ The *boxstyle* describes how the fancy box will be drawn. It
+ should be one of the available boxstyle names, with optional
+ comma-separated attributes. These attributes are meant to be
+ scaled with the *mutation_scale*. Following box styles are
+ available.
+
+ %(AvailableBoxstyles)s
+
+ The boxstyle name can be "custom", in which case the
+ bbox_transmuter needs to be set, which should be an instance
+ of BboxTransmuterBase (or its derived).
+
+ *mutation_scale* : a value with which attributes of boxstyle
+ (e.g., pad) will be scaled. default=1.
+
+ *mutation_aspect* : The height of the rectangle will be
+ squeezed by this value before the mutation and the mutated
+ box will be stretched by the inverse of it. default=None.
+
+ Valid kwargs are:
+ %(Patch)s
+ """
+
+ Patch.__init__(self, **kwargs)
+
+ self._x = xy[0]
+ self._y = xy[1]
+ self._width = width
+ self._height = height
+
+ if boxstyle == "custom":
+ if bbox_transmuter is None:
+ raise ValueError("bbox_transmuter argument is needed with custom boxstyle")
+ self._bbox_transmuter = bbox_transmuter
+ else:
+ self.set_boxstyle(boxstyle)
+
+ self._mutation_scale=mutation_scale
+ self._mutation_aspect=mutation_aspect
+
+
+ kwdoc = dict()
+ kwdoc["AvailableBoxstyles"]="\n".join([" - " + l \
+ for l in _list_available_boxstyles(_fancy_bbox_transmuters)])
+ kwdoc.update(artist.kwdocd)
+ __init__.__doc__ = cbook.dedent(__init__.__doc__) % kwdoc
+ del kwdoc
+
+ def list_available_boxstyles(cls):
+ return _list_available_boxstyles(cls._fancy_bbox_transmuters)
+
+
+ def set_boxstyle(self, boxstyle=None, **kw):
+ """
+ Set the box style.
+
+ *boxstyle* can be a string with boxstyle name with optional
+ comma-separated attributes. Alternatively, the attrs can
+ be probided as kewords.
+
+ set_boxstyle("round,pad=0.2")
+ set_boxstyle("round", pad=0.2)
+
+ Olf attrs simply are forgotten.
+
+ Without argument (or with boxstyle=None), it prints out
+ available box styles.
+ """
+
+ if boxstyle==None:
+ # print out available boxstyles and return.
+ print " Following box styles are available."
+ for l in self.list_available_boxstyles():
+ print " - " + l
+ return
+
+ # parse the boxstyle descrption (e.g. "round,pad=0.3")
+ bs_list = boxstyle.replace(" ","").split(",")
+ boxstyle_name = bs_list[0]
+ try:
+ bbox_transmuter_cls = self._fancy_bbox_transmuters[boxstyle_name]
+ except KeyError:
+ raise ValueError("Unknown Boxstyle : %s" % boxstyle_name)
+ try:
+ boxstyle_args_pair = [bs.split("=") for bs in bs_list[1:]]
+ boxstyle_args = dict([(k, float(v)) for k, v in boxstyle_args_pair])
+ except ValueError:
+ raise ValueError("Incorrect Boxstyle argument : %s" % boxstyle)
+
+ boxstyle_args.update(kw)
+ self._bbox_transmuter = bbox_transmuter_cls(**boxstyle_args)
+
+
+ def set_mutation_scale(self, scale):
+ """
+ Set the mutation scale.
+
+ ACCEPTS: float
+ """
+ self._mutation_scale=scale
+
+ def get_mutation_scale(self):
+ """
+ Return the mutation scale.
+ """
+ return self._mutation_scale
+
+ def set_mutation_aspect(self, aspect):
+ """
+ Set the aspect ratio of the bbox mutation.
+
+ ACCEPTS: float
+ """
+ self._mutation_aspect=aspect
+
+ def get_mutation_aspect(self):
+ """
+ Return the aspect ratio of the bbox mutation.
+ """
+ return self._mutation_aspect
+
+ def set_bbox_transmuter(self, bbox_transmuter):
+ """
+ Set the transmuter object
+
+ ACCEPTS: BboxTransmuterBase (or its derivatives) instance
+ """
+ self._bbox_transmuter = bbox_transmuter
+
+ def get_bbox_transmuter(self):
+ "Return the current transmuter object"
+ return self._bbox_transmuter
+
+ def get_path(self):
+ """
+ Return the mutated path of the rectangle
+ """
+
+ _path = self.get_bbox_transmuter()(self._x, self._y,
+ self._width, self._height,
+ self.get_mutation_scale(),
+ self.get_mutation_aspect())
+ return _path
+
+
+ # Followong methods are borrowed from the Rectangle class.
+
+ def get_x(self):
+ "Return the left coord of the rectangle"
+ return self._x
+
+ def get_y(self):
+ "Return the bottom coord of the rectangle"
+ return self._y
+
+ def get_width(self):
+ "Return the width of the rectangle"
+ return self._width
+
+ def get_height(self):
+ "Return the height of the rectangle"
+ return self._height
+
+ def set_x(self, x):
+ """
+ Set the left coord of the rectangle
+
+ ACCEPTS: float
+ """
+ self._x = x
+
+ def set_y(self, y):
+ """
+ Set the bottom coord of the rectangle
+
+ ACCEPTS: float
+ """
+ self._y = y
+
+ def set_width(self, w):
+ """
+ Set the width rectangle
+
+ ACCEPTS: float
+ """
+ self._width = w
+
+ def set_height(self, h):
+ """
+ Set the width rectangle
+
+ ACCEPTS: float
+ """
+ self._height = h
+
+ def set_bounds(self, *args):
+ """
+ Set the bounds of the rectangle: l,b,w,h
+
+ ACCEPTS: (left, bottom, width, height)
+ """
+ if len(args)==0:
+ l,b,w,h = args[0]
+ else:
+ l,b,w,h = args
+ self._x = l
+ self._y = b
+ self._width = w
+ self._height = h
+
+
+ def get_bbox(self):
+ return transforms.Bbox.from_bounds(self._x, self._y, self._width, self._height)
+
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-09-17 15:47:02 UTC (rev 6100)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-09-17 20:52:08 UTC (rev 6101)
@@ -12,7 +12,8 @@
from artist import Artist
from cbook import is_string_like, maxdict
from font_manager import FontProperties
-from patches import bbox_artist, YAArrow
+from patches import bbox_artist, YAArrow, FancyBboxPatch
+import transforms as mtransforms
from transforms import Affine2D, Bbox
from lines import Line2D
@@ -77,6 +78,50 @@
========================== =========================================================================
"""
+
+
+
+# TODO : This function may move into the Text class as a method. As a
+# matter of fact, The information from the _get_textbox function
+# should be available during the Text._get_layout() call, which is
+# called within the _get_textbox. So, it would better to move this
+# function as a method with some refactoring of _get_layout method.
+
+def _get_textbox(text, renderer):
+ """
+ figure out the bounding box of the text. Unlike get_extents()
+ method, The bbox size of the text before the rotation is
+ calculated.
+ """
+
+ projected_xs = []
+ projected_ys = []
+
+ theta = text.get_rotation()/180.*math.pi
+ tr = mtransforms.Affine2D().rotate(-theta)
+
+ for t, wh, x, y in text._get_layout(renderer)[1]:
+ w, h = wh
+
+
+ xt1, yt1 = tr.transform_point((x, y))
+ xt2, yt2 = xt1+w, yt1+h
+
+ projected_xs.extend([xt1, xt2])
+ projected_ys.extend([yt1, yt2])
+
+
+ xt_box, yt_box = min(projected_xs), min(projected_ys)
+ w_box, h_box = max(projected_xs) - xt_box, max(projected_ys) - yt_box
+
+ tr = mtransforms.Affine2D().rotate(theta)
+
+ x_box, y_box = tr.transform_point((xt_box, yt_box))
+
+ return x_box, y_box, w_box, h_box
+
+
+
class Text(Artist):
"""
Handle storing and drawing of text in window or data coordinates
@@ -121,6 +166,7 @@
self._rotation = rotation
self._fontproperties = fontproperties
self._bbox = None
+ self._bbox_patch = None # a FanceBboxPatch instance
self._renderer = None
if linespacing is None:
linespacing = 1.2 # Maybe use rcParam later.
@@ -271,15 +317,65 @@
def set_bbox(self, rectprops):
"""
- Draw a bounding box around self. rect props are any settable
+ Draw a bounding box around self. rectprops are any settable
properties for a rectangle, eg facecolor='red', alpha=0.5.
t.set_bbox(dict(facecolor='red', alpha=0.5))
- ACCEPTS: rectangle prop dict plus key 'pad' which is a pad in points
+ If rectprops has "boxstyle" key. A FancyBboxPatch
+ is initiallized with rectprops and will be drawn. The mutation
+ scale of the FancyBboxPath is set to the fontsize.
+
+ ACCEPTS: rectangle prop dict plus key 'pad' which is a pad in
+ points. If "boxstyle" key exists, the input dictionary should
+ be a valid input for the FancyBboxPatch class.
+
"""
- self._bbox = rectprops
+ # The self._bbox_patch object is created only if rectprops has
+ # boxstyle key. Otherwise, self._bbox will be set to the
+ # rectprops and the bbox will be drawn using bbox_artist
+ # function. This is to keep the backward compatibility.
+
+ if rectprops is not None and rectprops.has_key("boxstyle"):
+ props = rectprops.copy()
+ boxstyle = props.pop("boxstyle")
+ bbox_transmuter = props.pop("bbox_transmuter", None)
+
+ self._bbox_patch = FancyBboxPatch((0., 0.),
+ 1., 1.,
+ boxstyle=boxstyle,
+ bbox_transmuter=bbox_transmuter,
+ transform=mtransforms.IdentityTransform(),
+ **props)
+ self._bbox = None
+ else:
+ self._bbox_patch = None
+ self._bbox = rectprops
+
+
+ def get_bbox_patch(self):
+ """
+ Retrun the bbox Patch object. Returns None if the the
+ FancyBboxPatch is not made.
+ """
+ return self._bbox_patch
+
+
+ def _draw_bbox(self, renderer, posx, posy):
+ """ Update the location and the size of the bbox, and draw.
+ """
+ x_box, y_box, w_box, h_box = _get_textbox(self, renderer)
+ self._bbox_patch.set_bounds(0., 0.,
+ w_box, h_box)
+ theta = self.get_rotation()/180.*math.pi
+ tr = mtransforms.Affine2D().rotate(theta)
+ tr = tr.translate(posx+x_box, posy+y_box)
+ self._bbox_patch.set_transform(tr)
+ self._bbox_patch.set_mutation_scale(self.get_size())
+ self._bbox_patch.draw(renderer)
+
+
def draw(self, renderer):
#return
if renderer is not None:
@@ -287,6 +383,22 @@
if not self.get_visible(): return
if self._text=='': return
+ bbox, info = self._get_layout(renderer)
+ trans = self.get_transform()
+
+
+ # don't use self.get_position here, which refers to text position
+ # in Text, and dash position in TextWithDash:
+ posx = float(self.convert_xunits(self._x))
+ posy = float(self.convert_yunits(self._y))
+
+ posx, posy = trans.transform_point((posx, posy))
+ canvasw, canvash = renderer.get_canvas_width_height()
+
+ # draw the FancyBboxPatch
+ if self._bbox_patch:
+ self._draw_bbox(renderer, posx, posy)
+
gc = renderer.new_gc()
gc.set_foreground(self._color)
gc.set_alpha(self._alpha)
@@ -297,17 +409,8 @@
bbox_artist(self, renderer, self._bbox)
angle = self.get_rotation()
- bbox, info = self._get_layout(renderer)
- trans = self.get_transform()
- # don't use self.get_position here, which refers to text position
- # in Text, and dash position in TextWithDash:
- posx = float(self.convert_xunits(self._x))
- posy = float(self.convert_yunits(self._y))
- posx, posy = trans.transform_point((posx, posy))
- canvasw, canvash = renderer.get_canvas_width_height()
-
if rcParams['text.usetex']:
for line, wh, x, y in info:
x = x + posx
@@ -401,7 +504,7 @@
return (x, y, self._text, self._color,
self._verticalalignment, self._horizontalalignment,
hash(self._fontproperties), self._rotation,
- self.figure.dpi, id(self._renderer),
+ self.figure.dpi, id(self._renderer),
)
def get_text(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jr...@us...> - 2008-09-17 08:47:07
|
Revision: 6100
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6100&view=rev
Author: jrevans
Date: 2008-09-17 15:47:02 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
The previous fix broke the current behaviour of being able to explicitly set a new unit type for a
specific axis after it was already set. This fixes that.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-09-17 02:10:58 UTC (rev 6099)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-09-17 15:47:02 UTC (rev 6100)
@@ -1391,11 +1391,17 @@
if xunits!=self.xaxis.units:
#print '\tkw setting xunits', xunits
self.xaxis.set_units(xunits)
+ # If the units being set imply a different converter, we need to update.
+ if xdata is not None:
+ self.xaxis.update_units(xdata)
yunits = kwargs.pop('yunits', self.yaxis.units)
if yunits!=self.yaxis.units:
#print '\tkw setting yunits', yunits
self.yaxis.set_units(yunits)
+ # If the units being set imply a different converter, we need to update.
+ if ydata is not None:
+ self.yaxis.update_units(ydata)
def in_axes(self, mouseevent):
'''
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-16 18:54:59
|
Revision: 6098
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6098&view=rev
Author: jdh2358
Date: 2008-09-17 01:54:56 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
added the renderer dpi to the cache key for text
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/font_manager.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/lib/matplotlib/font_manager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/font_manager.py 2008-09-15 23:09:24 UTC (rev 6097)
+++ trunk/matplotlib/lib/matplotlib/font_manager.py 2008-09-17 01:54:56 UTC (rev 6098)
@@ -955,7 +955,7 @@
fname = prop.get_file()
if fname is not None:
verbose.report('findfont returning %s'%fname, 'debug')
- return fname[0]
+ return fname
if fontext == 'afm':
fontdict = self.afmdict
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-09-15 23:09:24 UTC (rev 6097)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-09-17 01:54:56 UTC (rev 6098)
@@ -401,7 +401,7 @@
return (x, y, self._text, self._color,
self._verticalalignment, self._horizontalalignment,
hash(self._fontproperties), self._rotation,
- self.figure.dpi, id(self._renderer)
+ self.figure.dpi, id(self._renderer), self._renderer.dpi
)
def get_text(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jr...@us...> - 2008-09-15 16:09:28
|
Revision: 6097
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6097&view=rev
Author: jrevans
Date: 2008-09-15 23:09:24 +0000 (Mon, 15 Sep 2008)
Log Message:
-----------
Fixed contour to now properly strip away units for unitized data on the x and y axes.
Unit registry now properly determines the registered converter to use for nested array data types.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/lib/matplotlib/units.py
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2008-09-15 19:59:47 UTC (rev 6096)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2008-09-15 23:09:24 UTC (rev 6097)
@@ -724,8 +724,12 @@
Possible change: I think we should make and use an ArgumentError
Exception class (here and elsewhere).
'''
- x = np.asarray(args[0], dtype=np.float64)
- y = np.asarray(args[1], dtype=np.float64)
+ # We can strip away the x and y units
+ x = self.ax.convert_xunits( args[0] )
+ y = self.ax.convert_yunits( args[1] )
+
+ x = np.asarray(x, dtype=np.float64)
+ y = np.asarray(y, dtype=np.float64)
z = ma.asarray(args[2], dtype=np.float64)
if z.ndim != 2:
raise TypeError("Input z must be a 2D array.")
Modified: trunk/matplotlib/lib/matplotlib/units.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/units.py 2008-09-15 19:59:47 UTC (rev 6096)
+++ trunk/matplotlib/lib/matplotlib/units.py 2008-09-15 23:09:24 UTC (rev 6097)
@@ -128,12 +128,9 @@
if converter is None and iterable(x):
for thisx in x:
- classx = getattr(thisx, '__class__', None)
- break
- if classx is not None:
- converter = self.get(classx)
+ converter = self.get_converter( thisx )
+ if converter: break
-
#DISABLED self._cached[idx] = converter
return converter
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jr...@us...> - 2008-09-15 12:58:33
|
Revision: 6095
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6095&view=rev
Author: jrevans
Date: 2008-09-15 19:58:25 +0000 (Mon, 15 Sep 2008)
Log Message:
-----------
Fixed bug #1889750.
Now an axes will not attempt to determine the default units to use if units have already been determined for a particular Axis.
Previously, by doing this it would override any axis labels set whenever any unit determination calls were made. This can still happen, but now some of the unneccessary unit determination calls are no longer being made.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-09-14 19:18:54 UTC (rev 6094)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-09-15 19:58:25 UTC (rev 6095)
@@ -1374,11 +1374,15 @@
#print 'processing', self.get_geometry()
if xdata is not None:
- self.xaxis.update_units(xdata)
+ # we only need to update if there is nothing set yet.
+ if not self.xaxis.have_units():
+ self.xaxis.update_units(xdata)
#print '\tset from xdata', self.xaxis.units
if ydata is not None:
- self.yaxis.update_units(ydata)
+ # we only need to update if there is nothing set yet.
+ if not self.yaxis.have_units():
+ self.yaxis.update_units(ydata)
#print '\tset from ydata', self.yaxis.units
# process kwargs 2nd since these will override default units
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-09-14 19:18:57
|
Revision: 6094
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6094&view=rev
Author: jswhit
Date: 2008-09-14 19:18:54 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
cosmetic changes
Modified Paths:
--------------
trunk/toolkits/basemap/examples/randompoints.py
Modified: trunk/toolkits/basemap/examples/randompoints.py
===================================================================
--- trunk/toolkits/basemap/examples/randompoints.py 2008-09-14 15:40:05 UTC (rev 6093)
+++ trunk/toolkits/basemap/examples/randompoints.py 2008-09-14 19:18:54 UTC (rev 6094)
@@ -10,16 +10,16 @@
m = Basemap(lon_0=-105,boundinglat=30.,
resolution='l',area_thresh=10000.,projection='npstere')
# number of points to plot.
-npts = 750
+npts = 500
# generate random points on a sphere,
# so that every small area on the sphere is expected
# to have the same number of points.
# http://mathworld.wolfram.com/SpherePointPicking.html
u = uniform(0.,1.,size=npts)
v = uniform(0.,1.,size=npts)
-z = uniform(0,100,size=npts)
lons = 360.*u
lats = (180./np.pi)*np.arccos(2*v-1) - 90.
+z = uniform(0,100,size=npts) # this field controls color of dots.
# transform lons and lats to map coordinates.
x,y = m(lons,lats)
# plot them as filled circles on the map.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-13 17:07:41
|
Revision: 6092
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6092&view=rev
Author: jdh2358
Date: 2008-09-13 17:07:39 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
moved font examples to api
Added Paths:
-----------
trunk/matplotlib/examples/api/font_family_rc.py
trunk/matplotlib/examples/api/font_file.py
Removed Paths:
-------------
trunk/matplotlib/examples/pylab_examples/font_family_rc.py
trunk/matplotlib/examples/pylab_examples/font_file.py
Copied: trunk/matplotlib/examples/api/font_family_rc.py (from rev 6091, trunk/matplotlib/examples/pylab_examples/font_family_rc.py)
===================================================================
--- trunk/matplotlib/examples/api/font_family_rc.py (rev 0)
+++ trunk/matplotlib/examples/api/font_family_rc.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -0,0 +1,29 @@
+"""
+You can explicitly set which font family is picked up for a given font
+style (eg 'serif', 'sans-serif', or 'monospace').
+
+In the example below, we only allow one font family (Tahoma) for the
+san-serif font style. You the default family with the font.family rc
+param, eg::
+
+ rcParams['font.family'] = 'sans-serif'
+
+and for the font.family you set a list of font styles to try to find
+in order::
+
+ rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans', 'Lucida Grande', 'Verdana']
+
+
+"""
+from matplotlib import rcParams
+rcParams['font.family'] = 'sans-serif'
+rcParams['font.sans-serif'] = ['Tahoma']
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot([1,2,3], label='test')
+
+ax.legend()
+plt.show()
+
Copied: trunk/matplotlib/examples/api/font_file.py (from rev 6091, trunk/matplotlib/examples/pylab_examples/font_file.py)
===================================================================
--- trunk/matplotlib/examples/api/font_file.py (rev 0)
+++ trunk/matplotlib/examples/api/font_file.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -0,0 +1,18 @@
+"""
+Although it is usually not a good idea to explicitly point to a single
+ttf file for a font instance, you can do so using the
+font_manager.FontProperties fname argument (for a more flexible
+solution, see the font_fmaily_rc.py and fonts_demo.py examples).
+"""
+import matplotlib.font_manager as fm
+
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot([1,2,3])
+
+prop = fm.FontProperties(fname='/Library/Fonts/Tahoma.ttf')
+ax.set_title('this is a special font', fontproperties=prop)
+plt.show()
+
Deleted: trunk/matplotlib/examples/pylab_examples/font_family_rc.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/font_family_rc.py 2008-09-13 17:06:53 UTC (rev 6091)
+++ trunk/matplotlib/examples/pylab_examples/font_family_rc.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -1,29 +0,0 @@
-"""
-You can explicitly set which font family is picked up for a given font
-style (eg 'serif', 'sans-serif', or 'monospace').
-
-In the example below, we only allow one font family (Tahoma) for the
-san-serif font style. You the default family with the font.family rc
-param, eg::
-
- rcParams['font.family'] = 'sans-serif'
-
-and for the font.family you set a list of font styles to try to find
-in order::
-
- rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans', 'Lucida Grande', 'Verdana']
-
-
-"""
-from matplotlib import rcParams
-rcParams['font.family'] = 'sans-serif'
-rcParams['font.sans-serif'] = ['Tahoma']
-import matplotlib.pyplot as plt
-
-fig = plt.figure()
-ax = fig.add_subplot(111)
-ax.plot([1,2,3], label='test')
-
-ax.legend()
-plt.show()
-
Deleted: trunk/matplotlib/examples/pylab_examples/font_file.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/font_file.py 2008-09-13 17:06:53 UTC (rev 6091)
+++ trunk/matplotlib/examples/pylab_examples/font_file.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -1,18 +0,0 @@
-"""
-Although it is usually not a good idea to explicitly point to a single
-ttf file for a font instance, you can do so using the
-font_manager.FontProperties fname argument (for a more flexible
-solution, see the font_fmaily_rc.py and fonts_demo.py examples).
-"""
-import matplotlib.font_manager as fm
-
-import matplotlib.pyplot as plt
-
-fig = plt.figure()
-ax = fig.add_subplot(111)
-ax.plot([1,2,3])
-
-prop = fm.FontProperties(fname='/Library/Fonts/Tahoma.ttf')
-ax.set_title('this is a special font', fontproperties=prop)
-plt.show()
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-13 17:06:56
|
Revision: 6091
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6091&view=rev
Author: jdh2358
Date: 2008-09-13 17:06:53 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
added a couple of font examples
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/font_family_rc.py
trunk/matplotlib/examples/pylab_examples/font_file.py
Added: trunk/matplotlib/examples/pylab_examples/font_family_rc.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/font_family_rc.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/font_family_rc.py 2008-09-13 17:06:53 UTC (rev 6091)
@@ -0,0 +1,29 @@
+"""
+You can explicitly set which font family is picked up for a given font
+style (eg 'serif', 'sans-serif', or 'monospace').
+
+In the example below, we only allow one font family (Tahoma) for the
+san-serif font style. You the default family with the font.family rc
+param, eg::
+
+ rcParams['font.family'] = 'sans-serif'
+
+and for the font.family you set a list of font styles to try to find
+in order::
+
+ rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans', 'Lucida Grande', 'Verdana']
+
+
+"""
+from matplotlib import rcParams
+rcParams['font.family'] = 'sans-serif'
+rcParams['font.sans-serif'] = ['Tahoma']
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot([1,2,3], label='test')
+
+ax.legend()
+plt.show()
+
Added: trunk/matplotlib/examples/pylab_examples/font_file.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/font_file.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/font_file.py 2008-09-13 17:06:53 UTC (rev 6091)
@@ -0,0 +1,18 @@
+"""
+Although it is usually not a good idea to explicitly point to a single
+ttf file for a font instance, you can do so using the
+font_manager.FontProperties fname argument (for a more flexible
+solution, see the font_fmaily_rc.py and fonts_demo.py examples).
+"""
+import matplotlib.font_manager as fm
+
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot([1,2,3])
+
+prop = fm.FontProperties(fname='/Library/Fonts/Tahoma.ttf')
+ax.set_title('this is a special font', fontproperties=prop)
+plt.show()
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-13 15:35:59
|
Revision: 6090
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6090&view=rev
Author: jdh2358
Date: 2008-09-13 15:35:55 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
updated the wx animation examples
Added Paths:
-----------
trunk/matplotlib/examples/animation/simple_idle_wx.py
trunk/matplotlib/examples/animation/simple_timer_wx.py
Removed Paths:
-------------
trunk/matplotlib/examples/animation/dynamic_image_wxagg.py
trunk/matplotlib/examples/animation/simple_anim_wx.py
Deleted: trunk/matplotlib/examples/animation/dynamic_image_wxagg.py
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_image_wxagg.py 2008-09-13 14:28:09 UTC (rev 6089)
+++ trunk/matplotlib/examples/animation/dynamic_image_wxagg.py 2008-09-13 15:35:55 UTC (rev 6090)
@@ -1,100 +0,0 @@
-#!/usr/bin/env python
-"""
-Copyright (C) 2003-2004 Jeremy O'Donoghue and others
-
-License: This work is licensed under the PSF. A copy should be included
-with this source code, and is also available at
-http://www.python.org/psf/license.html
-
-"""
-import sys, time, os, gc
-
-import matplotlib
-matplotlib.use('WXAgg')
-
-from matplotlib import rcParams
-import matplotlib.cm as cm
-
-from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
-
-from matplotlib.figure import Figure
-import numpy as npy
-import wx
-
-
-TIMER_ID = wx.NewId()
-
-class PlotFigure(wx.Frame):
-
- def __init__(self):
- wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")
-
- self.fig = Figure((5,4), 75)
- self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
- self.toolbar = Toolbar(self.canvas)
- self.toolbar.Realize()
-
- # On Windows, default frame size behaviour is incorrect
- # you don't need this under Linux
- tw, th = self.toolbar.GetSizeTuple()
- fw, fh = self.canvas.GetSizeTuple()
- self.toolbar.SetSize(wx.Size(fw, th))
-
- # Initialise the timer - wxPython requires this to be connected to
- # the receiving event handler
- self.t = wx.Timer(self, TIMER_ID)
- self.t.Start(10)
-
- # Create a figure manager to manage things
-
- # Now put all into a sizer
- sizer = wx.BoxSizer(wx.VERTICAL)
- # This way of adding to sizer allows resizing
- sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
- # Best to allow the toolbar to resize!
- sizer.Add(self.toolbar, 0, wx.GROW)
- self.SetSizer(sizer)
- self.Fit()
- self.Bind(wx.EVT_TIMER, self.onTimer, id=TIMER_ID)
- self.Bind(wx.EVT_CLOSE, self.onClose)
-
- def init_plot_data(self):
- # jdh you can add a subplot directly from the fig rather than
- # the fig manager
- a = self.fig.add_subplot(111)
- self.x = npy.arange(120.0)*2*npy.pi/120.0
- self.x.resize((100,120))
- self.y = npy.arange(100.0)*2*npy.pi/100.0
- self.y.resize((120,100))
- self.y = npy.transpose(self.y)
- z = npy.sin(self.x) + npy.cos(self.y)
- self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
-
- def GetToolBar(self):
- # You will need to override GetToolBar if you are using an
- # unmanaged toolbar in your frame
- return self.toolbar
-
- def onTimer(self, evt):
- self.x += npy.pi/15
- self.y += npy.pi/20
- z = npy.sin(self.x) + npy.cos(self.y)
- self.im.set_array(z)
- self.canvas.draw()
- #self.canvas.gui_repaint() # jdh wxagg_draw calls this already
-
- def onClose(self, evt):
- self.t.Stop()
- evt.Skip()
-
- def onEraseBackground(self, evt):
- # this is supposed to prevent redraw flicker on some X servers...
- pass
-
-if __name__ == '__main__':
- app = wx.PySimpleApp()
- frame = PlotFigure()
- frame.init_plot_data()
-
- frame.Show()
- app.MainLoop()
Deleted: trunk/matplotlib/examples/animation/simple_anim_wx.py
===================================================================
--- trunk/matplotlib/examples/animation/simple_anim_wx.py 2008-09-13 14:28:09 UTC (rev 6089)
+++ trunk/matplotlib/examples/animation/simple_anim_wx.py 2008-09-13 15:35:55 UTC (rev 6090)
@@ -1,29 +0,0 @@
-"""
-A simple example of an animated plot using a wx backend
-"""
-import time
-import numpy as np
-import matplotlib
-matplotlib.use('WXAgg') # do this before importing pylab
-
-import matplotlib.pyplot as plt
-
-fig = plt.figure()
-
-ax = fig.add_subplot(111)
-
-def animate(idleevent):
- tstart = time.time() # for profiling
- x = np.arange(0, 2*np.pi, 0.01) # x-array
- line, = ax.plot(x, np.sin(x))
-
- for i in np.arange(1,200):
- line.set_ydata(np.sin(x+i/10.0)) # update the data
- fig.canvas.draw() # redraw the canvas
- print 'FPS:' , 200/(time.time()-tstart)
- raise SystemExit
-
-# call the animation loop on idle
-import wx
-wx.EVT_IDLE(wx.GetApp(), animate)
-plt.show()
Added: trunk/matplotlib/examples/animation/simple_idle_wx.py
===================================================================
--- trunk/matplotlib/examples/animation/simple_idle_wx.py (rev 0)
+++ trunk/matplotlib/examples/animation/simple_idle_wx.py 2008-09-13 15:35:55 UTC (rev 6090)
@@ -0,0 +1,29 @@
+"""
+A simple example of an animated plot using a wx backend
+"""
+import time
+import numpy as np
+import matplotlib
+matplotlib.use('WXAgg') # do this before importing pylab
+
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+
+ax = fig.add_subplot(111)
+t = np.arange(0, 2*np.pi, 0.1)
+line, = ax.plot(t, np.sin(t))
+dt = 0.05
+
+def update_line(idleevent):
+ if update_line.i==200:
+ return False
+ print 'animate', update_line.i
+ line.set_ydata(np.sin(t+update_line.i/10.))
+ fig.canvas.draw_idle() # redraw the canvas
+ update_line.i += 1
+update_line.i = 0
+
+import wx
+wx.EVT_IDLE(wx.GetApp(), update_line)
+plt.show()
Added: trunk/matplotlib/examples/animation/simple_timer_wx.py
===================================================================
--- trunk/matplotlib/examples/animation/simple_timer_wx.py (rev 0)
+++ trunk/matplotlib/examples/animation/simple_timer_wx.py 2008-09-13 15:35:55 UTC (rev 6090)
@@ -0,0 +1,36 @@
+"""
+A simple example of an animated plot using a wx backend
+"""
+import time
+import numpy as np
+import matplotlib
+matplotlib.use('WXAgg') # do this before importing pylab
+
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+
+ax = fig.add_subplot(111)
+t = np.arange(0, 2*np.pi, 0.1)
+line, = ax.plot(t, np.sin(t))
+dt = 0.05
+
+
+def update_line(event):
+ if update_line.i==200:
+ return False
+ print 'update', update_line.i
+ line.set_ydata(np.sin(t+update_line.i/10.))
+ fig.canvas.draw() # redraw the canvas
+ update_line.i += 1
+update_line.i = 0
+
+import wx
+id = wx.NewId()
+actor = fig.canvas.manager.frame
+timer = wx.Timer(actor, id=id)
+timer.Start(100)
+wx.EVT_TIMER(actor, id, update_line)
+#actor.Bind(wx.EVT_TIMER, update_line, id=id)
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-13 14:28:15
|
Revision: 6089
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6089&view=rev
Author: jdh2358
Date: 2008-09-13 14:28:09 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
replaced ipython run magic with code.InteractiveConsole.runsource
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/plot_directive.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/doc/sphinxext/plot_directive.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-09-12 21:21:16 UTC (rev 6088)
+++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-09-13 14:28:09 UTC (rev 6089)
@@ -13,7 +13,7 @@
source will be included inline, as well as a link to the source.
"""
-import sys, os, glob, shutil
+import sys, os, glob, shutil, code
from docutils.parsers.rst import directives
try:
@@ -26,11 +26,16 @@
import matplotlib
-import IPython.Shell
+
matplotlib.use('Agg')
import matplotlib.pyplot as plt
-mplshell = IPython.Shell.MatplotlibShell('mpl')
+#import IPython.Shell
+#mplshell = IPython.Shell.MatplotlibShell('mpl')
+console = code.InteractiveConsole()
+def runfile(fname):
+ source = file(fname).read()
+ return console.runsource(source)
options = {'alt': directives.unchanged,
'height': directives.length_or_unitless,
@@ -58,7 +63,7 @@
def makefig(fullpath, outdir):
"""
- run a pyplot script and save the low and high res PNGs and a PDF in _static
+ run a pyplot script<t and save the low and high res PNGs and a PDF in _static
"""
fullpath = str(fullpath) # todo, why is unicode breaking this
@@ -88,7 +93,8 @@
plt.close('all') # we need to clear between runs
matplotlib.rcdefaults()
- mplshell.magic_run(fullpath)
+ runfile(fullpath)
+
for format, dpi in formats:
outname = os.path.join(outdir, '%s.%s' % (basename, format))
if os.path.exists(outname): continue
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-09-12 21:21:16 UTC (rev 6088)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-09-13 14:28:09 UTC (rev 6089)
@@ -41,10 +41,11 @@
# these are not available for the object inspector until after the
# class is build so we define an initial set here for the init
# function and they will be overridden after object defn
-artist.kwdocd['Text'] = """\
+artist.kwdocd['Text'] = """
========================== =========================================================================
+ Property Value
+ ========================== =========================================================================
alpha float
- ========================== =========================================================================
animated [True | False]
backgroundcolor any matplotlib color
bbox rectangle prop dict plus key 'pad' which is a pad in points
@@ -1003,7 +1004,7 @@
annotation to the point. Valid keys are
========= ===========================================================
- Key Description
+ Key Description
========= ===========================================================
width the width of the arrow in points
frac the fraction of the arrow length occupied by the head
@@ -1021,7 +1022,7 @@
coordinates of *xy* and *xytext*.
================= ===================================================
- Property Description
+ Property Description
================= ===================================================
'figure points' points from the lower left corner of the figure
'figure pixels' pixels from the lower left corner of the figure
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-09-12 22:12:14
|
Revision: 6088
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6088&view=rev
Author: jdh2358
Date: 2008-09-12 21:21:16 +0000 (Fri, 12 Sep 2008)
Log Message:
-----------
added get_children to artist base class
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/artist.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py 2008-09-12 02:35:02 UTC (rev 6087)
+++ trunk/matplotlib/lib/matplotlib/artist.py 2008-09-12 21:21:16 UTC (rev 6088)
@@ -166,10 +166,15 @@
traceback.print_exc()
print "while checking",self.__class__
- if hasattr(self,'get_children'):
- for a in self.get_children(): L.extend(a.hitlist(event))
+
+ for a in self.get_children():
+ L.extend(a.hitlist(event))
return L
+ def get_children(self):
+ 'return a list of the child artist this artist contains'
+ return []
+
def contains(self, mouseevent):
"""Test whether the artist contains the mouse event.
@@ -224,8 +229,8 @@
self.figure.canvas.pick_event(mouseevent, self, **prop)
# Pick children
- if hasattr(self,'get_children'):
- for a in self.get_children(): a.pick(mouseevent)
+ for a in self.get_children():
+ a.pick(mouseevent)
def set_picker(self, picker):
"""
@@ -538,14 +543,14 @@
artists = []
- if hasattr(self, 'get_children'):
- for c in self.get_children():
- if matchfunc(c):
- artists.append(c)
- artists.extend([thisc for thisc in c.findobj(matchfunc) if matchfunc(thisc)])
- else:
- if matchfunc(self):
- artists.append(self)
+
+ for c in self.get_children():
+ if matchfunc(c):
+ artists.append(c)
+ artists.extend([thisc for thisc in c.findobj(matchfunc) if matchfunc(thisc)])
+
+ if matchfunc(self):
+ artists.append(self)
return artists
@@ -761,14 +766,14 @@
artists = []
- if hasattr(self, 'get_children'):
- for c in self.get_children():
- if matchfunc(c):
- artists.append(c)
- artists.extend([thisc for thisc in c.findobj(matchfunc) if matchfunc(thisc)])
- else:
- if matchfunc(self):
- artists.append(self)
+
+ for c in self.get_children():
+ if matchfunc(c):
+ artists.append(c)
+ artists.extend([thisc for thisc in c.findobj(matchfunc) if matchfunc(thisc)])
+
+ if matchfunc(self):
+ artists.append(self)
return artists
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-09-12 02:35:02 UTC (rev 6087)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-09-12 21:21:16 UTC (rev 6088)
@@ -944,7 +944,7 @@
break
parent = None
for p in under:
- if hasattr(p,'getchildren') and h in p.get_children():
+ if h in p.get_children():
parent = p
break
h = parent
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-09-12 02:35:02 UTC (rev 6087)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-09-12 21:21:16 UTC (rev 6088)
@@ -2346,14 +2346,16 @@
class FormatInt(FormatObj):
def toval(self, x):
- return x
+ return int(x)
def fromstr(self, s):
return int(s)
class FormatBool(FormatObj):
+
+
def toval(self, x):
- return x
+ return str(x)
def fromstr(self, s):
return bool(s)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-09-12 02:35:05
|
Revision: 6087
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6087&view=rev
Author: jswhit
Date: 2008-09-12 02:35:02 +0000 (Fri, 12 Sep 2008)
Log Message:
-----------
add colorbar
Modified Paths:
--------------
trunk/toolkits/basemap/examples/randompoints.py
Modified: trunk/toolkits/basemap/examples/randompoints.py
===================================================================
--- trunk/toolkits/basemap/examples/randompoints.py 2008-09-11 20:28:11 UTC (rev 6086)
+++ trunk/toolkits/basemap/examples/randompoints.py 2008-09-12 02:35:02 UTC (rev 6087)
@@ -28,16 +28,18 @@
# 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',edgecolors='none',zorder=10)
+m.scatter(x,y,25,z,cmap=plt.cm.jet,marker='o',edgecolors='none',zorder=10)
+# plot colorbar for markers.
+plt.colorbar()
# create a list of strings containing z values
# or, plot actual numbers as color-coded text strings.
-zn = [ '%2i' % zz for zz in z ]
-# plot numbers on map, colored by value.
-for numstr,zval,xpt,ypt in zip(zn,z,x,y):
- # only plot values inside map region.
- if xpt > m.xmin and xpt < m.xmax and ypt > m.ymin and ypt < m.ymax:
- hexcolor = rgb2hex(plt.cm.jet(zval/100.)[:3])
- plt.text(xpt,ypt,numstr,fontsize=9,weight='bold',color=hexcolor)
+#zn = [ '%2i' % zz for zz in z ]
+## plot numbers on map, colored by value.
+#for numstr,zval,xpt,ypt in zip(zn,z,x,y):
+# # only plot values inside map region.
+# if xpt > m.xmin and xpt < m.xmax and ypt > m.ymin and ypt < m.ymax:
+# hexcolor = rgb2hex(plt.cm.jet(zval/100.)[:3])
+# plt.text(xpt,ypt,numstr,fontsize=9,weight='bold',color=hexcolor)
# draw coasts and fill continents/lakes.
m.drawcoastlines(linewidth=0.5)
m.fillcontinents(color='coral',lake_color='aqua')
@@ -50,6 +52,6 @@
m.drawparallels(circles)
delon = 45.
meridians = np.arange(0,360,delon)
-m.drawmeridians(meridians,labels=[1,1,1,1])
-plt.title('Random Points',y=1.075)
+m.drawmeridians(meridians,labels=[1,0,1,1])
+plt.title('Random Points',y=1.05)
plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|