Skip to content

Commit 446e02b

Browse files
committed
Fix bug in pcolormesh.
svn path=/branches/transforms/; revision=4565
1 parent e5408fb commit 446e02b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/_backend_agg.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ class QuadMeshGenerator {
11451145
inline unsigned vertex(unsigned idx, double* x, double* y) {
11461146
size_t m = (idx & 0x2) ? (m_m + 1) : m_m;
11471147
size_t n = (idx+1 & 0x2) ? (m_n + 1) : m_n;
1148-
double* pair = (double*)PyArray_GETPTR2(m_coordinates, m, n);
1148+
double* pair = (double*)PyArray_GETPTR2(m_coordinates, n, m);
11491149
*x = *pair++;
11501150
*y = *pair;
11511151
return (idx) ? agg::path_cmd_line_to : agg::path_cmd_move_to;
@@ -1172,7 +1172,7 @@ class QuadMeshGenerator {
11721172

11731173
inline QuadMeshGenerator(size_t meshWidth, size_t meshHeight, const Py::Object& coordinates) :
11741174
m_meshWidth(meshWidth), m_meshHeight(meshHeight), m_coordinates(NULL) {
1175-
PyArrayObject* coordinates_array = (PyArrayObject*)PyArray_FromObject(coordinates.ptr(), PyArray_DOUBLE, 1, 3);
1175+
PyArrayObject* coordinates_array = (PyArrayObject*)PyArray_FromObject(coordinates.ptr(), PyArray_DOUBLE, 3, 3);
11761176
if (!coordinates_array) {
11771177
throw Py::ValueError("Invalid coordinates array.");
11781178
}
@@ -1189,7 +1189,7 @@ class QuadMeshGenerator {
11891189
}
11901190

11911191
inline path_iterator operator()(size_t i) const {
1192-
return QuadMeshPathIterator(i % m_meshHeight, i / m_meshHeight, m_coordinates);
1192+
return QuadMeshPathIterator(i % m_meshWidth, i / m_meshWidth, m_coordinates);
11931193
}
11941194
};
11951195

0 commit comments

Comments
 (0)