pbfy0 / visvis

Automatically exported from code.google.com/p/visvis
Other
0 stars 0 forks source link

Colormaps as numpy arrays don't work #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
*What steps will reproduce the problem?*

1. Define a nx3 numpy array to be used a colormap.
2. Pass the array to a function as a colormap.

*What is the expected output? What do you see instead?*

We see the following error:

  File "C:\Python27\lib\site-packages\visvis\core\misc.py", line 214, in fsetWithDraw
    fset(self, *args)
  File "C:\Python27\lib\site-packages\visvis\core\baseTexture.py", line 744, in fset
    self._SetColormap(value)
  File "C:\Python27\lib\site-packages\visvis\core\baseTexture.py", line 763, in _SetColormap
    self._colormap.SetMap(value)
  File "C:\Python27\lib\site-packages\visvis\core\baseTexture.py", line 690, in SetMap
    data[:,i] = args[i]
ValueError: could not broadcast input array from shape (3) into shape (257)

*Please provide any additional information below.*

The fix is attached.  The offending code is in baseTexture.py line 685.

Original issue reported on code.google.com by tom.step...@gmail.com on 7 May 2014 at 4:26

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed per 
https://code.google.com/p/visvis/source/detail?r=1ff94aae3acc17fadb631e2015bbe9b
e3ca445dd

Original comment by almar.klein@gmail.com on 16 May 2014 at 1:24

GoogleCodeExporter commented 9 years ago

Original comment by almar.klein@gmail.com on 16 May 2014 at 1:24