1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
5
<TITLE>colorbar</TITLE>
6
<TYPE>Scilab Function</TYPE>
7
<DATE>March 2004</DATE>
8
<SHORT_DESCRIPTION name="colorbar">draw a colorbar</SHORT_DESCRIPTION>
11
<CALLING_SEQUENCE_ITEM>colorbar(umin, umax [, colminmax])</CALLING_SEQUENCE_ITEM>
17
<PARAM_NAME>umin</PARAM_NAME>
19
<SP>: real scalar, the minimum value associated with the plot</SP>
23
<PARAM_NAME>umax</PARAM_NAME>
25
<SP>: real scalar, the maximum value associated with the plot</SP>
29
<PARAM_NAME>colminmax</PARAM_NAME>
31
<SP>: (optional) a vector with 2 integer components</SP>
39
Draw a colorbar for a plot3d, fec, Sgrayplot, etc... The function may be called
40
<BD>BEFORE</BD> the plot3d, fec, Sgrayplot,... because its sets and changes the
41
frame for the plot. This way the colorbar is not part of the associated plot and
42
so is not modified by a zoom or a rotation.
45
The optional argument <VERB>colminmax</VERB> may be used to precise the first color
46
(associated with umin) and the the last color (associated with umax) of the current
47
colormap. By default <VERB>colminmax=[1 nb_colors]</VERB> where nb_colors is the
48
number of colors of the current colormap.
55
z = cos(2*%pi*x)'*sin(2*%pi*x);
56
zm = min(z); zM = max(z);
58
xset("colormap",jetcolormap(64))
61
xtitle("The function cos(2 pi x)sin(2 pi y)")
65
z = cos(2*%pi*x)'*sin(2*%pi*x);
66
zm = min(z); zM = max(z);
67
zz = abs(0.5*cos(2*%pi*x)'*cos(2*%pi*x));
68
zzm = min(zz); zzM = max(zz);
70
xset("colormap",jetcolormap(64))
73
Sgrayplot(x,x,z, strf="031", rect=[0 0 1 1])
74
xtitle("a Sgrayplot with a colorbar")
78
xtitle("a plot3d1 with a colorbar")
82
xtitle("a plot3d1 with a colorbar")
85
Sgrayplot(x,x,zz, strf="031", rect=[0 0 1 1])
86
xtitle("a Sgrayplot with a colorbar")
90
zz = abs(0.5*cos(2*%pi*x)'*cos(2*%pi*x));
91
zzm = min(zz); zzM = max(zz);
92
[xf,yf,zf]=genfac3d(x,x,zz);
95
xset("colormap",hotcolormap(nb_col))
97
nbcol = xget("lastpattern")
98
zcol = dsearch(zf, linspace(zzm, zzM, nb_col+1));
99
plot3d(xf, yf, list(zf, zcol), flag = [-2 6 4])
100
xtitle("a plot3d with shaded interpolated colors")
106
<LINK>colormap</LINK>