matplotlib/matplotlib — Issue #736: creating line2d instances with numpy arrays of coordinates - problems
Author: jmfloyd
Created: 2012-03-02 00:25:43+00:00
State: open

I was creating a number of lines, using a dummy array that I kept changing the coordinate values in. This results in all lines effectively having the same coordinates (as the last line created) if queried with pick or other means, even though they plot up properly (not sure why). If I do the line construct with a numpy copy(), it works properly. Obviously a numpy reference is stored in the instance, of course that reference does not change though the values in the numpy data does. Hence the behaviour. No errors reported.

Change the coords to lists - all works.

Possible fix - test for array and do a copy or create a list from it. Need to ensure a reference to the original is not kept,as it may keep changing.

Can provide a short code example.