next up previous contents index
Next: Return Vertex Coordinates for Up: Useful Functions for Developers Previous: Controlling Points Close to   Contents   Index

Scale variables to a palette: bytscl, split_bytscl

Calling Sequence
...

  
bytscl(z, top= max_byte, cmin= lower_cutoff, 
cmax= upper_cutoff) 
split_bytscl (x, upper, cmin = None, cmax = None)

Description
bytscl returns an unsigned char array (Python typecode "b") of the same shape as Z, with values linearly scaled to the range 0 to one less than the current palette size. If MAX_BYTE is specified, then the scaled values will run from 0 to MAX_BYTE instead. If LOWER_CUTOFF and/ or UPPER_CUTOFF are specified, Z values outside this range are mapped to the cutoff value; otherwise the linear scaling maps the extreme values of Z to 0 and MAX_BYTE.

split_bytscl is as the bytscl function, but scales to the lower half of a split palette (0-99, normally the color scale) if the second parameter is zero or nil, or the upper half (100-199, normally the gray scale) if the second parameter is non-zero.



Michiel Jan Laurens de Hoon 2003-04-19