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: <md...@us...> - 2008-07-11 14:36:52
|
Revision: 5736
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5736&view=rev
Author: mdboom
Date: 2008-07-11 07:36:49 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
Minor updates to inheritance diagram.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-07-11 12:18:43 UTC (rev 5735)
+++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py 2008-07-11 14:36:49 UTC (rev 5736)
@@ -145,8 +145,9 @@
"""
module = cls.__module__
if module == '__builtin__':
- return cls.__name__
- fullname = '.'.join([module, cls.__name__])
+ fullname = cls.__name__
+ else:
+ fullname = "%s.%s" % (module, cls.__name__)
if parts == 0:
return fullname
name_parts = fullname.split('.')
@@ -299,6 +300,9 @@
node['content'] = " ".join(class_names)
return [node]
+def get_graph_hash(node):
+ return md5(node['content'] + str(node['parts'])).hexdigest()[-10:]
+
def html_output_graph(self, node):
"""
Output the graph for HTML. This will insert a PNG with clickable
@@ -307,11 +311,9 @@
graph = node['graph']
parts = node['parts']
- # Determine where to write the PNG to. This follows
- # the same procedure as mathpng.py
- name = 'inheritance%s' % md5(
- node['content'] + str(node['parts'])).hexdigest()[-10:]
- png_path = '_static/%s.png' % name
+ graph_hash = get_graph_hash(node)
+ name = "inheritance%s" % graph_hash
+ png_path = os.path.join('_static', name + ".png")
path = '_static'
source = self.document.attributes['source']
@@ -346,24 +348,14 @@
graph = node['graph']
parts = node['parts']
- # Determine where to write the PNG to. This follows
- # the same procedure as mathpng.py
- name = 'inheritance%s' % md5(
- node['content'] + str(node['parts'])).hexdigest()[-10:]
- pdf_path = '_static/%s.pdf' % name
+ graph_hash = get_graph_hash(node)
+ name = "inheritance%s"
+ pdf_path = os.path.join('_static', name + ".pdf")
- path = '_static'
- source = self.document.attributes['source']
- count = source.split('/doc/')[-1].count('/')
- for i in range(count):
- if os.path.exists(path): break
- path = '../'+path
- path = '../'+path #specifically added for matplotlib
+ graph.run_dot(['-Tpdf', '-o%s' % pdf_path],
+ name, parts, graph_options={'size': '"6.0,6.0"'})
+ return '\\includegraphics{../../%s}' % pdf_path
- graph.run_dot(['-Tpdf', '-o%s' % pdf_path], name, parts,
- graph_options={'size': '"6.0,6.0"'})
- return '\\includegraphics{../../_static/%s.pdf}' % name
-
def visit_inheritance_diagram(inner_func):
"""
This is just a wrapper around html/latex_output_graph to make it
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-07-11 12:18:46
|
Revision: 5735
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5735&view=rev
Author: dsdale
Date: 2008-07-11 05:18:43 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
fixed a couple typos in artists.rst
Modified Paths:
--------------
trunk/matplotlib/doc/users/artists.rst
Modified: trunk/matplotlib/doc/users/artists.rst
===================================================================
--- trunk/matplotlib/doc/users/artists.rst 2008-07-10 18:59:18 UTC (rev 5734)
+++ trunk/matplotlib/doc/users/artists.rst 2008-07-11 12:18:43 UTC (rev 5735)
@@ -68,19 +68,20 @@
of ``[left, bottom, width, height]`` values in 0-1 relative figure
coordinates::
- ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3])
+ fig2 = plt.figure()
+ ax2 = fig2.add_axes([0.15, 0.1, 0.7, 0.3])
Continuing with our example::
import numpy as np
t = np.arange(0.0, 1.0, 0.01)
s = np.sin(2*np.pi*t)
- line, = ax1.plot(t, s, color='blue', lw=2)
+ line, = ax.plot(t, s, color='blue', lw=2)
In this example, ``ax`` is the ``Axes`` instance created by the
``fig.add_subplot`` call above (remember ``Subplot`` is just a
-subclass of ``Axes``) and when you call ``ax.plot``, it creates a
-``Line2D`` instance and adds it the the :attr:`Axes.lines
+subclass of ``Axes``) and when you call ``ax.plot``, it createsa
+``Line2D`` instance and adds it the :attr:`Axes.lines
<matplotlib.axes.Axes.lines>` list. In the interactive `ipython
<http://ipython.scipy.org/>`_ session below, you can see that
``Axes.lines`` list is length one and contains the same line that was
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-07-10 19:00:17
|
Revision: 5734
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5734&view=rev
Author: dsdale
Date: 2008-07-10 11:59:18 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
minor cleanup in documentation guide
Modified Paths:
--------------
trunk/matplotlib/doc/devel/documenting_mpl.rst
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-07-10 18:12:50 UTC (rev 5733)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst 2008-07-10 18:59:18 UTC (rev 5734)
@@ -18,8 +18,9 @@
.. _Sphinx: http://sphinx.pocoo.org/
-The documentation sources are found in the `doc/` directory in the trunk.
-To build the users guide in html format, cd into `doc/users_guide` and do::
+The documentation sources are found in the :file:`doc/` directory in the trunk.
+To build the users guide in html format, cd into :file:`doc/` and
+do::
python make.py html
@@ -30,19 +31,20 @@
you can also pass a ``latex`` flag to make.py to build a pdf, or pass no
arguments to build everything.
-The output produced by Sphinx can be configured by editing the `conf.py`
-file located in the `doc/`.
+The output produced by Sphinx can be configured by editing the :file:`conf.py`
+file located in the :file:`doc/`.
Organization of matplotlib's documentation
==========================================
-The actual ReStructured Text files are kept in `doc/users`, `doc/devel`,
-`doc/api` and `doc/faq`. The main entry point is `doc/index.rst`, which pulls
-in the `index.rst` file for the users guide, developers guide, api reference,
-and faqs. The documentation suite is built as a single document in order to
-make the most effective use of cross referencing, we want to make navigating
-the Matplotlib documentation as easy as possible.
+The actual ReStructured Text files are kept in :file:`doc/users`,
+:file:`doc/devel`, :file:`doc/api` and :file:`doc/faq`. The main entry point is
+:file:`doc/index.rst`, which pulls in the :file:`index.rst` file for the users
+guide, developers guide, api reference, and faqs. The documentation suite is
+built as a single document in order to make the most effective use of cross
+referencing, we want to make navigating the Matplotlib documentation as easy as
+possible.
Additional files can be added to the various guides by including their base
file name (the .rst extension is not necessary) in the table of contents.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-10 18:14:15
|
Revision: 5733
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5733&view=rev
Author: mdboom
Date: 2008-07-10 11:12:50 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
Add some range checking based on testing in Fusil.
Modified Paths:
--------------
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/_image.cpp
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-07-10 15:45:15 UTC (rev 5732)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-07-10 18:12:50 UTC (rev 5733)
@@ -1611,10 +1611,26 @@
if ( kws.hasKey("debug") ) debug = Py::Int( kws["debug"] );
else debug=0;
- int width = Py::Int(args[0]);
- int height = Py::Int(args[1]);
+ unsigned int width = (unsigned int)Py::Int(args[0]);
+ unsigned int height = (unsigned int)Py::Int(args[1]);
double dpi = Py::Float(args[2]);
- return Py::asObject(new RendererAgg(width, height, dpi, debug));
+
+ if (width > 1 << 15 || height > 1 << 15) {
+ throw Py::ValueError("width and height must each be below 32768");
+ }
+
+ if (dpi <= 0.0) {
+ throw Py::ValueError("dpi must be positive");
+ }
+
+ RendererAgg* renderer = NULL;
+ try {
+ renderer = new RendererAgg(width, height, dpi, debug);
+ } catch (std::bad_alloc) {
+ throw Py::RuntimeError("Could not allocate memory for image");
+ }
+
+ return Py::asObject(renderer);
}
Modified: trunk/matplotlib/src/_image.cpp
===================================================================
--- trunk/matplotlib/src/_image.cpp 2008-07-10 15:45:15 UTC (rev 5732)
+++ trunk/matplotlib/src/_image.cpp 2008-07-10 18:12:50 UTC (rev 5733)
@@ -708,9 +708,13 @@
args.verify_length(3);
- size_t numrows = Py::Int(args[0]);
- size_t numcols = Py::Int(args[1]);
+ size_t numrows = (size_t)Py::Int(args[0]);
+ size_t numcols = (size_t)Py::Int(args[1]);
+ if (numrows > 1 << 15 || numcols > 1 << 15) {
+ throw Py::RuntimeError("numrows and numcols must both be less than 32768");
+ }
+
Py::SeqBase<Py::Object> tups = args[2];
size_t N = tups.length();
@@ -1084,8 +1088,13 @@
args.verify_length(4);
PyObject *bufin = new_reference_to(args[0]);
- int x = Py::Int(args[1]);
- int y = Py::Int(args[2]);
+ size_t x = Py::Int(args[1]);
+ size_t y = Py::Int(args[2]);
+
+ if (x > 1 << 15 || y > 1 << 15) {
+ throw Py::ValueError("x and y must both be less than 32768");
+ }
+
int isoutput = Py::Int(args[3]);
if (PyObject_CheckReadBuffer(bufin) != 1)
@@ -1155,6 +1164,10 @@
unsigned int cols = Py::Int(args[4]);
Py::Tuple bounds = args[5];
+ if (rows > 1 << 15 || cols > 1 << 15) {
+ throw Py::ValueError("rows and cols must both be less than 32768");
+ }
+
if (bounds.length() !=4)
throw Py::TypeError("Incorrect number of bounds (4 expected)");
float x_min = Py::Float(bounds[0]);
@@ -1391,6 +1404,10 @@
Py::Tuple bounds = args[5];
Py::Object bgp = args[6];
+ if (rows > 1 << 15 || cols > 1 << 15) {
+ throw Py::ValueError("rows and cols must both be less than 32768");
+ }
+
if (bounds.length() !=4)
throw Py::TypeError("Incorrect number of bounds (4 expected)");
double x_left = Py::Float(bounds[0]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-10 15:45:49
|
Revision: 5732
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5732&view=rev
Author: mdboom
Date: 2008-07-10 08:45:15 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
Bugfix: crash displaying fontconfig pattern
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-10 14:13:07 UTC (rev 5731)
+++ trunk/matplotlib/CHANGELOG 2008-07-10 15:45:15 UTC (rev 5732)
@@ -1,3 +1,5 @@
+2008-07-10 Bugfix: crash displaying fontconfig pattern - MGD
+
2008-07-10 Bugfix: [ 2013963 ] update_datalim_bounds in Axes not works - MGD
2008-07-10 Bugfix: [ 2014183 ] multiple imshow() causes gray edges - MGD
Modified: trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py 2008-07-10 14:13:07 UTC (rev 5731)
+++ trunk/matplotlib/lib/matplotlib/fontconfig_pattern.py 2008-07-10 15:45:15 UTC (rev 5732)
@@ -123,23 +123,23 @@
return props
def _family(self, s, loc, tokens):
- return [family_unescape(r'\1', tokens[0])]
+ return [family_unescape(r'\1', str(tokens[0]))]
def _size(self, s, loc, tokens):
return [float(tokens[0])]
def _name(self, s, loc, tokens):
- return [tokens[0]]
+ return [str(tokens[0])]
def _value(self, s, loc, tokens):
- return [value_unescape(r'\1', tokens[0])]
+ return [value_unescape(r'\1', str(tokens[0]))]
def _families(self, s, loc, tokens):
- self._properties['family'] = tokens
+ self._properties['family'] = [str(x) for x in tokens]
return []
def _point_sizes(self, s, loc, tokens):
- self._properties['size'] = tokens
+ self._properties['size'] = [str(x) for x in tokens]
return []
def _property(self, s, loc, tokens):
@@ -161,10 +161,13 @@
props = []
families = ''
size = ''
- for key, val in d.items():
+ for key in 'family style variant weight stretch file size'.split():
+ val = getattr(d, 'get_' + key)()
if val is not None and val != []:
- val = [value_escape(r'\\\1', str(x)) for x in val if x is not None]
- if val != []:
- val = ','.join(val)
- props.append(":%s=%s" % (key, val))
+ if type(val) == list:
+ val = [value_escape(r'\\\1', str(x)) for x in val if x is not None]
+ if val != []:
+ val = ','.join(val)
+ props.append(":%s=%s" % (key, val))
+ print parse_fontconfig_pattern(''.join(props))
return ''.join(props)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-10 14:13:11
|
Revision: 5731
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5731&view=rev
Author: mdboom
Date: 2008-07-10 07:13:07 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
[ 2013963 ] update_datalim_bounds in Axes not works
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-10 14:07:00 UTC (rev 5730)
+++ trunk/matplotlib/CHANGELOG 2008-07-10 14:13:07 UTC (rev 5731)
@@ -1,3 +1,5 @@
+2008-07-10 Bugfix: [ 2013963 ] update_datalim_bounds in Axes not works - MGD
+
2008-07-10 Bugfix: [ 2014183 ] multiple imshow() causes gray edges - MGD
2008-07-09 Fix rectangular axes patch on polar plots bug - MGD
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-10 14:07:00 UTC (rev 5730)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-10 14:13:07 UTC (rev 5731)
@@ -1394,7 +1394,7 @@
Update the datalim to include the given
:class:`~matplotlib.transforms.Bbox` *bounds*
'''
- self.dataLim.set(Bbox.union([self.dataLim, bounds]))
+ self.dataLim.set(mtransforms.Bbox.union([self.dataLim, bounds]))
def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
'look for unit *kwargs* and update the axis instances as necessary'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-10 14:07:03
|
Revision: 5730
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5730&view=rev
Author: mdboom
Date: 2008-07-10 07:07:00 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
[ 2014183 ] multiple imshow() causes gray edges
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/src/_image.cpp
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-10 12:22:16 UTC (rev 5729)
+++ trunk/matplotlib/CHANGELOG 2008-07-10 14:07:00 UTC (rev 5730)
@@ -1,3 +1,5 @@
+2008-07-10 Bugfix: [ 2014183 ] multiple imshow() causes gray edges - MGD
+
2008-07-09 Fix rectangular axes patch on polar plots bug - MGD
2008-07-09 Improve mathtext radical rendering - MGD
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-07-10 12:22:16 UTC (rev 5729)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-07-10 14:07:00 UTC (rev 5730)
@@ -211,6 +211,11 @@
def clear(self):
self._renderer.clear()
+ def option_image_nocomposite(self):
+ # It is generally faster to composite each image directly to
+ # the Figure, and there's no file size benefit to compositing
+ # with the Agg backend
+ return True
def new_figure_manager(num, *args, **kwargs):
Modified: trunk/matplotlib/src/_image.cpp
===================================================================
--- trunk/matplotlib/src/_image.cpp 2008-07-10 12:22:16 UTC (rev 5729)
+++ trunk/matplotlib/src/_image.cpp 2008-07-10 14:07:00 UTC (rev 5730)
@@ -742,7 +742,7 @@
//clear the background of the rendering buffer with alpha 1 and the
//gtkagg screen noise problem in figimage_demo.py goes away -- see
//comment backend_gtkagg.py _render_figure method JDH
- //rb.clear(agg::rgba(1, 1, 1, 1));
+ rb.clear(agg::rgba(1, 1, 1, 1));
for (size_t imnum=0; imnum< N; imnum++) {
tup = Py::Tuple(tups[imnum]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-10 12:22:47
|
Revision: 5729
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5729&view=rev
Author: jswhit
Date: 2008-07-10 05:22:16 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
added tmerc and cass examples
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/mapsetup.rst
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/cass.rst
trunk/toolkits/basemap/doc/users/figures/cass.py
trunk/toolkits/basemap/doc/users/figures/tmerc.py
trunk/toolkits/basemap/doc/users/tmerc.rst
Added: trunk/toolkits/basemap/doc/users/cass.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/cass.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/cass.rst 2008-07-10 12:22:16 UTC (rev 5729)
@@ -0,0 +1,12 @@
+.. _cass:
+
+Cassini Projection
+==================
+
+The transverse aspect of the equidistant cassindrical projection.
+The globe is first rotated so the central meridian becomes the "equator",
+and then the normal equidistant cylindrical projection is applied.
+
+.. literalinclude:: figures/cass.py
+
+.. image:: figures/cass.png
Added: trunk/toolkits/basemap/doc/users/figures/cass.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/cass.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/cass.py 2008-07-10 12:22:16 UTC (rev 5729)
@@ -0,0 +1,22 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
+# are the lat/lon values of the lower left and upper right corners
+# of the map.
+# resolution = 'i' means use intermediate resolution coastlines.
+# lon_0, lat_0 are the central longitude and latitude of the projection.
+m = Basemap(llcrnrlon=-10.5,llcrnrlat=49.5,urcrnrlon=3.5,urcrnrlat=59.5,
+ resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7)
+# can get the identical map this way (by specifying width and
+# height instead of lat/lon corners)
+#m = Basemap(width=891185,height=1115557,\
+# resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7)
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-40,61.,2.))
+m.drawmeridians(np.arange(-20.,21.,2.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Cassini Projection")
+plt.savefig('cass.png')
Added: trunk/toolkits/basemap/doc/users/figures/tmerc.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/tmerc.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/tmerc.py 2008-07-10 12:22:16 UTC (rev 5729)
@@ -0,0 +1,22 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
+# are the lat/lon values of the lower left and upper right corners
+# of the map.
+# resolution = 'i' means use intermediate resolution coastlines.
+# lon_0, lat_0 are the central longitude and latitude of the projection.
+m = Basemap(llcrnrlon=-10.5,llcrnrlat=49.5,urcrnrlon=3.5,urcrnrlat=59.5,
+ resolution='i',projection='tmerc',lon_0=-4.36,lat_0=54.7)
+# can get the identical map this way (by specifying width and
+# height instead of lat/lon corners)
+#m = Basemap(width=894887,height=1116766,\
+# resolution='i',projection='tmerc',lon_0=-4.36,lat_0=54.7)
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-40,61.,2.))
+m.drawmeridians(np.arange(-20.,21.,2.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Transverse Mercator Projection")
+plt.savefig('tmerc.png')
Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-09 19:34:43 UTC (rev 5728)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-10 12:22:16 UTC (rev 5729)
@@ -39,5 +39,7 @@
robin.rst
sinu.rst
cyl.rst
+ cass.rst
merc.rst
+ tmerc.rst
mill.rst
Added: trunk/toolkits/basemap/doc/users/tmerc.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/tmerc.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/tmerc.rst 2008-07-10 12:22:16 UTC (rev 5729)
@@ -0,0 +1,12 @@
+.. _tmerc:
+
+Transverse Mercator Projection
+==============================
+
+The transverse aspect of the mercator projection.
+The globe is first rotated so the central meridian becomes the "equator",
+and then the normal mercator projection is applied.
+
+.. literalinclude:: figures/tmerc.py
+
+.. image:: figures/tmerc.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-09 19:34:45
|
Revision: 5728
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5728&view=rev
Author: mdboom
Date: 2008-07-09 12:34:43 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
Fix rectangular polar axes patch (continued...)
Modified Paths:
--------------
trunk/matplotlib/examples/api/custom_projection_example.py
Modified: trunk/matplotlib/examples/api/custom_projection_example.py
===================================================================
--- trunk/matplotlib/examples/api/custom_projection_example.py 2008-07-09 19:30:22 UTC (rev 5727)
+++ trunk/matplotlib/examples/api/custom_projection_example.py 2008-07-09 19:34:43 UTC (rev 5728)
@@ -217,7 +217,7 @@
"""
return self._yaxis_text2_transform, 'center', 'left'
- def get_axes_patch(self):
+ def _gen_axes_patch(self):
"""
Override this method to define the shape that is used for the
background of the plot. It should be a subclass of Patch.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-09 19:30:24
|
Revision: 5727
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5727&view=rev
Author: mdboom
Date: 2008-07-09 12:30:22 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
Fix rectangular polar axes patch.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/projections/geo.py
trunk/matplotlib/lib/matplotlib/projections/polar.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-09 16:16:50 UTC (rev 5726)
+++ trunk/matplotlib/CHANGELOG 2008-07-09 19:30:22 UTC (rev 5727)
@@ -1,3 +1,5 @@
+2008-07-09 Fix rectangular axes patch on polar plots bug - MGD
+
2008-07-09 Improve mathtext radical rendering - MGD
2008-07-08 Improve mathtext superscript placement - MGD
Modified: trunk/matplotlib/lib/matplotlib/projections/geo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/geo.py 2008-07-09 16:16:50 UTC (rev 5726)
+++ trunk/matplotlib/lib/matplotlib/projections/geo.py 2008-07-09 19:30:22 UTC (rev 5727)
@@ -127,7 +127,7 @@
def get_yaxis_text2_transform(self, pad):
return self._yaxis_text2_transform, 'center', 'left'
- def get_axes_patch(self):
+ def _gen_axes_patch(self):
return Circle((0.5, 0.5), 0.5)
def set_yscale(self, *args, **kwargs):
Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-07-09 16:16:50 UTC (rev 5726)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-07-09 19:30:22 UTC (rev 5727)
@@ -261,7 +261,7 @@
def get_yaxis_text2_transform(self, pad):
return self._yaxis_text2_transform, 'center', 'center'
- def get_axes_patch(self):
+ def _gen_axes_patch(self):
return Circle((0.5, 0.5), 0.5)
def set_rmax(self, rmax):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-09 16:16:56
|
Revision: 5726
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5726&view=rev
Author: mdboom
Date: 2008-07-09 09:16:50 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
Added preliminary matplotlib outline
Modified Paths:
--------------
trunk/py4science/classes/0808_scipy_agenda.txt
Modified: trunk/py4science/classes/0808_scipy_agenda.txt
===================================================================
--- trunk/py4science/classes/0808_scipy_agenda.txt 2008-07-09 14:48:16 UTC (rev 5725)
+++ trunk/py4science/classes/0808_scipy_agenda.txt 2008-07-09 16:16:50 UTC (rev 5726)
@@ -6,6 +6,7 @@
..
1 Introduction and resources
2 Day 1
+ 3 Day 2
..
Introduction and resources
@@ -92,3 +93,25 @@
* Python packages and modules, the very basics: __init__.py and $PYTHONPATH.
+
+Day 2
+=====
+
+* basic plotting with matplotlib
+ * basic line/scatter plotting
+ * customizing colors, styles
+ * legend
+ * backends - what they are and pros/cons of each
+ * matplotlibrc
+ * math text
+
+... probably some of Perry's content here ...
+
+* advanced plotting with matplotlib
+ * the object-oriented API
+ * text annotations
+ * tour of advanced plot types
+ * polar plots
+ * histograms
+ * images
+ * color maps
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-09 14:48:25
|
Revision: 5725
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5725&view=rev
Author: mdboom
Date: 2008-07-09 07:48:16 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
Correct typo.
Modified Paths:
--------------
trunk/matplotlib/doc/users/mathtext.rst
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst 2008-07-09 13:39:36 UTC (rev 5724)
+++ trunk/matplotlib/doc/users/mathtext.rst 2008-07-09 14:48:16 UTC (rev 5725)
@@ -260,7 +260,7 @@
============================== =================================
Care should be taken when putting accents on lower-case i's and j's.
-Note that in the following ``\mathi`` is used to avoid the extra dot
+Note that in the following ``\imath`` is used to avoid the extra dot
over the i::
r"$\hat i\ \ \hat \imath$"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-09 13:39:50
|
Revision: 5724
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5724&view=rev
Author: mdboom
Date: 2008-07-09 06:39:36 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
Merged revisions 5721-5723 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5723 | mdboom | 2008-07-09 09:33:13 -0400 (Wed, 09 Jul 2008) | 2 lines
Improve mathtext radical rendering
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/mathtext.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5720
+ /branches/v0_91_maint:1-5723
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-09 13:33:13 UTC (rev 5723)
+++ trunk/matplotlib/CHANGELOG 2008-07-09 13:39:36 UTC (rev 5724)
@@ -1,3 +1,5 @@
+2008-07-09 Improve mathtext radical rendering - MGD
+
2008-07-08 Improve mathtext superscript placement - MGD
2008-07-07 Fix custom scales in pcolormesh (thanks Matthew Turk) - MGD
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-07-09 13:33:13 UTC (rev 5723)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-07-09 13:39:36 UTC (rev 5724)
@@ -322,7 +322,13 @@
self.image, ox, oy - info.metrics.ymax, info.glyph)
def render_rect_filled(self, x1, y1, x2, y2):
- self.image.draw_rect_filled(x1, y1, x2, max(y2 - 1, y1))
+ height = max(int(y2 - y1) - 1, 0)
+ if height == 0:
+ center = (y2 + y1) / 2.0
+ y = int(center - (height + 1) / 2.0)
+ else:
+ y = int(y1)
+ self.image.draw_rect_filled(int(x1), y, ceil(x2), y + height)
def get_results(self, box):
return (self.ox,
@@ -481,8 +487,8 @@
to be destroyed."""
self.used_characters = None
- def get_kern(self, font1, sym1, fontsize1,
- font2, sym2, fontsize2, dpi):
+ def get_kern(self, font1, fontclass1, sym1, fontsize1,
+ font2, fontclass2, sym2, fontsize2, dpi):
"""
Get the kerning distance for font between sym1 and sym2.
@@ -670,7 +676,8 @@
info2 = self._get_info(font2, fontclass2, sym2, fontsize2, dpi)
font = info1.font
return font.get_kerning(info1.num, info2.num, KERNING_DEFAULT) / 64.0
- return 0.0
+ return Fonts.get_kern(self, font1, fontclass1, sym1, fontsize1,
+ font2, fontclass2, sym2, fontsize2, dpi)
class BakomaFonts(TruetypeFonts):
"""
@@ -1123,7 +1130,8 @@
font = info1.font
return (font.get_kern_dist(info1.glyph, info2.glyph)
* 0.001 * fontsize1)
- return 0.0
+ return Fonts.get_kern(self, font1, fontclass1, sym1, fontsize1,
+ font2, fontclass2, sym2, fontsize2, dpi)
def get_xheight(self, font, fontsize, dpi):
cached_font = self._get_font(font)
@@ -1433,6 +1441,19 @@
new_children.append(kern)
self.children = new_children
+ # This is a failed experiment to fake cross-font kerning.
+# def get_kerning(self, next):
+# if len(self.children) >= 2 and isinstance(self.children[-2], Char):
+# if isinstance(next, Char):
+# print "CASE A"
+# return self.children[-2].get_kerning(next)
+# elif isinstance(next, Hlist) and len(next.children) and isinstance(next.children[0], Char):
+# print "CASE B"
+# result = self.children[-2].get_kerning(next.children[0])
+# print result
+# return result
+# return 0.0
+
def hpack(self, w=0., m='additional'):
"""The main duty of hpack is to compute the dimensions of the
resulting boxes, and to adjust the glue if one of those dimensions is
@@ -2593,13 +2614,6 @@
thickness = state.font_output.get_underline_thickness(
state.font, state.fontsize, state.dpi)
- if root is None:
- root = Box(0., 0., 0.)
- else:
- root = Hlist([Char(x, state) for x in root])
- root.shrink()
- root.shrink()
-
# Determine the height of the body, and add a little extra to
# the height so it doesn't seem cramped
height = body.height - body.shift_amount + thickness * 5.0
@@ -2616,10 +2630,18 @@
Fill(),
padded_body])
# Stretch the glue between the hrule and the body
- rightside.vpack(height + 1.0, depth, 'exactly')
+ rightside.vpack(height + (state.fontsize * state.dpi) / (100.0 * 12.0),
+ depth, 'exactly')
# Add the root and shift it upward so it is above the tick.
# The value of 0.6 is a hard-coded hack ;)
+ if root is None:
+ root = Box(check.width * 0.5, 0., 0.)
+ else:
+ root = Hlist([Char(x, state) for x in root])
+ root.shrink()
+ root.shrink()
+
root_vlist = Vlist([Hlist([root])])
root_vlist.shift_amount = -height * 0.6
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-09 13:33:22
|
Revision: 5723
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5723&view=rev
Author: mdboom
Date: 2008-07-09 06:33:13 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
Improve mathtext radical rendering
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/mathtext.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-07-09 12:04:06 UTC (rev 5722)
+++ branches/v0_91_maint/CHANGELOG 2008-07-09 13:33:13 UTC (rev 5723)
@@ -1,3 +1,5 @@
+2008-07-09 Improve mathtext radical rendering - MGD
+
2008-07-08 Improve mathtext superscript placement - MGD
2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to
Modified: branches/v0_91_maint/lib/matplotlib/mathtext.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/mathtext.py 2008-07-09 12:04:06 UTC (rev 5722)
+++ branches/v0_91_maint/lib/matplotlib/mathtext.py 2008-07-09 13:33:13 UTC (rev 5723)
@@ -190,7 +190,7 @@
from matplotlib.afm import AFM
from matplotlib.cbook import enumerate, iterable, Bunch, get_realpath_and_stat, \
- is_string_like
+ is_string_like, maxdict
from matplotlib.ft2font import FT2Font, FT2Image, KERNING_DEFAULT, LOAD_FORCE_AUTOHINT, LOAD_NO_HINTING
from matplotlib.font_manager import findfont, FontProperties
from matplotlib._mathtext_data import latex_to_bakoma, \
@@ -318,7 +318,13 @@
self.image, ox, oy - info.metrics.ymax, info.glyph)
def render_rect_filled(self, x1, y1, x2, y2):
- self.image.draw_rect_filled(x1, y1, x2, max(y2 - 1, y1))
+ height = max(int(y2 - y1) - 1, 0)
+ if height == 0:
+ center = (y2 + y1) / 2.0
+ y = int(center - (height + 1) / 2.0)
+ else:
+ y = int(y1)
+ self.image.draw_rect_filled(int(x1), y, ceil(x2), y + height)
def get_results(self, box):
return (self.ox,
@@ -477,8 +483,8 @@
to be destroyed."""
self.used_characters = None
- def get_kern(self, font1, sym1, fontsize1,
- font2, sym2, fontsize2, dpi):
+ def get_kern(self, font1, fontclass1, sym1, fontsize1,
+ font2, fontclass2, sym2, fontsize2, dpi):
"""
Get the kerning distance for font between sym1 and sym2.
@@ -666,7 +672,8 @@
info2 = self._get_info(font2, fontclass2, sym2, fontsize2, dpi)
font = info1.font
return font.get_kerning(info1.num, info2.num, KERNING_DEFAULT) / 64.0
- return 0.0
+ return Fonts.get_kern(self, font1, fontclass1, sym1, fontsize1,
+ font2, fontclass2, sym2, fontsize2, dpi)
class BakomaFonts(TruetypeFonts):
"""
@@ -1121,7 +1128,8 @@
font = info1.font
return (font.get_kern_dist(info1.glyph, info2.glyph)
* 0.001 * fontsize1)
- return 0.0
+ return Fonts.get_kern(self, font1, fontclass1, sym1, fontsize1,
+ font2, fontclass2, sym2, fontsize2, dpi)
def get_xheight(self, font, fontsize, dpi):
cached_font = self._get_font(font)
@@ -1431,6 +1439,19 @@
new_children.append(kern)
self.children = new_children
+ # This is a failed experiment to fake cross-font kerning.
+# def get_kerning(self, next):
+# if len(self.children) >= 2 and isinstance(self.children[-2], Char):
+# if isinstance(next, Char):
+# print "CASE A"
+# return self.children[-2].get_kerning(next)
+# elif isinstance(next, Hlist) and len(next.children) and isinstance(next.children[0], Char):
+# print "CASE B"
+# result = self.children[-2].get_kerning(next.children[0])
+# print result
+# return result
+# return 0.0
+
def hpack(self, w=0., m='additional'):
"""The main duty of hpack is to compute the dimensions of the
resulting boxes, and to adjust the glue if one of those dimensions is
@@ -1442,8 +1463,8 @@
w: specifies a width
m: is either 'exactly' or 'additional'.
- Thus, hpack(w, exactly) produces a box whose width is exactly w, while
- hpack (w, additional ) yields a box whose width is the natural width
+ Thus, hpack(w, 'exactly') produces a box whose width is exactly w, while
+ hpack (w, 'additional') yields a box whose width is the natural width
plus w. The default values produce a box with the natural width.
node644, node649"""
# I don't know why these get reset in TeX. Shift_amount is pretty
@@ -1506,8 +1527,8 @@
m: is either 'exactly' or 'additional'.
l: a maximum height
- Thus, vpack(h, exactly) produces a box whose width is exactly w, while
- vpack(w, additional) yields a box whose width is the natural width
+ Thus, vpack(h, 'exactly') produces a box whose width is exactly w, while
+ vpack(w, 'additional') yields a box whose width is the natural width
plus w. The default values produce a box with the natural width.
node644, node668"""
# I don't know why these get reset in TeX. Shift_amount is pretty
@@ -2603,13 +2624,6 @@
thickness = state.font_output.get_underline_thickness(
state.font, state.fontsize, state.dpi)
- if root is None:
- root = Box(0., 0., 0.)
- else:
- root = Hlist([Char(x, state) for x in root])
- root.shrink()
- root.shrink()
-
# Determine the height of the body, and add a little extra to
# the height so it doesn't seem cramped
height = body.height - body.shift_amount + thickness * 5.0
@@ -2626,10 +2640,18 @@
Fill(),
padded_body])
# Stretch the glue between the hrule and the body
- rightside.vpack(height + 1.0, depth, 'exactly')
+ rightside.vpack(height + (state.fontsize * state.dpi) / (100.0 * 12.0),
+ depth, 'exactly')
# Add the root and shift it upward so it is above the tick.
# The value of 0.6 is a hard-coded hack ;)
+ if root is None:
+ root = Box(check.width * 0.5, 0., 0.)
+ else:
+ root = Hlist([Char(x, state) for x in root])
+ root.shrink()
+ root.shrink()
+
root_vlist = Vlist([Hlist([root])])
root_vlist.shift_amount = -height * 0.6
@@ -2673,12 +2695,12 @@
_parser = None
_backend_mapping = {
- 'Bitmap': MathtextBackendBitmap,
- 'Agg' : MathtextBackendAgg,
- 'PS' : MathtextBackendPs,
- 'Pdf' : MathtextBackendPdf,
- 'SVG' : MathtextBackendSvg,
- 'Cairo' : MathtextBackendCairo
+ 'bitmap': MathtextBackendBitmap,
+ 'agg' : MathtextBackendAgg,
+ 'ps' : MathtextBackendPs,
+ 'pdf' : MathtextBackendPdf,
+ 'svg' : MathtextBackendSvg,
+ 'cairo' : MathtextBackendCairo
}
_font_type_mapping = {
@@ -2689,8 +2711,8 @@
}
def __init__(self, output):
- self._output = output
- self._cache = {}
+ self._output = output.lower()
+ self._cache = maxdict(50)
def parse(self, s, dpi = 72, prop = None):
if prop is None:
@@ -2706,7 +2728,7 @@
else:
backend = self._backend_mapping[self._output]()
fontset = rcParams['mathtext.fontset']
- fontset_class = self._font_type_mapping.get(fontset)
+ fontset_class = self._font_type_mapping.get(fontset.lower())
if fontset_class is not None:
font_output = fontset_class(prop, backend)
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-09 12:04:47
|
Revision: 5722
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5722&view=rev
Author: jswhit
Date: 2008-07-09 05:04:06 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
added 3 projections to examples
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/mapsetup.rst
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/cyl.rst
trunk/toolkits/basemap/doc/users/figures/cyl.py
trunk/toolkits/basemap/doc/users/figures/merc.py
trunk/toolkits/basemap/doc/users/figures/mill.py
trunk/toolkits/basemap/doc/users/merc.rst
trunk/toolkits/basemap/doc/users/mill.rst
Added: trunk/toolkits/basemap/doc/users/cyl.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/cyl.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/cyl.rst 2008-07-09 12:04:06 UTC (rev 5722)
@@ -0,0 +1,10 @@
+.. _cyl:
+
+Equidistant Cylindrical Projection
+==================================
+
+The simplest projection, just displays the world in latitude/longitude coordinates.
+
+.. literalinclude:: figures/cyl.py
+
+.. image:: figures/cyl.png
Added: trunk/toolkits/basemap/doc/users/figures/cyl.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/cyl.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/cyl.py 2008-07-09 12:04:06 UTC (rev 5722)
@@ -0,0 +1,17 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
+# are the lat/lon values of the lower left and upper right corners
+# of the map.
+# resolution = 'c' means use crude resolution coastlines.
+m = Basemap(projection='cyl',llcrnrlat=-90,urcrnrlat=90,\
+ llcrnrlon=-180,urcrnrlon=180,resolution='c')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,91.,30.))
+m.drawmeridians(np.arange(-180.,181.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Equidistant Cylindrical Projection")
+plt.savefig('cyl.png')
Added: trunk/toolkits/basemap/doc/users/figures/merc.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/merc.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/merc.py 2008-07-09 12:04:06 UTC (rev 5722)
@@ -0,0 +1,18 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
+# are the lat/lon values of the lower left and upper right corners
+# of the map.
+# lat_ts is the latitude of true scale.
+# resolution = 'c' means use crude resolution coastlines.
+m = Basemap(projection='merc',llcrnrlat=-80,urcrnrlat=80,\
+ llcrnrlon=-180,urcrnrlon=180,lat_ts=20,resolution='c')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,91.,30.))
+m.drawmeridians(np.arange(-180.,181.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Mercator Projection")
+plt.savefig('merc.png')
Added: trunk/toolkits/basemap/doc/users/figures/mill.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/mill.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/mill.py 2008-07-09 12:04:06 UTC (rev 5722)
@@ -0,0 +1,17 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon
+# are the lat/lon values of the lower left and upper right corners
+# of the map.
+# resolution = 'c' means use crude resolution coastlines.
+m = Basemap(projection='mill',llcrnrlat=-90,urcrnrlat=90,\
+ llcrnrlon=-180,urcrnrlon=180,resolution='c')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,91.,30.))
+m.drawmeridians(np.arange(-180.,181.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Miller Cylindrical Projection")
+plt.savefig('mill.png')
Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-08 14:55:33 UTC (rev 5721)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-09 12:04:06 UTC (rev 5722)
@@ -24,7 +24,11 @@
are longer, more descriptive names. The class variable ``projection_params``
is a dictionary that provides a list of parameters that can be used to
define the properties of each projection. Following are examples that
-illustrate how to set up each of the supported projections.
+illustrate how to set up each of the supported projections. Note that
+many map projection possess one of two desirable properties - they can be
+equal-area (the area of features is preserved) or conformal (the shape of
+features is preserved). Since no map projection can have both at the same
+time, many compromise between the two.
.. toctree::
@@ -34,3 +38,6 @@
moll.rst
robin.rst
sinu.rst
+ cyl.rst
+ merc.rst
+ mill.rst
Added: trunk/toolkits/basemap/doc/users/merc.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/merc.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/merc.rst 2008-07-09 12:04:06 UTC (rev 5722)
@@ -0,0 +1,10 @@
+.. _merc:
+
+Mercator Projection
+===================
+
+A cylindrical, conformal projection. Very large distortion at high latitudes, cannot fully reach the polar regions.
+
+.. literalinclude:: figures/merc.py
+
+.. image:: figures/merc.png
Added: trunk/toolkits/basemap/doc/users/mill.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mill.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/mill.rst 2008-07-09 12:04:06 UTC (rev 5722)
@@ -0,0 +1,11 @@
+.. _mill:
+
+Miller Cylindrical Projection
+=============================
+
+A modified version of the mercator projection that avoids the polar
+singularity. Neither equal-area or conformal.
+
+.. literalinclude:: figures/mill.py
+
+.. image:: figures/mill.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-08 14:57:03
|
Revision: 5721
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5721&view=rev
Author: mdboom
Date: 2008-07-08 07:55:33 -0700 (Tue, 08 Jul 2008)
Log Message:
-----------
Merged revisions 5685-5720 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5700 | dsdale | 2008-06-30 09:24:13 -0400 (Mon, 30 Jun 2008) | 2 lines
removed Qt4's NavigationToolbar2.destroy method
........
r5706 | mdboom | 2008-07-02 11:36:38 -0400 (Wed, 02 Jul 2008) | 2 lines
Fix bug using autolegend with LineCollection.
........
r5720 | mdboom | 2008-07-08 10:50:20 -0400 (Tue, 08 Jul 2008) | 2 lines
Improve mathtext superscript placement.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/mathtext.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5684
+ /branches/v0_91_maint:1-5720
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-08 14:50:20 UTC (rev 5720)
+++ trunk/matplotlib/CHANGELOG 2008-07-08 14:55:33 UTC (rev 5721)
@@ -1,3 +1,5 @@
+2008-07-08 Improve mathtext superscript placement - MGD
+
2008-07-07 Fix custom scales in pcolormesh (thanks Matthew Turk) - MGD
2008-07-03 Implemented findobj method for artist and pyplot - see
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-07-08 14:50:20 UTC (rev 5720)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-07-08 14:55:33 UTC (rev 5721)
@@ -1169,7 +1169,7 @@
# Percentage of x-height that sub/superscripts drop below the baseline
SUBDROP = 0.3
# Percentage of x-height that superscripts drop below the baseline
-SUP1 = 0.7
+SUP1 = 0.5
# Percentage of x-height that subscripts drop below the baseline
SUB1 = 0.0
# Percentage of x-height that superscripts are offset relative to the subscript
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-08 14:52:03
|
Revision: 5720
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5720&view=rev
Author: mdboom
Date: 2008-07-08 07:50:20 -0700 (Tue, 08 Jul 2008)
Log Message:
-----------
Improve mathtext superscript placement.
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/mathtext.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-07-08 12:05:54 UTC (rev 5719)
+++ branches/v0_91_maint/CHANGELOG 2008-07-08 14:50:20 UTC (rev 5720)
@@ -1,3 +1,5 @@
+2008-07-08 Improve mathtext superscript placement - MGD
+
2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to
have been unnecessary and caused a bug reported by P.
Raybaut - DSD
Modified: branches/v0_91_maint/lib/matplotlib/mathtext.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/mathtext.py 2008-07-08 12:05:54 UTC (rev 5719)
+++ branches/v0_91_maint/lib/matplotlib/mathtext.py 2008-07-08 14:50:20 UTC (rev 5720)
@@ -1167,7 +1167,7 @@
# Percentage of x-height that sub/superscripts drop below the baseline
SUBDROP = 0.3
# Percentage of x-height that superscripts drop below the baseline
-SUP1 = 0.7
+SUP1 = 0.5
# Percentage of x-height that subscripts drop below the baseline
SUB1 = 0.0
# Percentage of x-height that superscripts are offset relative to the subscript
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-08 12:06:32
|
Revision: 5719
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5719&view=rev
Author: jswhit
Date: 2008-07-08 05:05:54 -0700 (Tue, 08 Jul 2008)
Log Message:
-----------
add robinson and sinusoidal examples, fix verbage in azeqd example.
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/azeqd.rst
trunk/toolkits/basemap/doc/users/mapsetup.rst
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/figures/robin.py
trunk/toolkits/basemap/doc/users/figures/sinu.py
trunk/toolkits/basemap/doc/users/robin.rst
trunk/toolkits/basemap/doc/users/sinu.rst
Modified: trunk/toolkits/basemap/doc/users/azeqd.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/azeqd.rst 2008-07-07 18:34:48 UTC (rev 5718)
+++ trunk/toolkits/basemap/doc/users/azeqd.rst 2008-07-08 12:05:54 UTC (rev 5719)
@@ -5,11 +5,9 @@
The shortest route from the center of the map
to any other point is a straight line in the azimuthal
-equidistant projection. Such lines show the true scale
-on the earth's surface.
-So, for the specified point, this script draws a map that shows
-in which direction to depart for other points on earth and how far
-it will be to reach that destination.
+equidistant projection.
+So, for the specified point, all points that lie on a circle around
+this point are equidistant on the surface of the earth on this projection.
The specified point ``lon_0, lat_0`` shows up as a black dot in the center of the map.
.. literalinclude:: figures/azeqd.py
Added: trunk/toolkits/basemap/doc/users/figures/robin.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/robin.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/robin.py 2008-07-08 12:05:54 UTC (rev 5719)
@@ -0,0 +1,14 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# lon_0 is central longitude of projection.
+# resolution = 'c' means use crude resolution coastlines.
+m = Basemap(projection='robin',lon_0=0,resolution='c')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,420.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Robinson Projection")
+plt.savefig('robin.png')
Added: trunk/toolkits/basemap/doc/users/figures/sinu.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/sinu.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/sinu.py 2008-07-08 12:05:54 UTC (rev 5719)
@@ -0,0 +1,14 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# lon_0 is central longitude of projection.
+# resolution = 'c' means use crude resolution coastlines.
+m = Basemap(projection='sinu',lon_0=0,resolution='c')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,420.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Sinusoidal Projection")
+plt.savefig('sinu.png')
Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-07 18:34:48 UTC (rev 5718)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-08 12:05:54 UTC (rev 5719)
@@ -32,3 +32,5 @@
gnomon.rst
ortho.rst
moll.rst
+ robin.rst
+ sinu.rst
Added: trunk/toolkits/basemap/doc/users/robin.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/robin.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/robin.rst 2008-07-08 12:05:54 UTC (rev 5719)
@@ -0,0 +1,10 @@
+.. _robin:
+
+Robinson Projection
+===================
+
+A global projection once used by the National Geographic Society for world maps.
+
+.. literalinclude:: figures/robin.py
+
+.. image:: figures/robin.png
Added: trunk/toolkits/basemap/doc/users/sinu.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/sinu.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/sinu.rst 2008-07-08 12:05:54 UTC (rev 5719)
@@ -0,0 +1,11 @@
+.. _sinu:
+
+Sinusoidal Projection
+=====================
+
+A global equal-area projection where the length of each parallel is
+equal to the cosine of the latitude.
+
+.. literalinclude:: figures/sinu.py
+
+.. image:: figures/sinu.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-07 18:34:49
|
Revision: 5718
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5718&view=rev
Author: mdboom
Date: 2008-07-07 11:34:48 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
Committing CHANGELOG
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-07 18:34:07 UTC (rev 5717)
+++ trunk/matplotlib/CHANGELOG 2008-07-07 18:34:48 UTC (rev 5718)
@@ -1,11 +1,13 @@
-2007-07-03 Implemented findobj method for artist and pyplot - see
+2008-07-07 Fix custom scales in pcolormesh (thanks Matthew Turk) - MGD
+
+2008-07-03 Implemented findobj method for artist and pyplot - see
examples/pylab_examples/findobj_demo.py - JDH
2008-06-30 Another attempt to fix TextWithDash - DSD
-2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to
- have been unnecessary and caused a bug reported by P.
- Raybaut - DSD
+2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to
+ have been unnecessary and caused a bug reported by P.
+ Raybaut - DSD
2008-06-27 Fixed tick positioning bug - MM
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-07 18:34:12
|
Revision: 5717
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5717&view=rev
Author: mdboom
Date: 2008-07-07 11:34:07 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
Clear rcParams state between documentation plots.
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/plot_directive.py
Modified: trunk/matplotlib/doc/sphinxext/plot_directive.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-07-07 17:48:36 UTC (rev 5716)
+++ trunk/matplotlib/doc/sphinxext/plot_directive.py 2008-07-07 18:34:07 UTC (rev 5717)
@@ -86,6 +86,7 @@
print ' building %s'%fullpath
plt.close('all') # we need to clear between runs
+ matplotlib.rcdefaults()
mplshell.magic_run(fullpath)
for format, dpi in formats:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-07 17:48:50
|
Revision: 5716
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5716&view=rev
Author: mdboom
Date: 2008-07-07 10:48:36 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
Fix custom scales in pcolormesh (thanks, Matthew Turk)
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py 2008-07-07 17:37:33 UTC (rev 5715)
+++ trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py 2008-07-07 17:48:36 UTC (rev 5716)
@@ -29,6 +29,8 @@
ax = fig.add_subplot(121)
ax.set_axis_bgcolor("#bdb76b")
ax.pcolormesh(Qx,Qz,Z)
+ax.set_xscale('log')
+ax.set_yscale('log')
ax.set_title('Without masked values')
ax = fig.add_subplot(122)
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-07-07 17:37:33 UTC (rev 5715)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-07-07 17:48:36 UTC (rev 5716)
@@ -512,14 +512,24 @@
if clippath_trans is not None:
clippath_trans = clippath_trans.frozen()
- assert transform.is_affine
+ if not transform.is_affine:
+ coordinates = self._coordinates.reshape(
+ (self._coordinates.shape[0] *
+ self._coordinates.shape[1],
+ 2))
+ coordinates = transform.transform(coordinates)
+ coordinates = coordinates.reshape(self._coordinates.shape)
+ transform = transforms.IdentityTransform()
+ else:
+ coordinates = self._coordinates
+
if not transOffset.is_affine:
offsets = transOffset.transform_non_affine(offsets)
transOffset = transOffset.get_affine()
renderer.draw_quad_mesh(
transform.frozen(), self.clipbox, clippath, clippath_trans,
- self._meshWidth, self._meshHeight, self._coordinates,
+ self._meshWidth, self._meshHeight, coordinates,
offsets, transOffset, self._facecolors, self._antialiased,
self._showedges)
renderer.close_group(self.__class__.__name__)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sa...@us...> - 2008-07-07 17:37:58
|
Revision: 5715
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5715&view=rev
Author: sameerd
Date: 2008-07-07 10:37:33 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
bug fixes - edgecases
Modified Paths:
--------------
trunk/matplotlib/examples/misc/rec_join_demo.py
trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/examples/misc/rec_join_demo.py
===================================================================
--- trunk/matplotlib/examples/misc/rec_join_demo.py 2008-07-07 12:12:52 UTC (rev 5714)
+++ trunk/matplotlib/examples/misc/rec_join_demo.py 2008-07-07 17:37:33 UTC (rev 5715)
@@ -2,7 +2,7 @@
import matplotlib.mlab as mlab
-r = mlab.csv2rec('data/aapl.csv')
+r = mlab.csv2rec('../data/aapl.csv')
r.sort()
r1 = r[-10:]
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-07-07 12:12:52 UTC (rev 5714)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-07-07 17:37:33 UTC (rev 5715)
@@ -2081,10 +2081,12 @@
def rec_join(key, r1, r2, jointype='inner', defaults=None):
"""
join record arrays r1 and r2 on key; key is a tuple of field
- names. if r1 and r2 have equal values on all the keys in the key
+ names. If r1 and r2 have equal values on all the keys in the key
tuple, then their fields will be merged into a new record array
- containing the intersection of the fields of r1 and r2
+ containing the intersection of the fields of r1 and r2.
+ r1 (also r2) must not have any duplicate keys.
+
The jointype keyword can be 'inner', 'outer', 'leftouter'.
To do a rightouter join just reverse r1 and r2.
@@ -2123,9 +2125,6 @@
right_ind = np.array([r2d[k] for k in right_keys])
right_len = len(right_ind)
- r2 = rec_drop_fields(r2, r1.dtype.names)
-
-
def key_desc(name):
'if name is a string key, use the larger size of r1 or r2 before merging'
dt1 = r1.dtype[name]
@@ -2158,21 +2157,17 @@
for field in r1.dtype.names:
newrec[field][:common_len] = r1[field][r1ind]
- if jointype == "outer" or jointype == "leftouter":
+ if (jointype == "outer" or jointype == "leftouter") and left_len:
newrec[field][common_len:(common_len+left_len)] = r1[field][left_ind]
for field in r2.dtype.names:
- newrec[field][:common_len] = r2[field][r2ind]
- if jointype == "outer":
- newrec[field][-right_len:] = r2[field][right_ind[right_ind.argsort()]]
+ if field not in key:
+ newrec[field][:common_len] = r2[field][r2ind]
+ if jointype == "outer" and right_len:
+ newrec[field][-right_len:] = r2[field][right_ind]
- # sort newrec using the same order as r1
- sort_indices = r1ind.copy()
- if jointype == "outer" or jointype == "leftouter":
- sort_indices = np.append(sort_indices, left_ind)
- newrec[:(common_len+left_len)] = newrec[sort_indices.argsort()]
+ newrec.sort(order=key)
-
return newrec.view(np.recarray)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-07 12:12:57
|
Revision: 5714
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5714&view=rev
Author: jswhit
Date: 2008-07-07 05:12:52 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
added mollweide example
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/mapsetup.rst
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/figures/moll.png
trunk/toolkits/basemap/doc/users/figures/moll.py
trunk/toolkits/basemap/doc/users/moll.rst
Added: trunk/toolkits/basemap/doc/users/figures/moll.png
===================================================================
(Binary files differ)
Property changes on: trunk/toolkits/basemap/doc/users/figures/moll.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/toolkits/basemap/doc/users/figures/moll.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/moll.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/moll.py 2008-07-07 12:12:52 UTC (rev 5714)
@@ -0,0 +1,14 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# lon_0 is central longitude of projection.
+# resolution = 'c' means use crude resolution coastlines.
+m = Basemap(projection='moll',lon_0=0,resolution='c')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,420.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Mollweide Projection")
+plt.savefig('moll.png')
Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-07 00:17:57 UTC (rev 5713)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-07 12:12:52 UTC (rev 5714)
@@ -31,3 +31,4 @@
azeqd.rst
gnomon.rst
ortho.rst
+ moll.rst
Added: trunk/toolkits/basemap/doc/users/moll.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/moll.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/moll.rst 2008-07-07 12:12:52 UTC (rev 5714)
@@ -0,0 +1,10 @@
+.. _moll:
+
+Mollweide Projection
+====================
+
+The mollweide projection is a global, elliptical, equal-area projection.
+
+.. literalinclude:: figures/moll.py
+
+.. image:: figures/moll.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2008-07-07 00:18:00
|
Revision: 5713
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5713&view=rev
Author: fer_perez
Date: 2008-07-06 17:17:57 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
Add agenda for 2008 SciPy tutorial, plus misc. updates to scripts.
Modified Paths:
--------------
trunk/py4science/examples/fft_imdenoise.py
trunk/py4science/examples/glass_dots1.py
trunk/py4science/examples/lotka_volterra.py
trunk/py4science/examples/numpy_wrap/f2py/example3/Makefile
trunk/py4science/examples/skel/fft_imdenoise_skel.py
trunk/py4science/examples/skel/fortran_wrap/Makefile
trunk/py4science/examples/skel/fortran_wrap/fib3.f
trunk/py4science/examples/skel/glass_dots1_skel.py
trunk/py4science/examples/stock_demo.py
trunk/py4science/examples/stock_records.py
trunk/py4science/examples/weave_blitz.py
trunk/py4science/examples/weave_examples_simple.py
Added Paths:
-----------
trunk/py4science/classes/0808_scipy_agenda.txt
Added: trunk/py4science/classes/0808_scipy_agenda.txt
===================================================================
--- trunk/py4science/classes/0808_scipy_agenda.txt (rev 0)
+++ trunk/py4science/classes/0808_scipy_agenda.txt 2008-07-07 00:17:57 UTC (rev 5713)
@@ -0,0 +1,94 @@
+=========================================================
+ Introduction to Scientific Computing in Python - Agenda
+=========================================================
+
+.. contents::
+..
+ 1 Introduction and resources
+ 2 Day 1
+..
+
+Introduction and resources
+==========================
+
+While the tutorial will begin with very basic concepts, we will assume that
+attendees have given the free online `Python tutorial`_ a very decent read, and
+will have installed on their systems all the prerequisite tools.
+
+.. _`Python tutorial`: http://docs.python.org/tut
+
+In addition, the following are good sources of information for the tools we'll
+be using (all are linked from the main `SciPy documentation`_ page):
+
+ * The `STSci tutorial`_ on interactive data analysis.
+ * The tentative `NumPy tutorial`_.
+ * The list of NumPy `functions with examples`_.
+ * The SciPy community cookbook_.
+
+.. _`SciPy documentation`: http://www.scipy.org/Documentation
+.. _`STSci tutorial`: http://www.scipy.org/wikis/topical_software/Tutorial
+.. _`NumPy tutorial`: http://www.scipy.org/Tentative_NumPy_Tutorial
+.. _`functions with examples`: http://www.scipy.org/Numpy_Example_List_With_Doc
+.. _`cookbook`: http://www.scipy.org/Cookbook
+
+
+Initials indicate who presents what:
+
+ * MD: Michael Droetboom
+ * PG: Perry Greenfield
+ * FP: Fernando Perez
+
+
+Day 1
+=====
+
+* Python for scientific computing: A high-level overview of the topic of Python
+ in a scientific context ( simple 30 minute talk).
+
+* Workflow, guided by a simple examples and students typing along. Will show
+ basics of everyday workflow as we cover the core concepts.
+
+ * Basic scalar types: strings and numbers (int, float, complex). Exercise:
+ Walli's infinte product formula for Pi.
+
+ * Basic collections: lists and dicts (mention tuples and sets). Exercise:
+ word frequency counting.
+
+ * Quick review of control flow: if, for, range, while, break, continue.
+
+ * Defining functions. Arguments and docstrings.
+
+ * Reusing your code: every script is a module, '__main__' (notes on module
+ loading and reloading)
+
+ * Exceptions: a core concept in Python, you really can't use the language
+ without them.
+
+ * Debugging your programs:
+ * Ye olde print statement.
+ * %debug in ipython.
+ * %run -d in ipython.
+ * winpdb - a free, cross-platform GUI debugger.
+
+ * Testing your code: reproducible research from the start. Making a habit
+ out of having auto-validated code.
+
+* Introduction to NumPy arrays.
+ * Memory model.
+ * The dtype concept.
+ * Creating arrays.
+ * Basic operations: arithmetic and slicing.
+ * Indexing modes. Views vs. copies.
+ * Functions that operate on arrays: the builtins and making your own.
+ * Saving and reloading arrays on disk.
+
+ Exercises: Trapezoid rule integration. Image denoising using FFTs.
+
+* Working with data
+ * Reading files.
+ * Simple text parsing.
+ * CSV files.
+ * Matplotlib's data loader.
+
+
+* Python packages and modules, the very basics: __init__.py and $PYTHONPATH.
Modified: trunk/py4science/examples/fft_imdenoise.py
===================================================================
--- trunk/py4science/examples/fft_imdenoise.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/fft_imdenoise.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -3,14 +3,13 @@
import sys
-import numpy as N
-import pylab as P
-import scipy as S
+import numpy as np
+from matplotlib import pyplot as plt
def mag_phase(F):
"""Return magnitude and phase components of spectrum F."""
- return (N.absolute(F), N.angle(F))
+ return (np.absolute(F), np.angle(F))
def plot_spectrum(F, amplify=1000):
"""Normalise, amplify and plot an amplitude spectrum."""
@@ -19,19 +18,19 @@
M[M > 1] = 1
print M.shape, M.dtype
- P.imshow(M, P.cm.Blues)
+ plt.imshow(M, plt.cm.Blues)
try:
# Read in original image, convert to floating point for further
# manipulation; imread returns a MxNx4 RGBA image. Since the
# image is grayscale, just extrac the 1st channel
- im = P.imread('data/moonlanding.png').astype(float)[:,:,0]
+ im = plt.imread('data/moonlanding.png').astype(float)[:,:,0]
except:
print "Could not open image."
sys.exit(-1)
# Compute the 2d FFT of the input image
-F = N.fft.fft2(im)
+F = np.fft.fft2(im)
# Now, make a copy of the original spectrum and truncate coefficients.
keep_fraction = 0.1
@@ -52,27 +51,27 @@
# Reconstruct the denoised image from the filtered spectrum, keep only the real
# part for display
-im_new = N.fft.ifft2(ff).real
+im_new = np.fft.ifft2(ff).real
# Show the results
-P.figure()
+plt.figure()
-P.subplot(221)
-P.title('Original image')
-P.imshow(im, P.cm.gray)
+plt.subplot(221)
+plt.title('Original image')
+plt.imshow(im, plt.cm.gray)
-P.subplot(222)
-P.title('Fourier transform')
+plt.subplot(222)
+plt.title('Fourier transform')
plot_spectrum(F)
-P.subplot(224)
-P.title('Filtered Spectrum')
+plt.subplot(224)
+plt.title('Filtered Spectrum')
plot_spectrum(ff)
-P.subplot(223)
-P.title('Reconstructed Image')
-P.imshow(im_new, P.cm.gray)
+plt.subplot(223)
+plt.title('Reconstructed Image')
+plt.imshow(im_new, plt.cm.gray)
-P.savefig('fft_imdenoise.png', dpi=150)
-P.savefig('fft_imdenoise.eps')
-P.show()
+plt.savefig('fft_imdenoise.png', dpi=150)
+plt.savefig('fft_imdenoise.eps')
+plt.show()
Modified: trunk/py4science/examples/glass_dots1.py
===================================================================
--- trunk/py4science/examples/glass_dots1.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/glass_dots1.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -5,17 +5,12 @@
See L. Glass. 'Moire effect from random dots' Nature 223, 578580 (1969).
"""
+import cmath
from numpy import cos, sin, pi, matrix
import numpy as npy
import numpy.linalg as linalg
from pylab import figure, show
-def csqrt(x):
- """
- sqrt func that handles returns sqrt(x)j for x<0
- """
- if x<0: return complex(0, npy.sqrt(abs(x)))
- else: return npy.sqrt(x)
def myeig(M):
"""
@@ -34,12 +29,13 @@
tau = a+d # the trace
delta = a*d-b*c # the determinant
- lambda1 = (tau + csqrt(tau**2 - 4*delta))/2.
- lambda2 = (tau - csqrt(tau**2 - 4*delta))/2.
+ lambda1 = (tau + cmath.sqrt(tau**2 - 4*delta))/2.
+ lambda2 = (tau - cmath.sqrt(tau**2 - 4*delta))/2.
return lambda1, lambda2
# 2000 random x,y points in the interval[-0.5 ... 0.5]
-X1 = matrix(npy.random.rand(2,2000))-0.5
+X1 = matrix(npy.random.rand(2,2000)
+ )-0.5
name = 'saddle'
sx, sy, angle = 1.05, 0.95, 0.
Modified: trunk/py4science/examples/lotka_volterra.py
===================================================================
--- trunk/py4science/examples/lotka_volterra.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/lotka_volterra.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -46,7 +46,7 @@
p.figure()
-p.plot(r, f)
+p.plot(r, f, color='red')
p.xlabel('rabbits')
p.ylabel('foxes')
p.title('phase plane')
@@ -65,8 +65,8 @@
dR = dr(R, F)
dF = df(R, F)
-p.contour(R, F, dR, levels=[0], linewidths=3, colors='black')
-p.contour(R, F, dF, levels=[0], linewidths=3, colors='black')
+p.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
+p.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
p.ylabel('foxes')
p.title('trajectory, direction field and null clines')
Modified: trunk/py4science/examples/numpy_wrap/f2py/example3/Makefile
===================================================================
--- trunk/py4science/examples/numpy_wrap/f2py/example3/Makefile 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/numpy_wrap/f2py/example3/Makefile 2008-07-07 00:17:57 UTC (rev 5713)
@@ -1,10 +1,7 @@
-#F2PY=f2py
+F2PY=f2py
-F2PY=f2py2.4
-#F2PY=/usr/local/txpython/local/Frameworks/Python.framework/Versions/2.5/bin/f2py
-
clean:
rm -f fib3.pyf example.so
Modified: trunk/py4science/examples/skel/fft_imdenoise_skel.py
===================================================================
--- trunk/py4science/examples/skel/fft_imdenoise_skel.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/skel/fft_imdenoise_skel.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -36,7 +36,7 @@
# channel from the MxNx4 RGBA matrix to represent the grayscale
# intensities
-F = # Compute the 2d FFT of the input image. Look for a 2-d FFT in N.dft
+F = # Compute the 2d FFT of the input image. Look for a 2-d FFT in N.fft.
# Define the fraction of coefficients (in each direction) we keep
keep_fraction = 0.1
Modified: trunk/py4science/examples/skel/fortran_wrap/Makefile
===================================================================
--- trunk/py4science/examples/skel/fortran_wrap/Makefile 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/skel/fortran_wrap/Makefile 2008-07-07 00:17:57 UTC (rev 5713)
@@ -1,10 +1,7 @@
-#F2PY=f2py
+F2PY=f2py
-F2PY=f2py2.4
-#F2PY=/usr/local/txpython/local/Frameworks/Python.framework/Versions/2.5/bin/f2py
-
clean:
rm -f fib3.pyf example.so
Modified: trunk/py4science/examples/skel/fortran_wrap/fib3.f
===================================================================
--- trunk/py4science/examples/skel/fortran_wrap/fib3.f 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/skel/fortran_wrap/fib3.f 2008-07-07 00:17:57 UTC (rev 5713)
@@ -19,7 +19,7 @@
ENDDO
END
- SUBROUTINE CUMSUM(X, Y, N)
+C SUBROUTINE CUMSUM(X, Y, N)
C
C COMPUTE THE CUMULATIVE SUM OF X
C
Modified: trunk/py4science/examples/skel/glass_dots1_skel.py
===================================================================
--- trunk/py4science/examples/skel/glass_dots1_skel.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/skel/glass_dots1_skel.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -5,15 +5,12 @@
See L. Glass. 'Moire effect from random dots' Nature 223, 578580 (1969).
"""
+import cmath # provides complex math functions
from numpy import cos, sin, pi, matrix
import numpy as npy
import numpy.linalg as linalg
from pylab import figure, show
-def csqrt(x):
- 'sqrt func that handles returns sqrt(x)j for x<0'
- XXX
-
def myeig(M):
"""
compute eigen values and eigenvectors analytically
Modified: trunk/py4science/examples/stock_demo.py
===================================================================
--- trunk/py4science/examples/stock_demo.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/stock_demo.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -38,5 +38,4 @@
# <demo> stop
# Now, make a slightly modified version of the file with cleaner formatting.
# We'll use this later...
-mlab.rec2csv(r,'dap/myserver/data/sample.csv',
- formatd={'date':mlab.FormatString()})
+#
Modified: trunk/py4science/examples/stock_records.py
===================================================================
--- trunk/py4science/examples/stock_records.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/stock_records.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -40,7 +40,7 @@
tickers = 'SPY', 'QQQQ', 'INTC', 'MSFT', 'YHOO', 'GOOG', 'GE', 'WMT', 'AAPL'
# we want to compute returns since 2003, so define the start date
-startdate = datetime.datetime(2003,1,1)
+startdate = datetime.date(2003,1,1)
# we'll store a list of each return and ticker for analysis later
data = [] # a list of (return, ticker) for each stock
Modified: trunk/py4science/examples/weave_blitz.py
===================================================================
--- trunk/py4science/examples/weave_blitz.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/weave_blitz.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -5,12 +5,11 @@
import sys, time
-import numpy
-from numpy import zeros
+import numpy as np
from scipy import weave
-from pylab import subplot, plot, show, legend, xlabel, ylabel, title
+from pylab import figure,subplot, plot, show, legend, xlabel, ylabel, title
-rand = numpy.random.rand
+rand = np.random.rand
Nadds = 12
Nevals = 10
@@ -45,7 +44,7 @@
# can disrupt timings
if useWeave:
# only weave needs to predefine result array
- result= zeros(shape,dtype=float)
+ result= np.empty(shape,dtype=float)
times[0] = now()
for j in evalRng:
blitz(s)
@@ -67,9 +66,10 @@
nn, tn = repeat_nadds(Nadds, Nevals, useWeave=False)
# plot weave versus Numeric
+figure()
ax = subplot(111)
plot(nw, tw, 'go', nn, tn, 'bs')
-legend( ('Weave', 'Numeric') )
+legend( ('Blitz', 'Numpy') )
xlabel('num adds')
ylabel('time (s)')
title('numpy vs weave; repeated adds, shape: %s' % (shape,))
Modified: trunk/py4science/examples/weave_examples_simple.py
===================================================================
--- trunk/py4science/examples/weave_examples_simple.py 2008-07-04 19:20:43 UTC (rev 5712)
+++ trunk/py4science/examples/weave_examples_simple.py 2008-07-07 00:17:57 UTC (rev 5713)
@@ -1,9 +1,8 @@
#!/usr/bin/env python
"""Some simple examples of weave.inline use"""
+import numpy as np
from scipy.weave import inline,converters
-import numpy as N
-from pylab import rand
#-----------------------------------------------------------------------------
# Returning a scalar quantity computed from an array.
@@ -37,16 +36,49 @@
inline(code,['num','mat','nrow','ncol'],
type_converters = converters.blitz)
-def main():
- zz = N.zeros([10,10])
+def prod(m, v):
+ #C++ version
+ nrows, ncolumns = m.shape
+ assert v.ndim==1 and ncolumns==v.shape[0],"Shape mismatch in prod"
+
+ res = np.zeros(nrows, float)
+ code = r"""
+ for (int i=0; i<nrows; i++)
+ {
+ for (int j=0; j<ncolumns; j++)
+ {
+ res(i) += m(i,j)*v(j);
+ }
+ }
+ """
+ err = inline(code,['nrows', 'ncolumns', 'res', 'm', 'v'], verbose=2,
+ type_converters=converters.blitz)
+ return res
+
+
+if __name__=='__main__':
+ print 'zz is all zeros'
+ zz = np.zeros([10,10])
print 'tr(zz)=',trace(zz)
- oo = N.ones([4,4],N.float)
+ print 'oo is all ones'
+ oo = np.ones([4,4],float)
print 'tr(oo)=',trace(oo)
- aa = rand(128,128)
+ print 'aa is random'
+ aa = np.random.rand(128,128)
print 'tr(aa)=',trace(aa)
+ print 'tr(aa)=',np.trace(aa),' (via numpy)'
+
+ print
+ print 'Modify oo in place:'
print 'oo:',oo
in_place_mult(3,oo)
print '3*oo:',oo
-if __name__=='__main__':
- main()
+ print
+ print 'Simple matrix-vector multiply'
+ nr,nc = 20,10
+ m = np.random.rand(nr,nc)
+ v = np.random.rand(nc)
+ mv = prod(m,v)
+ mvd = np.dot(m,v)
+ print 'Mat*vec error:',np.linalg.norm(mv-mvd)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-07-04 19:20:47
|
Revision: 5712
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5712&view=rev
Author: efiring
Date: 2008-07-04 12:20:43 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
fix numpy, ma imports in geo.py
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/projections/geo.py
Modified: trunk/matplotlib/lib/matplotlib/projections/geo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/geo.py 2008-07-03 16:08:52 UTC (rev 5711)
+++ trunk/matplotlib/lib/matplotlib/projections/geo.py 2008-07-04 19:20:43 UTC (rev 5712)
@@ -1,7 +1,7 @@
import math
-import numpy as npy
-from matplotlib.numerix import npyma as ma
+import numpy as np
+import numpy.ma as ma
import matplotlib
rcParams = matplotlib.rcParams
@@ -27,7 +27,7 @@
self._round_to = round_to
def __call__(self, x, pos=None):
- degrees = (x / npy.pi) * 180.0
+ degrees = (x / np.pi) * 180.0
degrees = round(degrees / self._round_to) * self._round_to
# \u00b0 : degree symbol
return u"%d\u00b0" % degrees
@@ -47,8 +47,8 @@
self.grid(rcParams['axes.grid'])
- Axes.set_xlim(self, -npy.pi, npy.pi)
- Axes.set_ylim(self, -npy.pi / 2.0, npy.pi / 2.0)
+ Axes.set_xlim(self, -np.pi, np.pi)
+ Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
def _set_lim_and_transforms(self):
# A (possibly non-linear) projection on the (already scaled) data
@@ -83,7 +83,7 @@
Affine2D().translate(0.0, -4.0)
# This is the transform for latitude ticks.
- yaxis_stretch = Affine2D().scale(npy.pi * 2.0, 1.0).translate(-npy.pi, 0.0)
+ yaxis_stretch = Affine2D().scale(np.pi * 2.0, 1.0).translate(-np.pi, 0.0)
yaxis_space = Affine2D().scale(1.0, 1.1)
self._yaxis_transform = \
yaxis_stretch + \
@@ -103,8 +103,8 @@
def _get_affine_transform(self):
transform = self._get_core_transform(1)
- xscale, _ = transform.transform_point((npy.pi, 0))
- _, yscale = transform.transform_point((0, npy.pi / 2.0))
+ xscale, _ = transform.transform_point((np.pi, 0))
+ _, yscale = transform.transform_point((0, np.pi / 2.0))
return Affine2D() \
.scale(0.5 / xscale, 0.5 / yscale) \
.translate(0.5, 0.5)
@@ -137,15 +137,15 @@
set_xscale = set_yscale
def set_xlim(self, *args, **kwargs):
- Axes.set_xlim(self, -npy.pi, npy.pi)
- Axes.set_ylim(self, -npy.pi / 2.0, npy.pi / 2.0)
+ Axes.set_xlim(self, -np.pi, np.pi)
+ Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
set_ylim = set_xlim
def format_coord(self, long, lat):
'return a format string formatting the coordinate'
- long = long * (180.0 / npy.pi)
- lat = lat * (180.0 / npy.pi)
+ long = long * (180.0 / np.pi)
+ lat = lat * (180.0 / np.pi)
if lat >= 0.0:
ns = 'N'
else:
@@ -163,7 +163,7 @@
number = (360.0 / degrees) + 1
self.xaxis.set_major_locator(
FixedLocator(
- npy.linspace(-npy.pi, npy.pi, number, True)[1:-1]))
+ np.linspace(-np.pi, np.pi, number, True)[1:-1]))
self._logitude_degrees = degrees
self.xaxis.set_major_formatter(self.ThetaFormatter(degrees))
@@ -174,7 +174,7 @@
number = (180.0 / degrees) + 1
self.yaxis.set_major_locator(
FixedLocator(
- npy.linspace(-npy.pi / 2.0, npy.pi / 2.0, number, True)[1:-1]))
+ np.linspace(-np.pi / 2.0, np.pi / 2.0, number, True)[1:-1]))
self._latitude_degrees = degrees
self.yaxis.set_major_formatter(self.ThetaFormatter(degrees))
@@ -182,7 +182,7 @@
"""
Set the latitude(s) at which to stop drawing the longitude grids.
"""
- self._longitude_cap = degrees * (npy.pi / 180.0)
+ self._longitude_cap = degrees * (np.pi / 180.0)
self._xaxis_pretransform \
.clear() \
.scale(1.0, self._longitude_cap * 2.0) \
@@ -238,19 +238,19 @@
# Pre-compute some values
half_long = longitude / 2.0
- cos_latitude = npy.cos(latitude)
+ cos_latitude = np.cos(latitude)
- alpha = npy.arccos(cos_latitude * npy.cos(half_long))
+ alpha = np.arccos(cos_latitude * np.cos(half_long))
# Mask this array, or we'll get divide-by-zero errors
alpha = ma.masked_where(alpha == 0.0, alpha)
# We want unnormalized sinc. numpy.sinc gives us normalized
sinc_alpha = ma.sin(alpha) / alpha
- x = (cos_latitude * npy.sin(half_long)) / sinc_alpha
- y = (npy.sin(latitude) / sinc_alpha)
+ x = (cos_latitude * np.sin(half_long)) / sinc_alpha
+ y = (np.sin(latitude) / sinc_alpha)
x.set_fill_value(0.0)
y.set_fill_value(0.0)
- return npy.concatenate((x.filled(), y.filled()), 1)
+ return np.concatenate((x.filled(), y.filled()), 1)
transform.__doc__ = Transform.transform.__doc__
transform_non_affine = transform
@@ -288,7 +288,7 @@
inverted.__doc__ = Transform.inverted.__doc__
def __init__(self, *args, **kwargs):
- self._longitude_cap = npy.pi / 2.0
+ self._longitude_cap = np.pi / 2.0
GeoAxes.__init__(self, *args, **kwargs)
self.set_aspect(0.5, adjustable='box', anchor='C')
self.cla()
@@ -323,13 +323,13 @@
# Pre-compute some values
half_long = longitude / 2.0
- cos_latitude = npy.cos(latitude)
- sqrt2 = npy.sqrt(2.0)
+ cos_latitude = np.cos(latitude)
+ sqrt2 = np.sqrt(2.0)
- alpha = 1.0 + cos_latitude * npy.cos(half_long)
- x = (2.0 * sqrt2) * (cos_latitude * npy.sin(half_long)) / alpha
- y = (sqrt2 * npy.sin(latitude)) / alpha
- return npy.concatenate((x, y), 1)
+ alpha = 1.0 + cos_latitude * np.cos(half_long)
+ x = (2.0 * sqrt2) * (cos_latitude * np.sin(half_long)) / alpha
+ y = (sqrt2 * np.sin(latitude)) / alpha
+ return np.concatenate((x, y), 1)
transform.__doc__ = Transform.transform.__doc__
transform_non_affine = transform
@@ -363,10 +363,10 @@
quarter_x = 0.25 * x
half_y = 0.5 * y
- z = npy.sqrt(1.0 - quarter_x*quarter_x - half_y*half_y)
- longitude = 2 * npy.arctan((z*x) / (2.0 * (2.0*z*z - 1.0)))
- latitude = npy.arcsin(y*z)
- return npy.concatenate((longitude, latitude), 1)
+ z = np.sqrt(1.0 - quarter_x*quarter_x - half_y*half_y)
+ longitude = 2 * np.arctan((z*x) / (2.0 * (2.0*z*z - 1.0)))
+ latitude = np.arcsin(y*z)
+ return np.concatenate((longitude, latitude), 1)
transform.__doc__ = Transform.transform.__doc__
def inverted(self):
@@ -374,7 +374,7 @@
inverted.__doc__ = Transform.inverted.__doc__
def __init__(self, *args, **kwargs):
- self._longitude_cap = npy.pi / 2.0
+ self._longitude_cap = np.pi / 2.0
GeoAxes.__init__(self, *args, **kwargs)
self.set_aspect(0.5, adjustable='box', anchor='C')
self.cla()
@@ -407,11 +407,11 @@
longitude = ll[:, 0:1]
latitude = ll[:, 1:2]
- aux = 2.0 * npy.arcsin((2.0 * latitude) / npy.pi)
- x = (2.0 * npy.sqrt(2.0) * longitude * npy.cos(aux)) / npy.pi
- y = (npy.sqrt(2.0) * npy.sin(aux))
+ aux = 2.0 * np.arcsin((2.0 * latitude) / np.pi)
+ x = (2.0 * np.sqrt(2.0) * longitude * np.cos(aux)) / np.pi
+ y = (np.sqrt(2.0) * np.sin(aux))
- return npy.concatenate((x, y), 1)
+ return np.concatenate((x, y), 1)
transform.__doc__ = Transform.transform.__doc__
transform_non_affine = transform
@@ -449,7 +449,7 @@
inverted.__doc__ = Transform.inverted.__doc__
def __init__(self, *args, **kwargs):
- self._longitude_cap = npy.pi / 2.0
+ self._longitude_cap = np.pi / 2.0
GeoAxes.__init__(self, *args, **kwargs)
self.set_aspect(0.5, adjustable='box', anchor='C')
self.cla()
@@ -485,22 +485,22 @@
latitude = ll[:, 1:2]
clong = self._center_longitude
clat = self._center_latitude
- cos_lat = npy.cos(latitude)
- sin_lat = npy.sin(latitude)
+ cos_lat = np.cos(latitude)
+ sin_lat = np.sin(latitude)
diff_long = longitude - clong
- cos_diff_long = npy.cos(diff_long)
+ cos_diff_long = np.cos(diff_long)
inner_k = (1.0 +
- npy.sin(clat)*sin_lat +
- npy.cos(clat)*cos_lat*cos_diff_long)
+ np.sin(clat)*sin_lat +
+ np.cos(clat)*cos_lat*cos_diff_long)
# Prevent divide-by-zero problems
- inner_k = npy.where(inner_k == 0.0, 1e-15, inner_k)
- k = npy.sqrt(2.0 / inner_k)
- x = k*cos_lat*npy.sin(diff_long)
- y = k*(npy.cos(clat)*sin_lat -
- npy.sin(clat)*cos_lat*cos_diff_long)
+ inner_k = np.where(inner_k == 0.0, 1e-15, inner_k)
+ k = np.sqrt(2.0 / inner_k)
+ x = k*cos_lat*np.sin(diff_long)
+ y = k*(np.cos(clat)*sin_lat -
+ np.sin(clat)*cos_lat*cos_diff_long)
- return npy.concatenate((x, y), 1)
+ return np.concatenate((x, y), 1)
transform.__doc__ = Transform.transform.__doc__
transform_non_affine = transform
@@ -538,18 +538,18 @@
y = xy[:, 1:2]
clong = self._center_longitude
clat = self._center_latitude
- p = npy.sqrt(x*x + y*y)
- p = npy.where(p == 0.0, 1e-9, p)
- c = 2.0 * npy.arcsin(0.5 * p)
- sin_c = npy.sin(c)
- cos_c = npy.cos(c)
+ p = np.sqrt(x*x + y*y)
+ p = np.where(p == 0.0, 1e-9, p)
+ c = 2.0 * np.arcsin(0.5 * p)
+ sin_c = np.sin(c)
+ cos_c = np.cos(c)
- lat = npy.arcsin(cos_c*npy.sin(clat) +
- ((y*sin_c*npy.cos(clat)) / p))
- long = clong + npy.arctan(
- (x*sin_c) / (p*npy.cos(clat)*cos_c - y*npy.sin(clat)*sin_c))
+ lat = np.arcsin(cos_c*np.sin(clat) +
+ ((y*sin_c*np.cos(clat)) / p))
+ long = clong + np.arctan(
+ (x*sin_c) / (p*np.cos(clat)*cos_c - y*np.sin(clat)*sin_c))
- return npy.concatenate((long, lat), 1)
+ return np.concatenate((long, lat), 1)
transform.__doc__ = Transform.transform.__doc__
def inverted(self):
@@ -560,7 +560,7 @@
inverted.__doc__ = Transform.inverted.__doc__
def __init__(self, *args, **kwargs):
- self._longitude_cap = npy.pi / 2.0
+ self._longitude_cap = np.pi / 2.0
self._center_longitude = kwargs.pop("center_longitude", 0.0)
self._center_latitude = kwargs.pop("center_latitude", 0.0)
GeoAxes.__init__(self, *args, **kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|