Hello,

Apologies if this has already been reported...

While using Numpy and PLplot I've stumbled over a potential problem with 
the interface. Numpy arrays are not necessarily contiguous in memory, 
i.e. if I have a 2D array:

p = [[1,2],[2,3],[3,4]]

And I do:
plplot.plpoin(p[:,0], p[:,1], 9)

Then I'll get a segmentation fault. Surprisingly, I have found that even 
some 1D arrays are not be contiguous. Should we be trying to protect the 
user by doing something like this to all the arrays that we get from numpy?
plplot.plpoin(numpy.ascontiguousarray(p[:,0]), 
numpy.ascontiguousarray(p[:,1]), 9)

-Hazen


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to