How do I use myvlt colour tables in dislin python binding?

27 views
Skip to first unread message

GC

unread,
Jul 22, 2014, 6:49:35 PM7/22/14
to dislin...@googlegroups.com
Hello,

A custom cmap is easy to define in the dislin Fortran 90 binding, but what do I provide to python?
Providing 3 lists  r = [...(256 floats 0-1) ...]; g = [...]; b = [...]
ds.myvlt(r,g,b,256)
produces ValueError: parameter is not a sequence
which is uninformative because lists *are* python sequences.
Using the numpy equivalent
r = np.array([...],np.float32); g = ...
ds.myvlt(r.tolist(),g.tolist(),b.tolist(),256)
which works for all other dislin calls using numpy, also fails w/
AttributeError: 'function' object has no attribute 'tolist'

So, what please is the correct call?

Thank you

GC

unread,
Jul 22, 2014, 7:11:13 PM7/22/14
to dislin...@googlegroups.com
Never mind, my error. A function 'r' is defined elsewhere and it is picking that up instead of the list.  The 3 lists work fine.
Reply all
Reply to author
Forward
0 new messages