Hello list,
It may not be very important, but I collected some small bugs while exploring
the examples and for some of them I got little patches.
- for me their occur two "typos" in matplotlib/text.py (see the attached
text.patch, please)
- some examples don't work for me (see attached some_examples.patch, please)
e.g. changes in legend_scatter.py due to a DeprecationWarning
(matplotlib/axes.py:4288) although that doesn't fix the problem of the
legend_scatter.py (see attached output_of_legend_scatter.out, please)
I recognized, that the 'handle._edgecolors' is an empty list at this point,
but unfortunately I couldn't figure out why.
- the function mlab.rec2excel does not exist anymore
-> in matplotlib/mlab.py:
line 73: rec2excel(r, 'test.xls', formatd=formatd)
needs to be removed
-> examples/loadrec.py needs to be changed accordingly (I don't
know what is properly in that case )
best regards
Matthias
Index: lib/matplotlib/text.py
===================================================================
--- lib/matplotlib/text.py (revision 5137)
+++ lib/matplotlib/text.py (working copy)
@@ -1083,7 +1083,7 @@
dx, dy = self._get_xy(dx, dy, self.xycoords)
# convert the offset
- dpi = self.figure.dpi.get()
+ dpi = self.figure.get_dpi()
x *= dpi/72.
y *= dpi/72.
@@ -1095,7 +1095,7 @@
elif s=='polar':
theta, r = x, y
x = r*np.cos(theta)
- y = r*np.cosmsin(theta)
+ y = r*np.sin(theta)
trans = self.axes.transData
return trans.transform_point((x,y))
elif s=='figure points':
Index: examples/custom_projection_example.py
===================================================================
--- examples/custom_projection_example.py (revision 5137)
+++ examples/custom_projection_example.py (working copy)
@@ -7,6 +7,8 @@
BboxTransformTo, IdentityTransform, Transform, TransformWrapper
from matplotlib.projections import register_projection
+import numpy as npy
+
# This example projection class is rather long, but it is designed to
# illustrate many features, not all of which will be used every time.
# It is also common to factor out a lot of these methods into common
Index: examples/legend_scatter.py
===================================================================
--- examples/legend_scatter.py (revision 5137)
+++ examples/legend_scatter.py (working copy)
@@ -3,7 +3,7 @@
N=1000
-props = dict( alpha=0.5, faceted=False )
+props = dict( alpha=0.5, edgecolors='none' )
handles = []
colours = ['red', 'green', 'blue', 'magenta', 'cyan', 'yellow']
Index: examples/poly_editor.py
===================================================================
--- examples/poly_editor.py (revision 5137)
+++ examples/poly_editor.py (working copy)
@@ -5,7 +5,7 @@
"""
from matplotlib.artist import Artist
from matplotlib.patches import Polygon, CirclePolygon
-from numpy import sqrt, nonzero, equal, asarray, dot, amin
+from numpy import sqrt, nonzero, equal, array, asarray, dot, amin
from matplotlib.mlab import dist_point_to_segment
@@ -69,7 +69,7 @@
'get the index of the vertex under point if within epsilon tolerance'
# display coords
- xy = npy.asarray(self.poly.xy)
+ xy = asarray(self.poly.xy)
xyt = self.poly.get_transform().transform(xy)
xt, yt = xyt[:, 0], xyt[:, 1]
d = sqrt((xt-event.x)**2 + (yt-event.y)**2)
@@ -114,7 +114,7 @@
s1 = xys[i+1]
d = dist_point_to_segment(p, s0, s1)
if d<=self.epsilon:
- self.poly.xy = npy.array(
+ self.poly.xy = array(
list(self.poly.xy[:i]) +
[(event.xdata, event.ydata)] +
list(self.poly.xy[i:]))
@@ -152,8 +152,8 @@
theta = arange(0, 2*pi, 0.1)
r = 1.5
-xs = r*npy.cos(theta)
-ys = r*npy.sin(theta)
+xs = r*cos(theta)
+ys = r*sin(theta)
poly = Polygon(zip(xs, ys,), animated=True)
Traceback (most recent call last):
File "legend_scatter.py", line 16, in <module>
legend(handles, colours)
File "/media/disk/SOFT/lib/python2.5/site-packages/matplotlib/pyplot.py",
line 2167, in legend
ret = gca().legend(*args, **kwargs)
File "/media/disk/SOFT//lib/python2.5/site-packages/matplotlib/axes.py", line
3205, in legend
self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
File "/media/disk/SOFT/lib/python2.5/site-packages/matplotlib/legend.py",
line 182, in __init__
self.legendHandles = self._get_handles(handles, self.texts)
File "/media/disk/SOFT/lib/python2.5/site-packages/matplotlib/legend.py",
line 292, in _get_handles
p.set_edgecolor(handle._edgecolors[0])
IndexError: index out of bounds
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users