widgetti / ipyvolume

3d plotting for Python in the Jupyter notebook based on IPython widgets using WebGL
MIT License
1.95k stars 236 forks source link

accept python lists in pylab.plot (not only numpy) #432

Open martinalex000 opened 1 year ago

martinalex000 commented 1 year ago

It would be nice if pylab.plot would accept python lists of length longer than two.

Currently, the call ipv.pylab.plot([0,1,3],[0,1,0],[3,5,5]) leads to the rather cryptic error message TypeError: only integer scalar arrays can be converted to a scalar index.

One solution would be to add a line values = np.array(values) to the function _grow_limit just before the call finites = np.isfinite(values)