Section: Handle-Based Graphics
winlev(window,level)
where window is the new window, and level is the new level, or
winlev
in which case it returns a vector containing the current window and level for the active image.
[0,1], and must
therefor map an arbitrary image x to this range before it can
be displayed. By default, the image command chooses
and
This ensures that the entire range of image values in x are
mapped to the screen. With the winlev function, you can change
the range of values mapped. In general, before display, a pixel x
is mapped to [0,1] via:
--> t = linspace(-1,1,256); --> xmat = ones(256,1)*t; ymat = xmat'; --> A = exp(-(xmat.^2 + ymat.^2)*100); --> image(A); --> quit
The data range of A is [0,1], as we can verify numerically:
--> min(A(:))
ans =
1.3839e-87
--> max(A(:))
ans =
0.9969
-->
quit
To see the tail behavior, we use the winlev command to force FreeMat
to map a smaller range of A to the colormap.
--> image(A); --> winlev(1e-4,0.5e-4) --> quit
The result is a look at more of the tail behavior of A.
We can also use the winlev function to find out what the
window and level are once set, as in the following example.
--> image(A); --> winlev(1e-4,0.5e-4) --> winlev ans = 1.0000e-04 --> quit