Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ff897d8

Browse filesBrowse files
committed
more contour fixes
svn path=/trunk/matplotlib/; revision=879
1 parent ab36d67 commit ff897d8
Copy full SHA for ff897d8

File tree

Expand file treeCollapse file tree

2 files changed

+14
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-8
lines changed

‎lib/matplotlib/axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes.py
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,13 @@ def contour(self, z,
10031003
else:
10041004
jmax, imax = shape(z)
10051005

1006-
reg = ones((jmax,imax), Int32)
1006+
reg = ones((jmax+1,imax), Int32)
10071007
reg[:,0]=0
1008+
reg[0,:]=0
1009+
reg[:,-1]=0
1010+
reg[-1,:]=0
1011+
#print reg
1012+
10081013
triangle = zeros((jmax,imax), Int16)
10091014

10101015
if x == None and y == None:
@@ -1063,14 +1068,14 @@ def autolev(N):
10631068
levels = []
10641069
collections = []
10651070

1066-
region = 1 # FIXME: what should this be?
1071+
region = 0
10671072
for level, color, width in args:
10681073
ntotal, nparts = _contour.GcInit1(x, y, reg, triangle, region, z, level)
10691074
np = zeros((nparts,), Int)
10701075
xp = zeros((ntotal, ), Float64)
10711076
yp = zeros((ntotal,), Float64)
10721077
nlist = _contour.GcTrace(np, xp, yp)
1073-
1078+
#print min(ravel(triangle)), max(ravel(triangle))
10741079
col = LineCollection(nlist, colors=color, linewidths = width)
10751080
col.set_label(fmt%level)
10761081
self.add_collection(col)

‎src/_contour.c

Copy file name to clipboardExpand all lines: src/_contour.c
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ static PyObject * GcInit1_wrap(PyObject *self, PyObject *args)
7777
PyErr_SetString(PyExc_ValueError, "Arrays y and z must have equal shapes");
7878
return NULL;
7979
}
80-
if ((zzsize[0] != regdata->dimensions[0]) || (zzsize[1] != regdata->dimensions[1]))
81-
{
82-
PyErr_SetString(PyExc_ValueError, "Arrays reg and z must have equal shapes");
83-
return NULL;
84-
}
80+
81+
//if ((zzsize[0] != regdata->dimensions[0]) || (zzsize[1] != regdata->dimensions[1]))
82+
//{
83+
// PyErr_SetString(PyExc_ValueError, "Arrays reg and z must have equal shapes");
84+
// return NULL;
85+
// }
8586
if ((zzsize[0] != tridata->dimensions[0]) || (zzsize[1] != tridata->dimensions[1]))
8687
{
8788
PyErr_SetString(PyExc_ValueError, "Arrays triangle and z must have equal shapes");

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.