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: <lee...@us...> - 2010-03-22 16:47:33
|
Revision: 8210
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8210&view=rev
Author: leejjoon
Date: 2010-03-22 16:47:27 +0000 (Mon, 22 Mar 2010)
Log Message:
-----------
fix incorrect rubber band during the zoom mode when mouse the axes
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-03-21 22:02:31 UTC (rev 8209)
+++ trunk/matplotlib/CHANGELOG 2010-03-22 16:47:27 UTC (rev 8210)
@@ -1,3 +1,6 @@
+2010-03-22 fix incorrect rubber band during the zoom mode when mouse
+ leaves the axes. -JJL
+
2010-03-21 x/y key during the zoom mode only changes the x/y limits. -JJL
2010-03-20 Added pyplot.sca() function suggested by JJL. - EF
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-03-21 22:02:31 UTC (rev 8209)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-03-22 16:47:27 UTC (rev 8210)
@@ -2124,18 +2124,6 @@
if self._lastCursor != cursors.SELECT_REGION:
self.set_cursor(cursors.SELECT_REGION)
self._lastCursor = cursors.SELECT_REGION
- if self._xypress:
- x, y = event.x, event.y
- lastx, lasty, a, ind, lim, trans = self._xypress[0]
-
- if self._zoom_mode == "x":
- x1, y1, x2, y2 = event.inaxes.bbox.extents
- y, lasty = y1, y2
- elif self._zoom_mode == "y":
- x1, y1, x2, y2 = event.inaxes.bbox.extents
- x, lastx = x1, x2
-
- self.draw_rubberband(event, x, y, lastx, lasty)
elif (self._active=='PAN' and
self._lastCursor != cursors.MOVE):
self.set_cursor(cursors.MOVE)
@@ -2237,12 +2225,14 @@
and a.get_navigate() and a.can_zoom():
self._xypress.append(( x, y, a, i, a.viewLim.frozen(), a.transData.frozen()))
- id1 = self.canvas.mpl_connect('key_press_event',
+ id1 = self.canvas.mpl_connect('motion_notify_event', self.drag_zoom)
+
+ id2 = self.canvas.mpl_connect('key_press_event',
self._switch_on_zoom_mode)
- id2 = self.canvas.mpl_connect('key_release_event',
+ id3 = self.canvas.mpl_connect('key_release_event',
self._switch_off_zoom_mode)
- self._ids_zoom = id1, id2
+ self._ids_zoom = id1, id2, id3
self._zoom_mode = event.key
@@ -2301,6 +2291,29 @@
a.drag_pan(self._button_pressed, event.key, event.x, event.y)
self.dynamic_update()
+ def drag_zoom(self, event):
+ 'the drag callback in zoom mode'
+
+ if self._xypress:
+ x, y = event.x, event.y
+ lastx, lasty, a, ind, lim, trans = self._xypress[0]
+
+ # adjust x, last, y, last
+ x1, y1, x2, y2 = a.bbox.extents
+ x, lastx = max(min(x, lastx), x1), min(max(x, lastx), x2)
+ y, lasty = max(min(y, lasty), y1), min(max(y, lasty), y2)
+
+ if self._zoom_mode == "x":
+ x1, y1, x2, y2 = a.bbox.extents
+ y, lasty = y1, y2
+ elif self._zoom_mode == "y":
+ x1, y1, x2, y2 = a.bbox.extents
+ x, lastx = x1, x2
+
+ self.draw_rubberband(event, x, y, lastx, lasty)
+
+
+
def release_zoom(self, event):
'the release mouse button callback in zoom to rect mode'
if not self._xypress: return
@@ -2313,7 +2326,6 @@
for cur_xypress in self._xypress:
x, y = event.x, event.y
lastx, lasty, a, ind, lim, trans = cur_xypress
-
# ignore singular clicks - 5 pixels is a threshold
if abs(x-lastx)<5 or abs(y-lasty)<5:
self._xypress = None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-03-21 22:02:38
|
Revision: 8209
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8209&view=rev
Author: leejjoon
Date: 2010-03-21 22:02:31 +0000 (Sun, 21 Mar 2010)
Log Message:
-----------
x or y key during the zoom mode only change the x or y limits
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-03-21 19:27:52 UTC (rev 8208)
+++ trunk/matplotlib/CHANGELOG 2010-03-21 22:02:31 UTC (rev 8209)
@@ -1,3 +1,5 @@
+2010-03-21 x/y key during the zoom mode only changes the x/y limits. -JJL
+
2010-03-20 Added pyplot.sca() function suggested by JJL. - EF
2010-03-20 Added conditional support for new Tooltip API in gtk backend. - EF
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-03-21 19:27:52 UTC (rev 8208)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-03-21 22:02:31 UTC (rev 8209)
@@ -2049,6 +2049,10 @@
self._lastCursor = None
self._init_toolbar()
self._idDrag=self.canvas.mpl_connect('motion_notify_event', self.mouse_move)
+
+ self._ids_zoom = None
+ self._zoom_mode = None
+
self._button_pressed = None # determined by the button pressed at start
self.mode = '' # a mode string for the status bar
@@ -2123,6 +2127,14 @@
if self._xypress:
x, y = event.x, event.y
lastx, lasty, a, ind, lim, trans = self._xypress[0]
+
+ if self._zoom_mode == "x":
+ x1, y1, x2, y2 = event.inaxes.bbox.extents
+ y, lasty = y1, y2
+ elif self._zoom_mode == "y":
+ x1, y1, x2, y2 = event.inaxes.bbox.extents
+ x, lastx = x1, x2
+
self.draw_rubberband(event, x, y, lastx, lasty)
elif (self._active=='PAN' and
self._lastCursor != cursors.MOVE):
@@ -2225,8 +2237,26 @@
and a.get_navigate() and a.can_zoom():
self._xypress.append(( x, y, a, i, a.viewLim.frozen(), a.transData.frozen()))
+ id1 = self.canvas.mpl_connect('key_press_event',
+ self._switch_on_zoom_mode)
+ id2 = self.canvas.mpl_connect('key_release_event',
+ self._switch_off_zoom_mode)
+
+ self._ids_zoom = id1, id2
+
+ self._zoom_mode = event.key
+
+
self.press(event)
+ def _switch_on_zoom_mode(self, event):
+ self._zoom_mode = event.key
+ self.mouse_move(event)
+
+ def _switch_off_zoom_mode(self, event):
+ self._zoom_mode = None
+ self.mouse_move(event)
+
def push_current(self):
'push the current view limits and position onto the stack'
lims = []; pos = []
@@ -2275,6 +2305,9 @@
'the release mouse button callback in zoom to rect mode'
if not self._xypress: return
+ for zoom_id in self._ids_zoom:
+ self.canvas.mpl_disconnect(zoom_id)
+
last_a = []
for cur_xypress in self._xypress:
@@ -2334,8 +2367,13 @@
if y1 < Ymax: y1=Ymax
if self._button_pressed == 1:
- a.set_xlim((x0, x1))
- a.set_ylim((y0, y1))
+ if self._zoom_mode == "x":
+ a.set_xlim((x0, x1))
+ elif self._zoom_mode == "y":
+ a.set_ylim((y0, y1))
+ else:
+ a.set_xlim((x0, x1))
+ a.set_ylim((y0, y1))
elif self._button_pressed == 3:
if a.get_xscale()=='log':
alpha=np.log(Xmax/Xmin)/np.log(x1/x0)
@@ -2353,13 +2391,21 @@
alpha=(Ymax-Ymin)/(y1-y0)
ry1=alpha*(Ymin-y0)+Ymin
ry2=alpha*(Ymax-y0)+Ymin
- a.set_xlim((rx1, rx2))
- a.set_ylim((ry1, ry2))
+ if self._zoom_mode == "x":
+ a.set_xlim((rx1, rx2))
+ elif self._zoom_mode == "y":
+ a.set_ylim((ry1, ry2))
+ else:
+ a.set_xlim((rx1, rx2))
+ a.set_ylim((ry1, ry2))
+
self.draw()
self._xypress = None
self._button_pressed = None
+ self._zoom_mode = None
+
self.push_current()
self.release(event)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2010-03-21 19:28:00
|
Revision: 8208
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8208&view=rev
Author: ryanmay
Date: 2010-03-21 19:27:52 +0000 (Sun, 21 Mar 2010)
Log Message:
-----------
Add second example from scipy cookbook to this script, showing the use of more traditional colormapping.
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/multicolored_line.py
Modified: trunk/matplotlib/examples/pylab_examples/multicolored_line.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/multicolored_line.py 2010-03-21 17:43:11 UTC (rev 8207)
+++ trunk/matplotlib/examples/pylab_examples/multicolored_line.py 2010-03-21 19:27:52 UTC (rev 8208)
@@ -28,9 +28,26 @@
lc = LineCollection(segments, cmap=cmap, norm=norm)
lc.set_array(z)
lc.set_linewidth(3)
+
+fig1 = plt.figure()
plt.gca().add_collection(lc)
-
plt.xlim(x.min(), x.max())
plt.ylim(-1.1, 1.1)
+
+# Now do a second plot coloring the curve using a continuous colormap
+t = np.linspace(0, 10, 200)
+x = np.cos(np.pi * t)
+y = np.sin(t)
+points = np.array([x, y]).T.reshape(-1, 1, 2)
+segments = np.concatenate([points[:-1], points[1:]], axis=1)
+
+lc = LineCollection(segments, cmap=plt.get_cmap('copper'),
+ norm=plt.Normalize(0, 10))
+lc.set_array(t)
+lc.set_linewidth(3)
+
+fig2 = plt.figure()
+plt.gca().add_collection(lc)
+plt.xlim(-1, 1)
+plt.ylim(-1, 1)
plt.show()
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2010-03-21 17:43:21
|
Revision: 8207
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8207&view=rev
Author: ryanmay
Date: 2010-03-21 17:43:11 +0000 (Sun, 21 Mar 2010)
Log Message:
-----------
Add multicolored line example based on an example from the scipy.org cookbook cleaned up to use colormaps.
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/multicolored_line.py
Added: trunk/matplotlib/examples/pylab_examples/multicolored_line.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/multicolored_line.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/multicolored_line.py 2010-03-21 17:43:11 UTC (rev 8207)
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+'''
+Color parts of a line based on its properties, e.g., slope.
+'''
+import numpy as np
+import matplotlib.pyplot as plt
+from matplotlib.collections import LineCollection
+from matplotlib.colors import ListedColormap, BoundaryNorm
+
+x = np.linspace(0, 3 * np.pi, 500)
+y = np.sin(x)
+z = np.cos(0.5 * (x[:-1] + x[1:])) # first derivative
+
+# Create a colormap for red, green and blue and a norm to color
+# f' < -0.5 red, f' > 0.5 blue, and the rest green
+cmap = ListedColormap(['r', 'g', 'b'])
+norm = BoundaryNorm([-1, -0.5, 0.5, 1], cmap.N)
+
+# Create a set of line segments so that we can color them individually
+# This creates the points as a N x 1 x 2 array so that we can stack points
+# together easily to get the segments. The segments array for line collection
+# needs to be numlines x points per line x 2 (x and y)
+points = np.array([x, y]).T.reshape(-1, 1, 2)
+segments = np.concatenate([points[:-1], points[1:]], axis=1)
+
+# Create the line collection object, setting the colormapping parameters.
+# Have to set the actual values used for colormapping separately.
+lc = LineCollection(segments, cmap=cmap, norm=norm)
+lc.set_array(z)
+lc.set_linewidth(3)
+plt.gca().add_collection(lc)
+
+plt.xlim(x.min(), x.max())
+plt.ylim(-1.1, 1.1)
+plt.show()
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-03-21 01:27:26
|
Revision: 8206
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8206&view=rev
Author: efiring
Date: 2010-03-21 01:27:15 +0000 (Sun, 21 Mar 2010)
Log Message:
-----------
installing.rst: we require pygtk >= 2.4, not 2.2
Modified Paths:
--------------
trunk/matplotlib/doc/users/installing.rst
Modified: trunk/matplotlib/doc/users/installing.rst
===================================================================
--- trunk/matplotlib/doc/users/installing.rst 2010-03-21 00:39:04 UTC (rev 8205)
+++ trunk/matplotlib/doc/users/installing.rst 2010-03-21 01:27:15 UTC (rev 8206)
@@ -162,14 +162,17 @@
:term:`pyqt` 4.0 or later
The Qt4 widgets library python wrappers for the Qt4Agg backend
-:term:`pygtk` 2.2 or later
- The python wrappers for the GTK widgets library for use with the GTK or GTKAgg backend
+:term:`pygtk` 2.4 or later
+ The python wrappers for the GTK widgets library for use with the
+ GTK or GTKAgg backend
:term:`wxpython` 2.6 or later
- The python wrappers for the wx widgets library for use with the WXAgg backend
+ The python wrappers for the wx widgets library for use with the
+ WXAgg backend
:term:`wxpython` 2.8 or later
- The python wrappers for the wx widgets library for use with the WX backend
+ The python wrappers for the wx widgets library for use with the
+ WX backend
:term:`pyfltk` 1.0 or later
The python wrappers of the FLTK widgets library for use with FLTKAgg
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-03-21 00:39:12
|
Revision: 8205
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8205&view=rev
Author: efiring
Date: 2010-03-21 00:39:04 +0000 (Sun, 21 Mar 2010)
Log Message:
-----------
pyplot: new sca() function suggested by LJJ
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-03-20 23:24:29 UTC (rev 8204)
+++ trunk/matplotlib/CHANGELOG 2010-03-21 00:39:04 UTC (rev 8205)
@@ -1,3 +1,5 @@
+2010-03-20 Added pyplot.sca() function suggested by JJL. - EF
+
2010-03-20 Added conditional support for new Tooltip API in gtk backend. - EF
2010-03-20 Changed plt.fig_subplot() to plt.subplots() after discussion on
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2010-03-20 23:24:29 UTC (rev 8204)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2010-03-21 00:39:04 UTC (rev 8205)
@@ -549,9 +549,20 @@
draw_if_interactive()
return ret
+def sca(ax):
+ """
+ Set the current Axes instance to *ax*. The current Figure
+ is updated to the parent of *ax*.
+ """
+ managers = _pylab_helpers.Gcf.get_all_fig_managers()
+ for m in managers:
+ if ax in m.canvas.figure.axes:
+ _pylab_helpers.Gcf.set_active(m)
+ m.canvas.figure.sca(ax)
+ return
+ raise ValueError("Axes instance argument was not found in a figure.")
-
def gca(**kwargs):
"""
Return the current axis instance. This can be used to control
@@ -656,7 +667,7 @@
subplots, including the enclosing figure object, in a single call.
Keyword arguments:
-
+
nrows : int
Number of rows of the subplot grid. Defaults to 1.
@@ -670,7 +681,7 @@
If True, the Y axis will be shared amongst all subplots.
squeeze : bool
-
+
If True, extra dimensions are squeezed out from the returned axis object:
- if only one subplot is constructed (nrows=ncols=1), the resulting
single Axis object is returned as a scalar.
@@ -696,7 +707,7 @@
- ax can be either a single axis object or an array of axis objects if
more than one supblot was created. The dimensions of the resulting array
can be controlled with the squeeze keyword, see above.
-
+
**Examples:**
x = np.linspace(0, 2*np.pi, 400)
@@ -706,7 +717,7 @@
f, ax = plt.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
-
+
# Two subplots, unpack the output array immediately
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
@@ -719,11 +730,11 @@
if subplot_kw is None:
subplot_kw = {}
-
+
fig = figure(**fig_kw)
# Create empty object array to hold all axes. It's easiest to make it 1-d
- # so we can just append subplots upon creation, and then
+ # so we can just append subplots upon creation, and then
nplots = nrows*ncols
axarr = np.empty(nplots, dtype=object)
@@ -734,9 +745,9 @@
if sharey:
subplot_kw['sharey'] = ax0
axarr[0] = ax0
-
+
# Note off-by-one counting because add_subplot uses the matlab 1-based
- # convention.
+ # convention.
for i in range(1, nplots):
axarr[i] = fig.add_subplot(nrows, ncols, i+1, **subplot_kw)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-03-20 23:24:37
|
Revision: 8204
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8204&view=rev
Author: efiring
Date: 2010-03-20 23:24:29 +0000 (Sat, 20 Mar 2010)
Log Message:
-----------
CHANGELOG update and format fixups; fix python version info in INSTALL
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/INSTALL
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-03-20 22:49:25 UTC (rev 8203)
+++ trunk/matplotlib/CHANGELOG 2010-03-20 23:24:29 UTC (rev 8204)
@@ -1,16 +1,20 @@
+2010-03-20 Added conditional support for new Tooltip API in gtk backend. - EF
+
2010-03-20 Changed plt.fig_subplot() to plt.subplots() after discussion on
- list, and changed its API to return axes as a numpy object array
- (with control of dimensions via squeeze keyword). FP.
+ list, and changed its API to return axes as a numpy object array
+ (with control of dimensions via squeeze keyword). FP.
2010-03-13 Manually brought in commits from branch
------------------------------------------------------------------------
r8191 | leejjoon | 2010-03-13 17:27:57 -0500 (Sat, 13 Mar 2010) | 1 line
- fix the bug that handles for scatter are incorrectly set when dpi!=72. Thanks to Ray Speth for the bug report.
+ fix the bug that handles for scatter are incorrectly set when dpi!=72.
+ Thanks to Ray Speth for the bug report.
-2010-03-03 Manually brought in commits from branch via diff/patch (svnmerge is broken)
+2010-03-03 Manually brought in commits from branch via diff/patch
+ (svnmerge is broken)
------------------------------------------------------------------------
r8175 | leejjoon | 2010-03-03 10:03:30 -0800 (Wed, 03 Mar 2010) | 1 line
@@ -35,15 +39,15 @@
2010-02-25 add annotation_demo3.py that demonstrates new functionality. -JJL
-2010-02-25 refactor Annotation to support arbitrary Transform as xycoords
- or textcoords. Also, if a tuple of two coordinates is provided,
- they are interpreted as coordinates for each x and y position.
+2010-02-25 refactor Annotation to support arbitrary Transform as xycoords
+ or textcoords. Also, if a tuple of two coordinates is provided,
+ they are interpreted as coordinates for each x and y position.
-JJL
2010-02-24 Added pyplot.fig_subplot(), to create a figure and a group of
- subplots in a single call. This offers an easier pattern than
- manually making figures and calling add_subplot() multiple times. FP
-
+ subplots in a single call. This offers an easier pattern than
+ manually making figures and calling add_subplot() multiple times. FP
+
2010-02-17 Added Gokhan's and Mattias' customizable keybindings patch
for the toolbar. You can now set the keymap.* properties
in the matplotlibrc file. Newbindings were added for
@@ -67,7 +71,7 @@
warnings can be turned into fatal errors easily if desired. - FP
2010-01-29 Added draggable method to Legend to allow mouse drag
-placement. Thanks Adam Fraser. JDH
+ placement. Thanks Adam Fraser. JDH
2010-01-25 Fixed a bug reported by Olle Engdegard, when using
histograms with stepfilled and log=True - MM
Modified: trunk/matplotlib/INSTALL
===================================================================
--- trunk/matplotlib/INSTALL 2010-03-20 22:49:25 UTC (rev 8203)
+++ trunk/matplotlib/INSTALL 2010-03-20 23:24:29 UTC (rev 8204)
@@ -1,7 +1,7 @@
INTRODUCTION
- matplotlib requires at a minimum python 2.3, numpy, libpng and
+ matplotlib requires at a minimum python 2.4, numpy, libpng and
freetype. To get the most out of matplotlib, you will want to build
some of the optional GUI and image extensions, discussed below.
Matplotlib is known to work on linux, unix, win32 and OS X
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-03-20 22:49:33
|
Revision: 8203
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8203&view=rev
Author: efiring
Date: 2010-03-20 22:49:25 +0000 (Sat, 20 Mar 2010)
Log Message:
-----------
backend_gtk: support new tooltip API for pygtk >= 2.12
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-03-20 08:58:06 UTC (rev 8202)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-03-20 22:49:25 UTC (rev 8203)
@@ -17,6 +17,8 @@
% (gtk.pygtk_version + pygtk_version_required))
del pygtk_version_required
+_new_tooltip_api = (gtk.pygtk_version[1] >= 12)
+
import matplotlib
from matplotlib import verbose
from matplotlib._pylab_helpers import Gcf
@@ -448,7 +450,7 @@
# diong a blanket catch here, but an not sure what a
# better way is - JDH
verbose.report('Could not load matplotlib icon: %s' % sys.exc_info()[1])
-
+
self.vbox = gtk.VBox()
self.window.add(self.vbox)
self.vbox.show()
@@ -618,7 +620,8 @@
def _init_toolbar2_4(self):
basedir = os.path.join(matplotlib.rcParams['datapath'],'images')
- self.tooltips = gtk.Tooltips()
+ if not _new_tooltip_api:
+ self.tooltips = gtk.Tooltips()
for text, tooltip_text, image_file, callback in self.toolitems:
if text is None:
@@ -630,7 +633,10 @@
tbutton = gtk.ToolButton(image, text)
self.insert(tbutton, -1)
tbutton.connect('clicked', getattr(self, callback))
- tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private')
+ if _new_tooltip_api:
+ tbutton.set_tooltip_text(tooltip_text)
+ else:
+ tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private')
toolitem = gtk.SeparatorToolItem()
self.insert(toolitem, -1)
@@ -760,7 +766,8 @@
def _create_toolitems_2_4(self):
# use the GTK+ 2.4 GtkToolbar API
iconSize = gtk.ICON_SIZE_SMALL_TOOLBAR
- self.tooltips = gtk.Tooltips()
+ if not _new_tooltip_api:
+ self.tooltips = gtk.Tooltips()
for text, tooltip_text, image_num, callback, callback_arg, scroll \
in self.toolitems:
@@ -778,15 +785,22 @@
tbutton.connect('clicked', getattr(self, callback))
if scroll:
tbutton.connect('scroll_event', getattr(self, callback))
- tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private')
+ if _new_tooltip_api:
+ tbutton.set_tooltip_text(tooltip_text)
+ else:
+ tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private')
# Axes toolitem, is empty at start, update() adds a menu if >=2 axes
self.axes_toolitem = gtk.ToolItem()
self.insert(self.axes_toolitem, 0)
- self.axes_toolitem.set_tooltip (
- self.tooltips,
- tip_text='Select axes that controls affect',
- tip_private = 'Private')
+ if _new_tooltip_api:
+ self.axes_toolitem.set_tooltip_text(
+ 'Select axes that controls affect')
+ else:
+ self.axes_toolitem.set_tooltip (
+ self.tooltips,
+ tip_text='Select axes that controls affect',
+ tip_private = 'Private')
align = gtk.Alignment (xalign=0.5, yalign=0.5, xscale=0.0, yscale=0.0)
self.axes_toolitem.add(align)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2010-03-20 08:58:15
|
Revision: 8202
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8202&view=rev
Author: fer_perez
Date: 2010-03-20 08:58:06 +0000 (Sat, 20 Mar 2010)
Log Message:
-----------
Renamed to match new function name.
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/subplots_demo.py
Removed Paths:
-------------
trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py
Deleted: trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py 2010-03-20 08:57:37 UTC (rev 8201)
+++ trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py 2010-03-20 08:58:06 UTC (rev 8202)
@@ -1,63 +0,0 @@
-"""Examples illustrating the use of plt.subplots().
-
-This function creates a figure and a grid of subplots with a single call, while
-providing reasonable control over how the individual plots are created. For
-very refined tuning of subplot creation, you can still use add_subplot()
-directly on a new figure.
-"""
-
-import matplotlib.pyplot as plt
-import numpy as np
-
-# Simple data to display in various forms
-x = np.linspace(0, 2*np.pi, 400)
-y = np.sin(x**2)
-
-plt.close('all')
-
-# Just a figure and one subplot
-f, ax = plt.subplots()
-ax.plot(x, y)
-ax.set_title('Simple plot')
-
-# Two subplots, the axes array is 1-d
-f, axarr = plt.subplots(2, sharex=True)
-axarr[0].plot(x, y)
-axarr[0].set_title('Sharing X axis')
-axarr[1].scatter(x, y)
-
-# Two subplots, unpack the axes array immediately
-f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
-ax1.plot(x, y)
-ax1.set_title('Sharing Y axis')
-ax2.scatter(x, y)
-
-# Three subplots sharing both x/y axes
-f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True, sharey=True)
-ax1.plot(x, y)
-ax1.set_title('Sharing both axes')
-ax2.scatter(x, y)
-ax3.scatter(x, 2*y**2-1,color='r')
-# Fine-tune figure; make subplots close to each other and hide x ticks for
-# all but bottom plot.
-f.subplots_adjust(hspace=0)
-plt.setp([a.get_xticklabels() for a in f.axes[:-1]], visible=False)
-
-# Four axes, returned as a 2-d array
-f, axarr = plt.subplots(2, 2)
-axarr[0,0].plot(x, y)
-axarr[0,0].set_title('Axis [0,0]')
-axarr[0,1].scatter(x, y)
-axarr[0,1].set_title('Axis [0,1]')
-axarr[1,0].plot(x, y**2)
-axarr[1,0].set_title('Axis [1,0]')
-axarr[1,1].scatter(x, y**2)
-axarr[1,1].set_title('Axis [1,1]')
-# Fine-tune figure; hide x ticks for top plots and y ticks for right plots
-plt.setp([a.get_xticklabels() for a in axarr[0,:]], visible=False)
-plt.setp([a.get_yticklabels() for a in axarr[:,1]], visible=False)
-
-# Four polar axes
-plt.subplots(2, 2, subplot_kw=dict(polar=True))
-
-plt.show()
Copied: trunk/matplotlib/examples/pylab_examples/subplots_demo.py (from rev 8201, trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py)
===================================================================
--- trunk/matplotlib/examples/pylab_examples/subplots_demo.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/subplots_demo.py 2010-03-20 08:58:06 UTC (rev 8202)
@@ -0,0 +1,63 @@
+"""Examples illustrating the use of plt.subplots().
+
+This function creates a figure and a grid of subplots with a single call, while
+providing reasonable control over how the individual plots are created. For
+very refined tuning of subplot creation, you can still use add_subplot()
+directly on a new figure.
+"""
+
+import matplotlib.pyplot as plt
+import numpy as np
+
+# Simple data to display in various forms
+x = np.linspace(0, 2*np.pi, 400)
+y = np.sin(x**2)
+
+plt.close('all')
+
+# Just a figure and one subplot
+f, ax = plt.subplots()
+ax.plot(x, y)
+ax.set_title('Simple plot')
+
+# Two subplots, the axes array is 1-d
+f, axarr = plt.subplots(2, sharex=True)
+axarr[0].plot(x, y)
+axarr[0].set_title('Sharing X axis')
+axarr[1].scatter(x, y)
+
+# Two subplots, unpack the axes array immediately
+f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
+ax1.plot(x, y)
+ax1.set_title('Sharing Y axis')
+ax2.scatter(x, y)
+
+# Three subplots sharing both x/y axes
+f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True, sharey=True)
+ax1.plot(x, y)
+ax1.set_title('Sharing both axes')
+ax2.scatter(x, y)
+ax3.scatter(x, 2*y**2-1,color='r')
+# Fine-tune figure; make subplots close to each other and hide x ticks for
+# all but bottom plot.
+f.subplots_adjust(hspace=0)
+plt.setp([a.get_xticklabels() for a in f.axes[:-1]], visible=False)
+
+# Four axes, returned as a 2-d array
+f, axarr = plt.subplots(2, 2)
+axarr[0,0].plot(x, y)
+axarr[0,0].set_title('Axis [0,0]')
+axarr[0,1].scatter(x, y)
+axarr[0,1].set_title('Axis [0,1]')
+axarr[1,0].plot(x, y**2)
+axarr[1,0].set_title('Axis [1,0]')
+axarr[1,1].scatter(x, y**2)
+axarr[1,1].set_title('Axis [1,1]')
+# Fine-tune figure; hide x ticks for top plots and y ticks for right plots
+plt.setp([a.get_xticklabels() for a in axarr[0,:]], visible=False)
+plt.setp([a.get_yticklabels() for a in axarr[:,1]], visible=False)
+
+# Four polar axes
+plt.subplots(2, 2, subplot_kw=dict(polar=True))
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2010-03-20 08:57:45
|
Revision: 8201
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8201&view=rev
Author: fer_perez
Date: 2010-03-20 08:57:37 +0000 (Sat, 20 Mar 2010)
Log Message:
-----------
Renamed fig_subplot to suplots(), now returns numpy array with axes.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-03-20 00:29:19 UTC (rev 8200)
+++ trunk/matplotlib/CHANGELOG 2010-03-20 08:57:37 UTC (rev 8201)
@@ -1,3 +1,7 @@
+2010-03-20 Changed plt.fig_subplot() to plt.subplots() after discussion on
+ list, and changed its API to return axes as a numpy object array
+ (with control of dimensions via squeeze keyword). FP.
+
2010-03-13 Manually brought in commits from branch
------------------------------------------------------------------------
Modified: trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py 2010-03-20 00:29:19 UTC (rev 8200)
+++ trunk/matplotlib/examples/pylab_examples/fig_subplot_demo.py 2010-03-20 08:57:37 UTC (rev 8201)
@@ -1,32 +1,39 @@
+"""Examples illustrating the use of plt.subplots().
+
+This function creates a figure and a grid of subplots with a single call, while
+providing reasonable control over how the individual plots are created. For
+very refined tuning of subplot creation, you can still use add_subplot()
+directly on a new figure.
"""
-"""
+
import matplotlib.pyplot as plt
import numpy as np
+# Simple data to display in various forms
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
plt.close('all')
# Just a figure and one subplot
-f, ax = plt.fig_subplot()
+f, ax = plt.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
-# Two subplots, grab the whole fig_axes list
-fax = plt.fig_subplot(2, sharex=True)
-fax[1].plot(x, y)
-fax[1].set_title('Sharing X axis')
-fax[2].scatter(x, y)
+# Two subplots, the axes array is 1-d
+f, axarr = plt.subplots(2, sharex=True)
+axarr[0].plot(x, y)
+axarr[0].set_title('Sharing X axis')
+axarr[1].scatter(x, y)
-# Two subplots, unpack the output immediately
-f, ax1, ax2 = plt.fig_subplot(1, 2, sharey=True)
+# Two subplots, unpack the axes array immediately
+f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
# Three subplots sharing both x/y axes
-f, ax1, ax2, ax3 = plt.fig_subplot(3, sharex=True, sharey=True)
+f, (ax1, ax2, ax3) = plt.subplots(3, sharex=True, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing both axes')
ax2.scatter(x, y)
@@ -36,7 +43,21 @@
f.subplots_adjust(hspace=0)
plt.setp([a.get_xticklabels() for a in f.axes[:-1]], visible=False)
+# Four axes, returned as a 2-d array
+f, axarr = plt.subplots(2, 2)
+axarr[0,0].plot(x, y)
+axarr[0,0].set_title('Axis [0,0]')
+axarr[0,1].scatter(x, y)
+axarr[0,1].set_title('Axis [0,1]')
+axarr[1,0].plot(x, y**2)
+axarr[1,0].set_title('Axis [1,0]')
+axarr[1,1].scatter(x, y**2)
+axarr[1,1].set_title('Axis [1,1]')
+# Fine-tune figure; hide x ticks for top plots and y ticks for right plots
+plt.setp([a.get_xticklabels() for a in axarr[0,:]], visible=False)
+plt.setp([a.get_yticklabels() for a in axarr[:,1]], visible=False)
+
# Four polar axes
-plt.fig_subplot(2, 2, subplot_kw=dict(polar=True))
+plt.subplots(2, 2, subplot_kw=dict(polar=True))
plt.show()
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2010-03-20 00:29:19 UTC (rev 8200)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2010-03-20 08:57:37 UTC (rev 8201)
@@ -79,7 +79,6 @@
new_figure_manager, draw_if_interactive, show = pylab_setup()
-
def findobj(o=None, match=None):
if o is None:
o = gcf()
@@ -649,7 +648,7 @@
return a
-def fig_subplot(nrows=1, ncols=1, sharex=False, sharey=False,
+def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
subplot_kw=None, **fig_kw):
"""Create a figure with a set of subplots already made.
@@ -661,7 +660,7 @@
nrows : int
Number of rows of the subplot grid. Defaults to 1.
- nrows : int
+ ncols : int
Number of columns of the subplot grid. Defaults to 1.
sharex : bool
@@ -670,6 +669,18 @@
sharex : bool
If True, the Y axis will be shared amongst all subplots.
+ squeeze : bool
+
+ If True, extra dimensions are squeezed out from the returned axis object:
+ - if only one subplot is constructed (nrows=ncols=1), the resulting
+ single Axis object is returned as a scalar.
+ - for Nx1 or 1xN subplots, the returned object is a 1-d numpy object
+ array of Axis objects are returned as numpy 1-d arrays.
+ - for NxM subplots with N>1 and M>1 are returned as a 2d array.
+
+ If False, no squeezing at all is done: the returned axis object is always
+ a 2-d array contaning Axis instances, even if it ends up being 1x1.
+
subplot_kw : dict
Dict with keywords passed to the add_subplot() call used to create each
subplots.
@@ -680,28 +691,30 @@
Returns:
- fig_axes : list
- A list containing [fig, ax1, ax2, ...], where fig is the Matplotlib
- Figure object and the rest are the axes.
-
+ fig, ax : tuple
+ - fig is the Matplotlib Figure object
+ - ax can be either a single axis object or an array of axis objects if
+ more than one supblot was created. The dimensions of the resulting array
+ can be controlled with the squeeze keyword, see above.
+
**Examples:**
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Just a figure and one subplot
- f, ax = plt.fig_subplot()
+ f, ax = plt.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
- # Two subplots, unpack the output immediately
- f, ax1, ax2 = plt.fig_subplot(1, 2, sharey=True)
+ # Two subplots, unpack the output array immediately
+ f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
# Four polar axes
- plt.fig_subplot(2, 2, subplot_kw=dict(polar=True))
+ plt.subplots(2, 2, subplot_kw=dict(polar=True))
"""
if subplot_kw is None:
@@ -709,20 +722,37 @@
fig = figure(**fig_kw)
+ # Create empty object array to hold all axes. It's easiest to make it 1-d
+ # so we can just append subplots upon creation, and then
+ nplots = nrows*ncols
+ axarr = np.empty(nplots, dtype=object)
+
# Create first subplot separately, so we can share it if requested
- ax1 = fig.add_subplot(nrows, ncols, 1, **subplot_kw)
+ ax0 = fig.add_subplot(nrows, ncols, 1, **subplot_kw)
if sharex:
- subplot_kw['sharex'] = ax1
+ subplot_kw['sharex'] = ax0
if sharey:
- subplot_kw['sharey'] = ax1
+ subplot_kw['sharey'] = ax0
+ axarr[0] = ax0
+
+ # Note off-by-one counting because add_subplot uses the matlab 1-based
+ # convention.
+ for i in range(1, nplots):
+ axarr[i] = fig.add_subplot(nrows, ncols, i+1, **subplot_kw)
- # Valid indices for axes start at 1, since fig is at 0:
- axes = [ fig.add_subplot(nrows, ncols, i, **subplot_kw)
- for i in range(2, nrows*ncols+1)]
+ if squeeze:
+ # Reshape the array to have the final desired dimension (nrow,ncol),
+ # though discarding unneeded dimensions that equal 1. If we only have
+ # one subplot, just return it instead of a 1-element array.
+ if nplots==1:
+ return fig, axarr[0]
+ else:
+ return fig, axarr.reshape(nrows, ncols).squeeze()
+ else:
+ # returned axis array will be always 2-d, even if nrows=ncols=1
+ return fig, axarr.reshape(nrows, ncols)
- return [fig, ax1] + axes
-
def twinx(ax=None):
"""
Make a second axes overlay *ax* (or the current axes if *ax* is
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-20 00:29:27
|
Revision: 8200
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8200&view=rev
Author: heeres
Date: 2010-03-20 00:29:19 +0000 (Sat, 20 Mar 2010)
Log Message:
-----------
Add view angle patch + comment
Modified Paths:
--------------
trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
Modified: trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-03-19 17:12:41 UTC (rev 8199)
+++ trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-03-20 00:29:19 UTC (rev 8200)
@@ -59,16 +59,16 @@
self.fig = fig
self._cids = []
- azim = kwargs.pop('azim', -60)
- elev = kwargs.pop('elev', 30)
+ self.initial_azim = kwargs.pop('azim', -60)
+ self.initial_elev = kwargs.pop('elev', 30)
self.xy_viewLim = unit_bbox()
self.zz_viewLim = unit_bbox()
self.xy_dataLim = unit_bbox()
self.zz_dataLim = unit_bbox()
- # inihibit autoscale_view until the axises are defined
+ # inihibit autoscale_view until the axes are defined
# they can't be defined until Axes.__init__ has been called
- self.view_init(elev, azim)
+ self.view_init(self.initial_elev, self.initial_azim)
self._ready = 0
Axes.__init__(self, self.fig, rect,
frameon=True,
@@ -272,11 +272,31 @@
def panpy(self, numsteps):
print 'numsteps', numsteps
- def view_init(self, elev, azim):
+ def view_init(self, elev=None, azim=None):
+ """
+ Set the elevation and azimuth of the axes.
+
+ This can be used to rotate the axes programatically.
+
+ 'elev' stores the elevation angle in the z plane.
+ 'azim' stores the azimuth angle in the x,y plane.
+
+ if elev or azim are None (default), then the initial value
+ is used which was specified in the :class:`Axes3D` constructor.
+ """
+
self.dist = 10
- self.elev = elev
- self.azim = azim
-
+
+ if elev is None:
+ self.elev = self.initial_elev
+ else:
+ self.elev = elev
+
+ if azim is None:
+ self.azim = self.initial_azim
+ else:
+ self.azim = azim
+
def get_proj(self):
"""Create the projection matrix from the current viewing
position.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-19 17:12:49
|
Revision: 8199
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8199&view=rev
Author: heeres
Date: 2010-03-19 17:12:41 +0000 (Fri, 19 Mar 2010)
Log Message:
-----------
Some fixes
Modified Paths:
--------------
trunk/matplotlib/examples/mplot3d/hist3d_demo.py
trunk/matplotlib/examples/mplot3d/text3d_demo.py
trunk/matplotlib/lib/mpl_toolkits/mplot3d/art3d.py
trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
Modified: trunk/matplotlib/examples/mplot3d/hist3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/hist3d_demo.py 2010-03-19 16:50:37 UTC (rev 8198)
+++ trunk/matplotlib/examples/mplot3d/hist3d_demo.py 2010-03-19 17:12:41 UTC (rev 8199)
@@ -17,7 +17,7 @@
dy = dx.copy()
dz = hist.flatten()
-ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b')
+ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b', zsort='average')
plt.show()
Modified: trunk/matplotlib/examples/mplot3d/text3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/text3d_demo.py 2010-03-19 16:50:37 UTC (rev 8198)
+++ trunk/matplotlib/examples/mplot3d/text3d_demo.py 2010-03-19 17:12:41 UTC (rev 8199)
@@ -13,6 +13,9 @@
label = '(%d, %d, %d), dir=%s' % (x, y, z, zdir)
ax.text(x, y, z, label, zdir)
+ax.text(1, 1, 1, "red", color='red')
+ax.text2D(0.05, 0.95, "2D Text", transform=ax.transAxes)
+
ax.set_xlim3d(0, 10)
ax.set_ylim3d(0, 10)
ax.set_zlim3d(0, 10)
Modified: trunk/matplotlib/lib/mpl_toolkits/mplot3d/art3d.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/mplot3d/art3d.py 2010-03-19 16:50:37 UTC (rev 8198)
+++ trunk/matplotlib/lib/mpl_toolkits/mplot3d/art3d.py 2010-03-19 17:12:41 UTC (rev 8199)
@@ -1,6 +1,7 @@
#!/usr/bin/python
# art3d.py, original mplot3d version by John Porter
# Parts rewritten by Reinier Heeres <re...@he...>
+# Minor additions by Ben Axelrod <bax...@co...>
'''
Module containing 3D artist code and functions to convert 2D
@@ -15,6 +16,7 @@
from matplotlib.colors import Normalize
from matplotlib.cbook import iterable
+import warnings
import numpy as np
import math
import proj3d
@@ -52,8 +54,15 @@
Text object with 3D position and (in the future) direction.
'''
- def __init__(self, x=0, y=0, z=0, text='', zdir='z'):
- mtext.Text.__init__(self, x, y, text)
+ def __init__(self, x=0, y=0, z=0, text='', zdir='z', **kwargs):
+ '''
+ *x*, *y*, *z* Position of text
+ *text* Text string to display
+ *zdir* Direction of text
+
+ Keyword arguments are passed onto :func:`~matplotlib.text.Text`.
+ '''
+ mtext.Text.__init__(self, x, y, text, **kwargs)
self.set_3d_properties(z, zdir)
def set_3d_properties(self, z=0, zdir='z'):
@@ -86,6 +95,9 @@
'''
def __init__(self, xs, ys, zs, *args, **kwargs):
+ '''
+ Keyword arguments are passed onto :func:`~matplotlib.lines.Line2D`.
+ '''
lines.Line2D.__init__(self, [], [], *args, **kwargs)
self._verts3d = xs, ys, zs
@@ -145,6 +157,9 @@
'''
def __init__(self, segments, *args, **kwargs):
+ '''
+ Keyword arguments are passed onto :func:`~matplotlib.collections.LineCollection`.
+ '''
LineCollection.__init__(self, segments, *args, **kwargs)
def set_segments(self, segments):
@@ -317,13 +332,44 @@
*verts* should contain 3D coordinates.
+ Keyword arguments:
+ zsort, see set_zsort for options.
+
Note that this class does a bit of magic with the _facecolors
and _edgecolors properties.
'''
+ self.set_zsort(kwargs.pop('zsort', True))
+
PolyCollection.__init__(self, verts, *args, **kwargs)
- self._zsort = 1
+
+ _zsort_functions = {
+ 'average': np.average,
+ 'min': np.min,
+ 'max': np.max,
+ }
+
+ def set_zsort(self, zsort):
+ '''
+ Set z-sorting behaviour:
+ boolean: if True use default 'average'
+ string: 'average', 'min' or 'max'
+ '''
+
+ if zsort is True:
+ zsort = 'average'
+
+ if zsort is not False:
+ if zsort in self._zsort_functions:
+ zsortfunc = self._zsort_functions[zsort]
+ else:
+ return False
+ else:
+ zsortfunc = None
+
+ self._zsort = zsort
self._sort_zpos = None
+ self._zsortfunc = zsortfunc
def get_vector(self, segments3d):
"""Optimize points for projection"""
@@ -348,12 +394,13 @@
PolyCollection.set_verts(self, [], closed)
def set_3d_properties(self):
- self._zsort = 1
self._sort_zpos = None
+ self.set_zsort(True)
self._facecolors3d = PolyCollection.get_facecolors(self)
self._edgecolors3d = PolyCollection.get_edgecolors(self)
- def set_sort_zpos(self, val):
+ def set_sort_zpos(self,val):
+ '''Set the position to use for z-sorting.'''
self._sort_zpos = val
def do_3d_projection(self, renderer):
@@ -381,7 +428,7 @@
# if required sort by depth (furthest drawn first)
if self._zsort:
- z_segments_2d = [(np.average(zs), zip(xs, ys), fc, ec) for
+ z_segments_2d = [(self._zsortfunc(zs), zip(xs, ys), fc, ec) for
(xs, ys, zs), fc, ec in zip(xyzlist, cface, cedge)]
z_segments_2d.sort(cmp=lambda x, y: cmp(y[0], x[0]))
else:
@@ -468,9 +515,14 @@
def iscolor(c):
try:
- return (len(c) == 4 or len(c) == 3) and hasattr(c[0], '__float__')
- except (IndexError):
+ if len(c) == 4 or len(c) == 3:
+ if iterable(c[0]):
+ return False
+ if hasattr(c[0], '__float__'):
+ return True
+ except:
return False
+ return False
def get_colors(c, num):
"""Stretch the color argument to provide the required number num"""
@@ -484,6 +536,8 @@
return c
elif iscolor(c):
return [c] * num
+ elif len(c) == 0: #if edgecolor or facecolor is specified as 'none'
+ return [[0,0,0,0]] * num
elif iscolor(c[0]):
return [c[0]] * num
else:
Modified: trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-03-19 16:50:37 UTC (rev 8198)
+++ trunk/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py 2010-03-19 17:12:41 UTC (rev 8199)
@@ -2,12 +2,14 @@
# axes3d.py, original mplot3d version by John Porter
# Created: 23 Sep 2005
# Parts fixed by Reinier Heeres <re...@he...>
+# Minor additions by Ben Axelrod <bax...@co...>
"""
Module containing Axes3D, an object which can plot 3D objects on a
2D matplotlib figure.
"""
+import warnings
from matplotlib.axes import Axes, rcParams
from matplotlib import cbook
from matplotlib.transforms import Bbox
@@ -55,7 +57,7 @@
if rect is None:
rect = [0.0, 0.0, 1.0, 1.0]
self.fig = fig
- self.cids = []
+ self._cids = []
azim = kwargs.pop('azim', -60)
elev = kwargs.pop('elev', 30)
@@ -147,7 +149,7 @@
# Calculate projection of collections and zorder them
zlist = [(col.do_3d_projection(renderer), col) \
- for col in self.collections]
+ for col in self.collections]
zlist.sort()
zlist.reverse()
for i, (z, col) in enumerate(zlist):
@@ -322,23 +324,52 @@
M = np.dot(perspM, M0)
return M
- def mouse_init(self):
+ def mouse_init(self, rotate_btn=1, zoom_btn=3):
+ """Initializes mouse button callbacks to enable 3D rotation of
+ the axes. Also optionally sets the mouse buttons for 3D rotation
+ and zooming.
+
+ ============ ================================================
+ Argument Description
+ ============ ================================================
+ *rotate_btn* The integer or list of integers specifying which mouse
+ button or buttons to use for 3D rotation of the axes.
+ Default = 1.
+
+ *zoom_btn* The integer or list of integers specifying which mouse
+ button or buttons to use to zoom the 3D axes.
+ Default = 3.
+ ============ ================================================
+ """
self.button_pressed = None
canv = self.figure.canvas
if canv != None:
c1 = canv.mpl_connect('motion_notify_event', self._on_move)
c2 = canv.mpl_connect('button_press_event', self._button_press)
c3 = canv.mpl_connect('button_release_event', self._button_release)
- self.cids = [c1, c2, c3]
+ self._cids = [c1, c2, c3]
+ else:
+ warnings.warn('Axes3D.figure.canvas is \'None\', mouse rotation disabled. Set canvas then call Axes3D.mouse_init().')
+ self._rotate_btn = np.atleast_1d(rotate_btn)
+ self._zoom_btn = np.atleast_1d(zoom_btn)
+
def cla(self):
- # Disconnect the various events we set.
- for cid in self.cids:
- self.figure.canvas.mpl_disconnect(cid)
- self.cids = []
+ """Clear axes and disable mouse button callbacks.
+ """
+ self.disable_mouse_rotation()
Axes.cla(self)
self.grid(rcParams['axes3d.grid'])
+ def disable_mouse_rotation(self):
+ """Disable mouse button callbacks.
+ """
+ # Disconnect the various events we set.
+ for cid in self._cids:
+ self.figure.canvas.mpl_disconnect(cid)
+
+ self._cids = []
+
def _button_press(self, event):
if event.inaxes == self:
self.button_pressed = event.button
@@ -426,9 +457,10 @@
def _on_move(self, event):
"""Mouse moving
- button-1 rotates
- button-3 zooms
+ button-1 rotates by default. Can be set explicitly in mouse_init().
+ button-3 zooms by default. Can be set explicitly in mouse_init().
"""
+
if not self.button_pressed:
return
@@ -447,7 +479,8 @@
h = (y1-y0)
self.sx, self.sy = x, y
- if self.button_pressed == 1:
+ # Rotation
+ if self.button_pressed in self._rotate_btn:
# rotate viewing point
# get the x and y pixel coords
if dx == 0 and dy == 0:
@@ -456,12 +489,15 @@
self.azim = art3d.norm_angle(self.azim - (dx/w)*180)
self.get_proj()
self.figure.canvas.draw()
- elif self.button_pressed == 2:
+
+# elif self.button_pressed == 2:
# pan view
# project xv,yv,zv -> xw,yw,zw
# pan
- pass
- elif self.button_pressed == 3:
+# pass
+
+ # Zoom
+ elif self.button_pressed in self._zoom_btn:
# zoom view
# hmmm..this needs some help from clipping....
minx, maxx, miny, maxy, minz, maxz = self.get_w_lims()
@@ -476,7 +512,7 @@
self.figure.canvas.draw()
def set_xlabel(self, xlabel, fontdict=None, **kwargs):
- '''Set xlabel. '''
+ '''Set xlabel.'''
label = self.w_xaxis.get_label()
label.set_text(xlabel)
@@ -511,13 +547,18 @@
'''
self._draw_grid = on
- def text(self, x, y, z, s, zdir=None):
- '''Add text to the plot.'''
- text = Axes.text(self, x, y, s)
+ def text(self, x, y, z, s, zdir=None, **kwargs):
+ '''
+ Add text to the plot. kwargs will be passed on to Axes.text,
+ except for the `zdir` keyword, which sets the direction to be
+ used as the z direction.
+ '''
+ text = Axes.text(self, x, y, s, **kwargs)
art3d.text_2d_to_3d(text, z, zdir)
return text
text3D = text
+ text2D = Axes.text
def plot(self, xs, ys, *args, **kwargs):
'''
@@ -591,6 +632,9 @@
*shade* Whether to shade the facecolors, default:
false when cmap specified, true otherwise
========== ================================================
+
+ Other arguments are passed on to
+ :func:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection.__init__`
'''
had_data = self.has_data()
@@ -822,8 +866,9 @@
colors = self._shade_colors(color, normals)
colors2 = self._shade_colors(color, normals)
- polycol = art3d.Poly3DCollection(polyverts, facecolors=colors,
- edgecolors=colors2)
+ polycol = art3d.Poly3DCollection(polyverts,
+ facecolors=colors,
+ edgecolors=colors2)
polycol.set_sort_zpos(z)
self.add_collection3d(polycol)
@@ -848,6 +893,8 @@
Other keyword arguments are passed on to
:func:`~matplotlib.axes.Axes.contour`
+
+ Returns a :class:`~matplotlib.axes.Axes.contour`
'''
extend3d = kwargs.pop('extend3d', False)
@@ -881,7 +928,9 @@
*X*, *Y*, *Z*: data points.
Keyword arguments are passed on to
- :func:`~matplotlib.axes.Axes.contour`
+ :func:`~matplotlib.axes.Axes.contourf`
+
+ Returns a :class:`~matplotlib.axes.Axes.contourf`
'''
had_data = self.has_data()
@@ -1005,25 +1054,61 @@
return patches
- def bar3d(self, x, y, z, dx, dy, dz, color='b'):
+ def bar3d(self, x, y, z, dx, dy, dz, color='b',
+ zsort='average', *args, **kwargs):
'''
Generate a 3D bar, or multiple bars.
When generating multiple bars, x, y, z have to be arrays.
- dx, dy, dz can still be scalars.
+ dx, dy, dz can be arrays or scalars.
+
+ *color* can be:
+ - A single color value, to color all bars the same color.
+ - An array of colors of length N bars, to color each bar
+ independently.
+ - An array of colors of length 6, to color the faces of the bars
+ similarly.
+ - An array of colors of length 6 * N bars, to color each face
+ independently.
+
+ When coloring the faces of the boxes specifically, this is the order
+ of the coloring:
+ 1. -Z (bottom of box)
+ 2. +Z (top of box)
+ 3. -Y
+ 4. +Y
+ 5. -X
+ 6. +X
+
+ Keyword arguments are passed onto
+ :func:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`
'''
-
had_data = self.has_data()
if not cbook.iterable(x):
- x, y, z = [x], [y], [z]
+ x = [x]
+ if not cbook.iterable(y):
+ y = [y]
+ if not cbook.iterable(z):
+ z = [z]
+
if not cbook.iterable(dx):
- dx, dy, dz = [dx], [dy], [dz]
+ dx = [dx]
+ if not cbook.iterable(dy):
+ dy = [dy]
+ if not cbook.iterable(dz):
+ dz = [dz]
+
if len(dx) == 1:
dx = dx * len(x)
- dy = dy * len(x)
- dz = dz * len(x)
+ if len(dy) == 1:
+ dy = dy * len(y)
+ if len(dz) == 1:
+ dz = dz * len(z)
+ if len(x) != len(y) or len(x) != len(z):
+ warnings.warn('x, y, and z must be the same length.')
+
minx, miny, minz = 1e20, 1e20, 1e20
maxx, maxy, maxz = -1e20, -1e20, -1e20
@@ -1053,15 +1138,35 @@
(xi + dxi, yi + dyi, zi + dzi), (xi + dxi, yi, zi + dzi)),
])
- color = np.array(colorConverter.to_rgba(color))
+ facecolors = []
+ if color is None:
+ # no color specified
+ facecolors = [None] * len(x)
+ elif len(color) == len(x):
+ # bar colors specified, need to expand to number of faces
+ for c in color:
+ facecolors.extend([c] * 6)
+ else:
+ # a single color specified, or face colors specified explicitly
+ facecolors = list(colorConverter.to_rgba_array(color))
+ if len(facecolors) < len(x):
+ facecolors *= (6 * len(x))
+
normals = self._generate_normals(polys)
- colors = self._shade_colors(color, normals)
-
- col = art3d.Poly3DCollection(polys, facecolor=colors)
+ sfacecolors = self._shade_colors(facecolors, normals)
+ col = art3d.Poly3DCollection(polys,
+ zsort=zsort,
+ facecolor=sfacecolors,
+ *args, **kwargs)
self.add_collection(col)
self.auto_scale_xyz((minx, maxx), (miny, maxy), (minz, maxz), had_data)
+ def set_title(self, label, fontdict=None, **kwargs):
+ Axes.set_title(self, label, fontdict, **kwargs)
+ (x, y) = self.title.get_position()
+ self.title.set_y(0.92 * y)
+
def get_test_data(delta=0.05):
'''
Return a tuple X, Y, Z with a test data set.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-19 16:50:44
|
Revision: 8198
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8198&view=rev
Author: heeres
Date: 2010-03-19 16:50:37 +0000 (Fri, 19 Mar 2010)
Log Message:
-----------
Add 3d surface plot example (radial coordinates)
Added Paths:
-----------
trunk/matplotlib/examples/mplot3d/surface3d_radial_demo.py
Added: trunk/matplotlib/examples/mplot3d/surface3d_radial_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/surface3d_radial_demo.py (rev 0)
+++ trunk/matplotlib/examples/mplot3d/surface3d_radial_demo.py 2010-03-19 16:50:37 UTC (rev 8198)
@@ -0,0 +1,27 @@
+# By Armin Moser
+
+from mpl_toolkits.mplot3d import Axes3D
+import matplotlib
+import numpy as np
+from matplotlib import cm
+from matplotlib import pyplot as plt
+step = 0.04
+maxval = 1.0
+fig = plt.figure()
+ax = Axes3D(fig)
+
+# create supporting points in polar coordinates
+r = np.linspace(0,1.25,50)
+p = np.linspace(0,2*np.pi,50)
+R,P = np.meshgrid(r,p)
+# transform them to cartesian system
+X,Y = R*np.cos(P),R*np.sin(P)
+
+Z = ((R**2 - 1)**2)
+ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
+ax.set_zlim3d(0, 1)
+ax.set_xlabel(r'$\phi_\mathrm{real}$')
+ax.set_ylabel(r'$\phi_\mathrm{im}$')
+ax.set_zlabel(r'$V(\phi)$')
+ax.set_xticks([])
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-19 16:49:39
|
Revision: 8197
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8197&view=rev
Author: heeres
Date: 2010-03-19 16:49:29 +0000 (Fri, 19 Mar 2010)
Log Message:
-----------
Add 3d surface plot example (radial coordinates)
Added Paths:
-----------
branches/v0_99_maint/examples/mplot3d/surface3d_radial_demo.py
Added: branches/v0_99_maint/examples/mplot3d/surface3d_radial_demo.py
===================================================================
--- branches/v0_99_maint/examples/mplot3d/surface3d_radial_demo.py (rev 0)
+++ branches/v0_99_maint/examples/mplot3d/surface3d_radial_demo.py 2010-03-19 16:49:29 UTC (rev 8197)
@@ -0,0 +1,27 @@
+# By Armin Moser
+
+from mpl_toolkits.mplot3d import Axes3D
+import matplotlib
+import numpy as np
+from matplotlib import cm
+from matplotlib import pyplot as plt
+step = 0.04
+maxval = 1.0
+fig = plt.figure()
+ax = Axes3D(fig)
+
+# create supporting points in polar coordinates
+r = np.linspace(0,1.25,50)
+p = np.linspace(0,2*np.pi,50)
+R,P = np.meshgrid(r,p)
+# transform them to cartesian system
+X,Y = R*np.cos(P),R*np.sin(P)
+
+Z = ((R**2 - 1)**2)
+ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
+ax.set_zlim3d(0, 1)
+ax.set_xlabel(r'$\phi_\mathrm{real}$')
+ax.set_ylabel(r'$\phi_\mathrm{im}$')
+ax.set_zlabel(r'$V(\phi)$')
+ax.set_xticks([])
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-03-16 00:56:17
|
Revision: 8196
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8196&view=rev
Author: efiring
Date: 2010-03-16 00:56:09 +0000 (Tue, 16 Mar 2010)
Log Message:
-----------
patches.py: correct docstring in set_color
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2010-03-16 00:55:20 UTC (rev 8195)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2010-03-16 00:56:09 UTC (rev 8196)
@@ -246,7 +246,7 @@
"""
Set both the edgecolor and the facecolor.
- ACCEPTS: matplotlib color arg or sequence of rgba tuples
+ ACCEPTS: matplotlib color spec
.. seealso::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-03-16 00:55:26
|
Revision: 8195
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8195&view=rev
Author: efiring
Date: 2010-03-16 00:55:20 +0000 (Tue, 16 Mar 2010)
Log Message:
-----------
patches.py: correct docstring in set_color
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/patches.py
Modified: branches/v0_99_maint/lib/matplotlib/patches.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/patches.py 2010-03-15 20:34:32 UTC (rev 8194)
+++ branches/v0_99_maint/lib/matplotlib/patches.py 2010-03-16 00:55:20 UTC (rev 8195)
@@ -203,7 +203,7 @@
"""
Set both the edgecolor and the facecolor.
- ACCEPTS: matplotlib color arg or sequence of rgba tuples
+ ACCEPTS: matplotlib color spec
.. seealso::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2010-03-15 20:34:39
|
Revision: 8194
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8194&view=rev
Author: jdh2358
Date: 2010-03-15 20:34:32 +0000 (Mon, 15 Mar 2010)
Log Message:
-----------
fix ticker docstring bug
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/ticker.py
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2010-03-15 20:33:40 UTC (rev 8193)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2010-03-15 20:34:32 UTC (rev 8194)
@@ -358,7 +358,7 @@
'''
Sets size thresholds for scientific notation.
- e.g. ``xaxis.set_powerlimits((-3, 4))`` sets the pre-2007 default in
+ e.g. ``formatter.set_powerlimits((-3, 4))`` sets the pre-2007 default in
which scientific notation is used for numbers less than
1e-3 or greater than 1e4.
See also :meth:`set_scientific`.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2010-03-15 20:33:47
|
Revision: 8193
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8193&view=rev
Author: jdh2358
Date: 2010-03-15 20:33:40 +0000 (Mon, 15 Mar 2010)
Log Message:
-----------
fix ticker docstring bug
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/ticker.py
Modified: branches/v0_99_maint/lib/matplotlib/ticker.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/ticker.py 2010-03-13 22:31:11 UTC (rev 8192)
+++ branches/v0_99_maint/lib/matplotlib/ticker.py 2010-03-15 20:33:40 UTC (rev 8193)
@@ -355,7 +355,7 @@
'''
Sets size thresholds for scientific notation.
- e.g. ``xaxis.set_powerlimits((-3, 4))`` sets the pre-2007 default in
+ e.g. ``formatter.set_powerlimits((-3, 4))`` sets the pre-2007 default in
which scientific notation is used for numbers less than
1e-3 or greater than 1e4.
See also :meth:`set_scientific`.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-03-13 22:31:17
|
Revision: 8192
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8192&view=rev
Author: leejjoon
Date: 2010-03-13 22:31:11 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
fix the bug that handles for scatter are incorrectly set when dpi!=72. Thanks to Ray Speth for the bug report.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2010-03-13 22:27:57 UTC (rev 8191)
+++ trunk/matplotlib/CHANGELOG 2010-03-13 22:31:11 UTC (rev 8192)
@@ -1,3 +1,11 @@
+2010-03-13 Manually brought in commits from branch
+
+ ------------------------------------------------------------------------
+ r8191 | leejjoon | 2010-03-13 17:27:57 -0500 (Sat, 13 Mar 2010) | 1 line
+
+ fix the bug that handles for scatter are incorrectly set when dpi!=72. Thanks to Ray Speth for the bug report.
+
+
2010-03-03 Manually brought in commits from branch via diff/patch (svnmerge is broken)
------------------------------------------------------------------------
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2010-03-13 22:27:57 UTC (rev 8191)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2010-03-13 22:31:11 UTC (rev 8192)
@@ -623,6 +623,14 @@
xdescent=0., ydescent=descent)
handlebox.add_artist(handle)
+
+ # special case for collection instances
+ if isinstance(handle, RegularPolyCollection) or \
+ isinstance(handle, CircleCollection):
+ handle._transOffset = handlebox.get_transform()
+ handle.set_transform(None)
+
+
if hasattr(handle, "_legmarker"):
handlebox.add_artist(handle._legmarker)
handleboxes.append(handlebox)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-03-13 22:28:04
|
Revision: 8191
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8191&view=rev
Author: leejjoon
Date: 2010-03-13 22:27:57 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
fix the bug that handles for scatter are incorrectly set when dpi!=72. Thanks to Ray Speth for the bug report.
Modified Paths:
--------------
branches/v0_99_maint/CHANGELOG
branches/v0_99_maint/lib/matplotlib/legend.py
Modified: branches/v0_99_maint/CHANGELOG
===================================================================
--- branches/v0_99_maint/CHANGELOG 2010-03-13 19:27:00 UTC (rev 8190)
+++ branches/v0_99_maint/CHANGELOG 2010-03-13 22:27:57 UTC (rev 8191)
@@ -1,3 +1,6 @@
+2010-03-13 fix the bug that handles for scatter are incorrectly set when
+ dpi!=72. Thanks to Ray Speth for the bug report. -JJL
+
===============================================
2009-09-21 Tagged for release 0.99.1
Modified: branches/v0_99_maint/lib/matplotlib/legend.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/legend.py 2010-03-13 19:27:00 UTC (rev 8190)
+++ branches/v0_99_maint/lib/matplotlib/legend.py 2010-03-13 22:27:57 UTC (rev 8191)
@@ -580,6 +580,13 @@
handle = handle_list[-1]
handlebox.add_artist(handle)
+
+ # special case for collection instances
+ if isinstance(handle, RegularPolyCollection) or \
+ isinstance(handle, CircleCollection):
+ handle._transOffset = handlebox.get_transform()
+ handle.set_transform(None)
+
if hasattr(handle, "_legmarker"):
handlebox.add_artist(handle._legmarker)
handleboxes.append(handlebox)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2010-03-13 19:27:07
|
Revision: 8190
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8190&view=rev
Author: efiring
Date: 2010-03-13 19:27:00 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------
contour: autolev drops line contour levels only if outside data range
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2010-03-12 23:23:49 UTC (rev 8189)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2010-03-13 19:27:00 UTC (rev 8190)
@@ -775,7 +775,8 @@
self._auto = True
if self.filled:
return lev
- return lev[1:-1]
+ # For line contours, drop levels outside the data range.
+ return lev[(lev > zmin) & (lev < zmax)]
def _initialize_x_y(self, z):
'''
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2010-03-12 23:23:56
|
Revision: 8189
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8189&view=rev
Author: leejjoon
Date: 2010-03-12 23:23:49 +0000 (Fri, 12 Mar 2010)
Log Message:
-----------
improve legend doc. Thanks to Alan Issac
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2010-03-12 19:27:47 UTC (rev 8188)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2010-03-12 23:23:49 UTC (rev 8189)
@@ -3964,9 +3964,11 @@
*title* : string
the legend title
- Padding and spacing between various elements use following keywords
- parameters. The dimensions of these values are given as a fraction
- of the fontsize. Values from rcParams will be used if None.
+ Padding and spacing between various elements use following
+ keywords parameters. These values are measure in font-size
+ units. E.g., a fontsize of 10 points and a handlelength=5
+ implies a handlelength of 50 points. Values from rcParams
+ will be used if None.
================ ==================================================================
Keyword Description
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2010-03-12 19:27:47 UTC (rev 8188)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2010-03-12 23:23:49 UTC (rev 8189)
@@ -166,9 +166,11 @@
bbox_transform the transform for the bbox. transAxes if None.
================ ==================================================================
-The dimensions of pad and spacing are given as a fraction of the
-_fontsize. Values from rcParams will be used if None.
+The pad and spacing parameters are measure in font-size units. E.g.,
+a fontsize of 10 points and a handlelength=5 implies a handlelength of
+50 points. Values from rcParams will be used if None.
+
Users can specify any arbitrary location for the legend using the
*bbox_to_anchor* keyword argument. bbox_to_anchor can be an instance
of BboxBase(or its derivatives) or a tuple of 2 or 4 floats.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2010-03-12 19:28:00
|
Revision: 8188
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8188&view=rev
Author: jswhit
Date: 2010-03-12 19:27:47 +0000 (Fri, 12 Mar 2010)
Log Message:
-----------
revert pj_init.c to version in proj4 4.6.1.
Modified Paths:
--------------
trunk/toolkits/basemap/src/_geod.c
trunk/toolkits/basemap/src/_proj.c
trunk/toolkits/basemap/src/_pyproj.pxi
trunk/toolkits/basemap/src/pj_init.c
Modified: trunk/toolkits/basemap/src/_geod.c
===================================================================
--- trunk/toolkits/basemap/src/_geod.c 2010-03-10 14:14:52 UTC (rev 8187)
+++ trunk/toolkits/basemap/src/_geod.c 2010-03-12 19:27:47 UTC (rev 8188)
@@ -1,11 +1,12 @@
-/* Generated by Cython 0.11.2 on Wed Nov 4 09:16:32 2009 */
+/* Generated by Cython 0.12.1 on Fri Mar 12 12:24:37 2010 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
-#endif
+#else
+
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -15,7 +16,9 @@
#if PY_VERSION_HEX < 0x02040000
#define METH_COEXIST 0
#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+ #define PyDict_Contains(d,o) PySequence_Contains(d,o)
#endif
+
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
@@ -25,7 +28,9 @@
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
+ #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif
+
#if PY_VERSION_HEX < 0x02060000
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
@@ -35,17 +40,17 @@
#define PyType_Modified(t)
typedef struct {
- void *buf;
- PyObject *obj;
- Py_ssize_t len;
- Py_ssize_t itemsize;
- int readonly;
- int ndim;
- char *format;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- void *internal;
+ void *buf;
+ PyObject *obj;
+ Py_ssize_t len;
+ Py_ssize_t itemsize;
+ int readonly;
+ int ndim;
+ char *format;
+ Py_ssize_t *shape;
+ Py_ssize_t *strides;
+ Py_ssize_t *suboffsets;
+ void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
@@ -59,22 +64,32 @@
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#endif
+
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif
+
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
+
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
+
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
- #define PyString_Type PyBytes_Type
- #define PyString_CheckExact PyBytes_CheckExact
+ #define PyString_Type PyUnicode_Type
+ #define PyString_CheckExact PyUnicode_CheckExact
+#else
+ #define PyBytes_Type PyString_Type
+ #define PyBytes_CheckExact PyString_CheckExact
+#endif
+
+#if PY_MAJOR_VERSION >= 3
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
@@ -89,13 +104,17 @@
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define PyBytes_Type PyString_Type
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+
#endif
+
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif
+
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
@@ -109,6 +128,7 @@
#else
#define _USE_MATH_DEFINES
#endif
+
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
@@ -118,6 +138,7 @@
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
#endif
+
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_NAMESTR(n) ((char *)(n))
#define __Pyx_DOCSTR(n) ((char *)(n))
@@ -136,24 +157,20 @@
#include "math.h"
#include "geodesic.h"
#include "proj_api.h"
-#define __PYX_USE_C99_COMPLEX defined(_Complex_I)
-
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #else
+ #define CYTHON_INLINE
+ #endif
#endif
-typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-static int __pyx_skip_dispatch = 0;
-
-
/* Type Conversion Predeclarations */
#if PY_MAJOR_VERSION < 3
@@ -166,9 +183,12 @@
#define __Pyx_PyBytes_AsString PyBytes_AsString
#endif
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
+#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s))
+
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
#if !defined(T_PYSSIZET)
#if PY_VERSION_HEX < 0x02050000
@@ -185,6 +205,40 @@
#endif
#endif
+
+#if !defined(T_ULONGLONG)
+#define __Pyx_T_UNSIGNED_INT(x) \
+ ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \
+ ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+ ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \
+ ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1))))
+#else
+#define __Pyx_T_UNSIGNED_INT(x) \
+ ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \
+ ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+ ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \
+ ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \
+ ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
+#endif
+#if !defined(T_LONGLONG)
+#define __Pyx_T_SIGNED_INT(x) \
+ ((sizeof(x) == sizeof(char)) ? T_BYTE : \
+ ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+ ((sizeof(x) == sizeof(int)) ? T_INT : \
+ ((sizeof(x) == sizeof(long)) ? T_LONG : -1))))
+#else
+#define __Pyx_T_SIGNED_INT(x) \
+ ((sizeof(x) == sizeof(char)) ? T_BYTE : \
+ ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+ ((sizeof(x) == sizeof(int)) ? T_INT : \
+ ((sizeof(x) == sizeof(long)) ? T_LONG : \
+ ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))))
+#endif
+
+#define __Pyx_T_FLOATING(x) \
+ ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
+ ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
+
#if !defined(T_SIZET)
#if !defined(T_ULONGLONG)
#define T_SIZET \
@@ -198,9 +252,9 @@
#endif
#endif
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
@@ -222,6 +276,7 @@
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
@@ -229,35 +284,69 @@
static const char **__pyx_f;
-#ifdef CYTHON_REFNANNY
-typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*NewContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
-} __Pyx_RefnannyAPIStruct;
-static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
-#define __Pyx_ImportRefcountAPI(name) (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
-#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
-#define __Pyx_SetupRefcountContext(name) void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
-#define __Pyx_FinishRefcountContext() __Pyx_Refnanny->FinishContext(&__pyx_refchk)
+/* Type declarations */
+
+/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":5
+ * include "_pyproj.pxi"
+ *
+ * cdef class Geod: # <<<<<<<<<<<<<<
+ * cdef GEODESIC_T geodesic_t
+ * cdef public object geodstring
+ */
+
+struct __pyx_obj_5_geod_Geod {
+ PyObject_HEAD
+ GEODESIC_T geodesic_t;
+ PyObject *geodstring;
+ PyObject *proj_version;
+ char *geodinitstring;
+};
+
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+ end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+ }
+ #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+ #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
-#define __Pyx_INCREF(r) Py_INCREF(r)
-#define __Pyx_DECREF(r) Py_DECREF(r)
-#define __Pyx_GOTREF(r)
-#define __Pyx_GIVEREF(r)
-#define __Pyx_XDECREF(r) Py_XDECREF(r)
-#define __Pyx_SetupRefcountContext(name)
-#define __Pyx_FinishRefcountContext()
+ #define __Pyx_RefNannySetupContext(name)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
-#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
-#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)
+#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
+#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name); /*proto*/
@@ -271,150 +360,154 @@
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-static INLINE char __Pyx_PyInt_AsChar(PyObject *);
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-static INLINE short __Pyx_PyInt_AsShort(PyObject *);
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-static INLINE int __Pyx_PyInt_AsInt(PyObject *);
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-static INLINE long __Pyx_PyInt_AsLong(PyObject *);
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-/* Type declarations */
-
-/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":5
- * include "_pyproj.pxi"
- *
- * cdef class Geod: # <<<<<<<<<<<<<<
- * cdef GEODESIC_T geodesic_t
- * cdef public object geodstring
- */
-
-struct __pyx_obj_5_geod_Geod {
- PyObject_HEAD
- GEODESIC_T geodesic_t;
- PyObject *geodstring;
- PyObject *proj_version;
- char *geodinitstring;
-};
/* Module declarations from _geod */
static PyTypeObject *__pyx_ptype_5_geod_Geod = 0;
-static PyObject *__pyx_k_12 = 0;
-static PyObject *__pyx_k_13 = 0;
-static PyObject *__pyx_k_14 = 0;
#define __Pyx_MODULE_NAME "_geod"
int __pyx_module_is_main__geod = 0;
/* Implementation of _geod */
-static char __pyx_k_11[] = "1.8.6";
-static char __pyx_k___main__[] = "__main__";
-static PyObject *__pyx_kp___main__;
-static char __pyx_k___cinit__[] = "__cinit__";
-static PyObject *__pyx_kp___cinit__;
-static char __pyx_k___reduce__[] = "__reduce__";
-static PyObject *__pyx_kp___reduce__;
-static char __pyx_k__fwd[] = "_fwd";
-static PyObject *__pyx_kp__fwd;
-static char __pyx_k__inv[] = "_inv";
-static PyObject *__pyx_kp__inv;
-static char __pyx_k__npts[] = "_npts";
-static PyObject *__pyx_kp__npts;
-static char __pyx_k_geodstring[] = "geodstring";
-static PyObject *__pyx_kp_geodstring;
-static char __pyx_k_lons[] = "lons";
-static PyObject *__pyx_kp_lons;
-static char __pyx_k_lats[] = "lats";
-static PyObject *__pyx_kp_lats;
-static char __pyx_k_az[] = "az";
-static PyObject *__pyx_kp_az;
-static char __pyx_k_dist[] = "dist";
-static PyObject *__pyx_kp_dist;
-static char __pyx_k_radians[] = "radians";
-static PyObject *__pyx_kp_radians;
-static char __pyx_k_1[] = "lons1";
-static PyObject *__pyx_kp_1;
-static char __pyx_k_2[] = "lats1";
-static PyObject *__pyx_kp_2;
-static char __pyx_k_3[] = "lons2";
-static PyObject *__pyx_kp_3;
-static char __pyx_k_4[] = "lats2";
-static PyObject *__pyx_kp_4;
-static char __pyx_k_5[] = "lon1";
-static PyObject *__pyx_kp_5;
-static char __pyx_k_6[] = "lat1";
-static PyObject *__pyx_kp_6;
-static char __pyx_k_7[] = "lon2";
-static PyObject *__pyx_kp_7;
-static char __pyx_k_8[] = "lat2";
-static PyObject *__pyx_kp_8;
-static char __pyx_k_npts[] = "npts";
-static PyObject *__pyx_kp_npts;
-static char __pyx_k_math[] = "math";
-static PyObject *__pyx_kp_math;
-static char __pyx_k_9[] = "_dg2rad";
-static PyObject *__pyx_kp_9;
-static char __pyx_k_degrees[] = "degrees";
-static PyObject *__pyx_kp_degrees;
-static char __pyx_k_10[] = "_rad2dg";
-static PyObject *__pyx_kp_10;
-static char __pyx_k__doublesize[] = "_doublesize";
-static PyObject *__pyx_kp__doublesize;
-static char __pyx_k___version__[] = "__version__";
-static PyObject *__pyx_kp___version__;
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_RuntimeError;
-static char __pyx_k___class__[] = "__class__";
-static PyObject *__pyx_kp___class__;
-static char __pyx_k_ValueError[] = "ValueError";
-static PyObject *__pyx_kp_ValueError;
-static PyObject *__pyx_kp_11;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_kp_15;
-static PyObject *__pyx_kp_16;
-static char __pyx_k_15[] = "Buffer lengths not the same";
-static char __pyx_k_16[] = "undefined inverse geodesic (may be an antipodal point)";
-static PyObject *__pyx_kp_17;
-static PyObject *__pyx_kp_18;
-static PyObject *__pyx_kp_19;
-static char __pyx_k_17[] = "Buffer lengths not the same";
-static char __pyx_k_18[] = "undefined inverse geodesic (may be an antipodal point)";
-static char __pyx_k_19[] = "undefined inverse geodesic (may be an antipodal point)";
+static char __pyx_k_2[] = "Buffer lengths not the same";
+static char __pyx_k_3[] = "undefined inverse geodesic (may be an antipodal point)";
+static char __pyx_k_6[] = "1.8.7";
+static char __pyx_k_7[] = "Geod.__reduce__ (line 22)";
+static char __pyx_k_8[] = "Geod._fwd (line 26)";
+static char __pyx_k_9[] = "Geod._inv (line 82)";
+static char __pyx_k_10[] = "Geod._npts (line 133)";
+static char __pyx_k__u[] = "u";
+static char __pyx_k__v[] = "v";
+static char __pyx_k__az[] = "az";
+static char __pyx_k__p1[] = "p1";
+static char __pyx_k__p2[] = "p2";
+static char __pyx_k__DIST[] = "DIST";
+static char __pyx_k__Geod[] = "Geod";
+static char __pyx_k___fwd[] = "_fwd";
+static char __pyx_k___inv[] = "_inv";
+static char __pyx_k__dist[] = "dist";
+static char __pyx_k__lat1[] = "lat1";
+static char __pyx_k__lat2[] = "lat2";
+static char __pyx_k__lats[] = "lats";
+static char __pyx_k__lon1[] = "lon1";
+static char __pyx_k__lon2[] = "lon2";
+static char __pyx_k__lons[] = "lons";
+static char __pyx_k__math[] = "math";
+static char __pyx_k__npts[] = "npts";
+static char __pyx_k___npts[] = "_npts";
+static char __pyx_k__lats1[] = "lats1";
+static char __pyx_k__lats2[] = "lats2";
+static char __pyx_k__lons1[] = "lons1";
+static char __pyx_k__lons2[] = "lons2";
+static char __pyx_k__ALPHA12[] = "ALPHA12";
+static char __pyx_k__ALPHA21[] = "ALPHA21";
+static char __pyx_k___dg2rad[] = "_dg2rad";
+static char __pyx_k___rad2dg[] = "_rad2dg";
+static char __pyx_k__degrees[] = "degrees";
+static char __pyx_k__radians[] = "radians";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k____test__[] = "__test__";
+static char __pyx_k____class__[] = "__class__";
+static char __pyx_k__ValueError[] = "ValueError";
+static char __pyx_k____reduce__[] = "__reduce__";
+static char __pyx_k__geodesic_t[] = "geodesic_t";
+static char __pyx_k__geodstring[] = "geodstring";
+static char __pyx_k____version__[] = "__version__";
+static char __pyx_k___doublesize[] = "_doublesize";
+static char __pyx_k__RuntimeError[] = "RuntimeError";
+static char __pyx_k__proj_version[] = "proj_version";
+static char __pyx_k__geodinitstring[] = "geodinitstring";
+static PyObject *__pyx_kp_u_10;
+static PyObject *__pyx_kp_s_2;
+static PyObject *__pyx_kp_s_3;
+static PyObject *__pyx_kp_s_6;
+static PyObject *__pyx_kp_u_7;
+static PyObject *__pyx_kp_u_8;
+static PyObject *__pyx_kp_u_9;
+static PyObject *__pyx_n_s__ALPHA12;
+static PyObject *__pyx_n_s__ALPHA21;
+static PyObject *__pyx_n_s__DIST;
+static PyObject *__pyx_n_s__Geod;
+static PyObject *__pyx_n_s__RuntimeError;
+static PyObject *__pyx_n_s__ValueError;
+static PyObject *__pyx_n_s____class__;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s____reduce__;
+static PyObject *__pyx_n_s____test__;
+static PyObject *__pyx_n_s____version__;
+static PyObject *__pyx_n_s___dg2rad;
+static PyObject *__pyx_n_s___doublesize;
+static PyObject *__pyx_n_s___fwd;
+static PyObject *__pyx_n_s___inv;
+static PyObject *__pyx_n_s___npts;
+static PyObject *__pyx_n_s___rad2dg;
+static PyObject *__pyx_n_s__az;
+static PyObject *__pyx_n_s__degrees;
+static PyObject *__pyx_n_s__dist;
+static PyObject *__pyx_n_s__geodesic_t;
+static PyObject *__pyx_n_s__geodinitstring;
+static PyObject *__pyx_n_s__geodstring;
+static PyObject *__pyx_n_s__lat1;
+static PyObject *__pyx_n_s__lat2;
+static PyObject *__pyx_n_s__lats;
+static PyObject *__pyx_n_s__lats1;
+static PyObject *__pyx_n_s__lats2;
+static PyObject *__pyx_n_s__lon1;
+static PyObject *__pyx_n_s__lon2;
+static PyObject *__pyx_n_s__lons;
+static PyObject *__pyx_n_s__lons1;
+static PyObject *__pyx_n_s__lons2;
+static PyObject *__pyx_n_s__math;
+static PyObject *__pyx_n_s__npts;
+static PyObject *__pyx_n_s__p1;
+static PyObject *__pyx_n_s__p2;
+static PyObject *__pyx_n_s__proj_version;
+static PyObject *__pyx_n_s__radians;
+static PyObject *__pyx_n_s__u;
+static PyObject *__pyx_n_s__v;
+static PyObject *__pyx_k_1;
+static PyObject *__pyx_k_4;
+static PyObject *__pyx_k_5;
-/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":11
+/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":11
* cdef char *geodinitstring
*
* def __new__(self, geodstring): # <<<<<<<<<<<<<<
@@ -430,8 +523,8 @@
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
- static PyObject **__pyx_pyargnames[] = {&__pyx_kp_geodstring,0};
- __Pyx_SetupRefcountContext("__cinit__");
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__geodstring,0};
+ __Pyx_RefNannySetupContext("__cinit__");
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
PyObject* values[1] = {0};
@@ -442,7 +535,7 @@
}
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 0:
- values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_geodstring);
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__geodstring);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
}
@@ -462,8 +555,10 @@
__Pyx_AddTraceback("_geod.Geod.__cinit__");
return -1;
__pyx_L4_argument_unpacking_done:;
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __Pyx_INCREF(__pyx_v_geodstring);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":14
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":14
* cdef GEODESIC_T GEOD_T
* # setup geod initialization string.
* self.geodstring = geodstring # <<<<<<<<<<<<<<
@@ -476,7 +571,7 @@
__Pyx_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring);
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring = __pyx_v_geodstring;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":15
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":15
* # setup geod initialization string.
* self.geodstring = geodstring
* self.geodinitstring = PyString_AsString(self.geodstring) # <<<<<<<<<<<<<<
@@ -485,7 +580,7 @@
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring = PyString_AsString(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":17
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":17
* self.geodinitstring = PyString_AsString(self.geodstring)
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] # <<<<<<<<<<<<<<
@@ -494,7 +589,7 @@
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t = (GEOD_init_plus(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring, (&__pyx_v_GEOD_T))[0]);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":18
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":18
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0]
* if pj_errno != 0: # <<<<<<<<<<<<<<
@@ -504,7 +599,7 @@
__pyx_t_1 = (pj_errno != 0);
if (__pyx_t_1) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":19
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":19
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0]
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
@@ -512,15 +607,15 @@
*
*/
__pyx_t_2 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(((PyObject *)__pyx_t_2));
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -528,7 +623,7 @@
}
__pyx_L6:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":20
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":20
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<<
@@ -551,11 +646,13 @@
__Pyx_AddTraceback("_geod.Geod.__cinit__");
__pyx_r = -1;
__pyx_L0:;
- __Pyx_FinishRefcountContext();
+ __Pyx_DECREF((PyObject *)__pyx_v_self);
+ __Pyx_DECREF(__pyx_v_geodstring);
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":22
+/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":22
* self.proj_version = PJ_VERSION/100.
*
* def __reduce__(self): # <<<<<<<<<<<<<<
@@ -570,9 +667,9 @@
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
- __Pyx_SetupRefcountContext("__reduce__");
+ __Pyx_RefNannySetupContext("__reduce__");
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":24
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":24
* def __reduce__(self):
* """special method that allows pyproj.Geod instance to be pickled"""
* return (self.__class__,(self.geodstring,)) # <<<<<<<<<<<<<<
@@ -580,22 +677,22 @@
* def _fwd(self, object lons, object lats, object az, object dist, radians=False):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring);
__Pyx_GIVEREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodstring);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ __Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_3);
+ __pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
@@ -609,11 +706,11 @@
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_FinishRefcountContext();
+ __Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":26
+/* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":26
* return (self.__class__,(self.geodstring,))
*
* def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<<
@@ -644,19 +741,19 @@
void *__pyx_v_azdat;
void *__pyx_v_distdat;
PyObject *__pyx_r = NULL;
- PyObject *__pyx_1 = 0;
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
- double __pyx_t_6;
- static PyObject **__pyx_pyargnames[] = {&__pyx_kp_lons,&__pyx_kp_lats,&__pyx_kp_az,&__pyx_kp_dist,&__pyx_kp_radians,0};
- __Pyx_SetupRefcountContext("_fwd");
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ double __pyx_t_7;
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lons,&__pyx_n_s__lats,&__pyx_n_s__az,&__pyx_n_s__dist,&__pyx_n_s__radians,0};
+ __Pyx_RefNannySetupContext("_fwd");
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
PyObject* values[5] = {0,0,0,0,0};
- values[4] = __pyx_k_12;
+ values[4] = __pyx_k_1;
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
@@ -668,30 +765,30 @@
}
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 0:
- values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_lons);
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lons);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
- values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_lats);
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats);
if (likely(values[1])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
- values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_az);
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__az);
if (likely(values[2])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
- values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dist);
+ values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist);
if (likely(values[3])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (kw_args > 1) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_radians);
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__radians);
if (unlikely(value)) { values[4] = value; kw_args--; }
}
}
@@ -704,7 +801,7 @@
__pyx_v_dist = values[3];
__pyx_v_radians = values[4];
} else {
- __pyx_v_radians = __pyx_k_12;
+ __pyx_v_radians = __pyx_k_1;
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5:
__pyx_v_radians = PyTuple_GET_ITEM(__pyx_args, 4);
@@ -724,8 +821,14 @@
__Pyx_AddTraceback("_geod.Geod._fwd");
return NULL;
__pyx_L4_argument_unpacking_done:;
+ __Pyx_INCREF((PyObject *)__pyx_v_self);
+ __Pyx_INCREF(__pyx_v_lons);
+ __Pyx_INCREF(__pyx_v_lats);
+ __Pyx_INCREF(__pyx_v_az);
+ __Pyx_INCREF(__pyx_v_dist);
+ __Pyx_INCREF(__pyx_v_radians);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":37
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":37
* cdef void *londata, *latdata, *azdat, *distdat
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<<
@@ -735,7 +838,7 @@
__pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lons, (&__pyx_v_londata), (&__pyx_v_buflenlons)) != 0);
if (__pyx_t_1) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":38
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":38
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
@@ -748,7 +851,7 @@
}
__pyx_L6:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":39
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":39
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<<
@@ -758,7 +861,7 @@
__pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lats, (&__pyx_v_latdata), (&__pyx_v_buflenlats)) != 0);
if (__pyx_t_1) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":40
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":40
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
@@ -771,7 +874,7 @@
}
__pyx_L7:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":41
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":41
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<<
@@ -781,7 +884,7 @@
__pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_az, (&__pyx_v_azdat), (&__pyx_v_buflenaz)) != 0);
if (__pyx_t_1) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":42
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":42
* raise RuntimeError
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
@@ -794,7 +897,7 @@
}
__pyx_L8:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":43
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":43
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<<
@@ -804,7 +907,7 @@
__pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_dist, (&__pyx_v_distdat), (&__pyx_v_buflend)) != 0);
if (__pyx_t_1) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":44
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":44
* raise RuntimeError
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
@@ -817,7 +920,7 @@
}
__pyx_L9:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":46
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":46
* raise RuntimeError
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<<
@@ -834,7 +937,7 @@
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":47
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":47
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
@@ -842,13 +945,13 @@
* lonsdata = <double *>londata
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_INCREF(__pyx_kp_15);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_15);
- __Pyx_GIVEREF(__pyx_kp_15);
- __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -856,7 +959,7 @@
}
__pyx_L10:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":48
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":48
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize # <<<<<<<<<<<<<<
@@ -865,17 +968,17 @@
*/
__pyx_t_4 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__doublesize); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_1);
- __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___doublesize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_ndim = __pyx_t_5;
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_ndim = __pyx_t_6;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":49
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":49
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata # <<<<<<<<<<<<<<
@@ -884,7 +987,7 @@
*/
__pyx_v_lonsdata = ((double *)__pyx_v_londata);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":50
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":50
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
* latsdata = <double *>latdata # <<<<<<<<<<<<<<
@@ -893,7 +996,7 @@
*/
__pyx_v_latsdata = ((double *)__pyx_v_latdata);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":51
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":51
* lonsdata = <double *>londata
* latsdata = <double *>latdata
* azdata = <double *>azdat # <<<<<<<<<<<<<<
@@ -902,7 +1005,7 @@
*/
__pyx_v_azdata = ((double *)__pyx_v_azdat);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":52
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":52
* latsdata = <double *>latdata
* azdata = <double *>azdat
* distdata = <double *>distdat # <<<<<<<<<<<<<<
@@ -911,17 +1014,17 @@
*/
__pyx_v_distdata = ((double *)__pyx_v_distdat);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":53
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":53
* azdata = <double *>azdat
* distdata = <double *>distdat
* for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
*/
- __pyx_t_5 = __pyx_v_ndim;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
+ __pyx_t_6 = __pyx_v_ndim;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":54
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":54
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
* if radians: # <<<<<<<<<<<<<<
@@ -931,7 +1034,7 @@
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":55
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":55
* for i from 0 <= i < ndim:
* if radians:
* self.geodesic_t.p1.v = lonsdata[i] # <<<<<<<<<<<<<<
@@ -940,7 +1043,7 @@
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = (__pyx_v_lonsdata[__pyx_v_i]);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":56
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":56
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i] # <<<<<<<<<<<<<<
@@ -949,7 +1052,7 @@
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = (__pyx_v_latsdata[__pyx_v_i]);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":57
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":57
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i] # <<<<<<<<<<<<<<
@@ -958,7 +1061,7 @@
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = (__pyx_v_azdata[__pyx_v_i]);
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":58
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":58
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i]
* self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<<
@@ -970,64 +1073,64 @@
}
/*else*/ {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":60
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":60
* self.geodesic_t.DIST = distdata[i]
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
*/
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_1);
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___dg2rad); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Multiply(__pyx_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_t_6;
+ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_t_7;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":61
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":61
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i]
*/
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_1);
- __pyx_t_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___dg2rad); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyNumber_Multiply(__pyx_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_t_6;
+ __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_t_7;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":62
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":62
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t)
*/
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_9); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_1);
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___dg2rad); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Multiply(__pyx_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = __pyx_t_6;
+ ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = __pyx_t_7;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":63
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":63
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<<
@@ -1038,7 +1141,7 @@
}
__pyx_L13:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":64
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":64
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t) # <<<<<<<<<<<<<<
@@ -1047,7 +1150,7 @@
*/
geod_pre((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":65
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":65
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t)
* if pj_errno != 0: # <<<<<<<<<<<<<<
@@ -1057,7 +1160,7 @@
__pyx_t_2 = (pj_errno != 0);
if (__pyx_t_2) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":66
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":66
* geod_pre(&self.geodesic_t)
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
@@ -1065,15 +1168,15 @@
* if pj_errno != 0:
*/
__pyx_t_4 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -1081,7 +1184,7 @@
}
__pyx_L14:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":67
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":67
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t) # <<<<<<<<<<<<<<
@@ -1090,7 +1193,7 @@
*/
geod_for((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":68
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":68
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t)
* if pj_errno != 0: # <<<<<<<<<<<<<<
@@ -1100,7 +1203,7 @@
__pyx_t_2 = (pj_errno != 0);
if (__pyx_t_2) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":69
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":69
* geod_for(&self.geodesic_t)
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
@@ -1108,15 +1211,15 @@
* if self.geodesic_t.ALPHA21 != self.geodesic_t.ALPHA21:
*/
__pyx_t_4 = __Pyx_PyBytes_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -1124,7 +1227,7 @@
}
__pyx_L15:;
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":71
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":71
* raise RuntimeError(pj_strerrno(pj_errno))
* # check for NaN.
* if self.geodesic_t.ALPHA21 != self.geodesic_t.ALPHA21: # <<<<<<<<<<<<<<
@@ -1134,7 +1237,7 @@
__pyx_t_2 = (((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21 != ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21);
if (__pyx_t_2) {
- /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geod.pyx":72
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":72
* # check for NaN.
* if self.geodesic_t.ALPHA21 != self.geodesic_t.ALPHA21:
* raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<<
@@ -1142,13 +1245,13 @@
* lonsdata[i] = self.geodesic_t.p2.v
*/
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __Pyx_INCREF(__pyx_kp_16);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_16);
- __Pyx_GIVEREF(__pyx_kp_16);
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
...
[truncated message content] |
|
From: <md...@us...> - 2010-03-10 14:15:01
|
Revision: 8187
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8187&view=rev
Author: mdboom
Date: 2010-03-10 14:14:52 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Make LineBuilder example more complete as a stand-alone script (suggested by David Arnold)
Modified Paths:
--------------
trunk/matplotlib/doc/users/event_handling.rst
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst 2010-03-09 21:09:51 UTC (rev 8186)
+++ trunk/matplotlib/doc/users/event_handling.rst 2010-03-10 14:14:52 UTC (rev 8187)
@@ -111,6 +111,8 @@
Let's look a simple example of a canvas, where a simple line segment
is created every time a mouse is pressed::
+ from matplotlib import pyplot as plt
+
class LineBuilder:
def __init__(self, line):
self.line = line
@@ -132,6 +134,7 @@
line, = ax.plot([0], [0]) # empty line
linebuilder = LineBuilder(line)
+ plt.show()
The :class:`~matplotlib.backend_bases.MouseEvent` that we just used is a
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-03-09 21:09:58
|
Revision: 8186
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8186&view=rev
Author: mdboom
Date: 2010-03-09 21:09:51 +0000 (Tue, 09 Mar 2010)
Log Message:
-----------
Fix PS Type 3 font output -- the custom encoding seems to cause more trouble than it's worth.
Modified Paths:
--------------
trunk/matplotlib/ttconv/pprdrv_tt.cpp
Modified: trunk/matplotlib/ttconv/pprdrv_tt.cpp
===================================================================
--- trunk/matplotlib/ttconv/pprdrv_tt.cpp 2010-03-09 15:44:16 UTC (rev 8185)
+++ trunk/matplotlib/ttconv/pprdrv_tt.cpp 2010-03-09 21:09:51 UTC (rev 8186)
@@ -420,19 +420,21 @@
-------------------------------------------------------------*/
void ttfont_encoding(TTStreamWriter& stream, struct TTFONT *font, std::vector<int>& glyph_ids, font_type_enum target_type)
{
- if (target_type == PS_TYPE_3) {
- stream.printf("/Encoding [ ");
+ stream.putline("/Encoding ISOLatin1Encoding def");
- for (std::vector<int>::const_iterator i = glyph_ids.begin();
- i != glyph_ids.end(); ++i) {
- const char* name = ttfont_CharStrings_getname(font, *i);
- stream.printf("/%s ", name);
- }
+ // if (target_type == PS_TYPE_3) {
+ // stream.printf("/Encoding [ ");
- stream.printf("] def\n");
- } else {
- stream.putline("/Encoding StandardEncoding def");
- }
+ // for (std::vector<int>::const_iterator i = glyph_ids.begin();
+ // i != glyph_ids.end(); ++i) {
+ // const char* name = ttfont_CharStrings_getname(font, *i);
+ // stream.printf("/%s ", name);
+ // }
+
+ // stream.printf("] def\n");
+ // } else {
+ // stream.putline("/Encoding StandardEncoding def");
+ // }
} /* end of ttfont_encoding() */
/*-----------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|