<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>

  <TITLE>Sgrayplot</TITLE>

  <TYPE>Scilab Function</TYPE>

  <DATE>April 1993, revised 2005</DATE>

  <SHORT_DESCRIPTION name="Sgrayplot">smooth 2D plot of a surface using
  colors</SHORT_DESCRIPTION>

  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>Sgrayplot(x,y,z,&lt;opt_args&gt;)</CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>Sgrayplot(x,y,z [,strf, rect, nax, zminmax, colminmax, mesh, colout])</CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>

  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>x,y</PARAM_NAME>

        <PARAM_DESCRIPTION>
          <SP>: real row vectors of size n1 and n2.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>

      <PARAM_ITEM>
        <PARAM_NAME>z</PARAM_NAME>

        <PARAM_DESCRIPTION>
          <SP>: real matrix of size (n1,n2). <VERB>z(i,j)</VERB> is the value
          of the surface at the point (x(i),y(j)).</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>

      <PARAM_ITEM>
        <PARAM_NAME>&lt;opt_args&gt;</PARAM_NAME>

        <PARAM_DESCRIPTION>
          <SP>: This represents a sequence of statements
          <VERB>key1=value1,key2=value2</VERB>,... where <VERB>key1</VERB>,
          <VERB>key2,...</VERB> can be one of the following: strf, rect, nax, zminmax, colminmax, mesh, colout
          (see <LINK>plot2d</LINK> for the 3 first and <LINK>fec</LINK> for the 4 last).</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>

      <PARAM_ITEM>
        <PARAM_NAME>strf,rect,nax</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: see <LINK>plot2d</LINK>.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>

      <PARAM_ITEM>
        <PARAM_NAME>zminmax, colminmax, mesh, colout</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: see <LINK>fec</LINK>.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
  </PARAM_INDENT>
  </PARAM>


  <DESCRIPTION>
    <P><VERB>Sgrayplot</VERB> is the same as <VERB>grayplot</VERB> but the
    plot is smoothed. The function <VERB>fec</VERB> is used for smoothing. The
    surface is plotted assuming that it is linear on a set of triangles built
    from the grid (here with n1=5, n2=3):</P>
    <VERBATIM>
             _____________
             | /| /| /| /|
             |/_|/_|/_|/_| 
             | /| /| /| /| 
             |/_|/_|/_|/_|</VERBATIM>

    <P>The function <LINK>colorbar</LINK> may be used to see the color scale.</P>

    <P>The parameter <VERB>zminmax</VERB> is useful for animation purpose (see an
       example after) and the parameter <VERB>colminmax</VERB> lets the user choose a part
       of the current colormap (see the <LINK>fec</LINK> help page).</P>

    <P>Enter the command <VERB>Sgrayplot()</VERB> to see a demo.</P>

  </DESCRIPTION>

  <EXAMPLE><![CDATA[
// example #1
x=-10:10; y=-10:10;m =rand(21,21);
clf()
xset("colormap",hotcolormap(64))
Sgrayplot(x,y,m, strf="011", rect=[-20,-20,20,20])

// example #2
t=-%pi:0.1:%pi; m=sin(t)'*cos(t);
clf()
xset("colormap",jetcolormap(64))
colorbar(-1,1)
Sgrayplot(t,t,m, strf="041")

// example #3: an animation display cos(t)*sin(x)sin(y).
// (Remark: this animation uses the old mode)
n = 30;
nt = 100;
x = linspace(0,2*%pi,n);
y = linspace(0,%pi,n/2);
z = sin(x')*sin(y);
t = linspace(0,4*%pi,nt);
xselect(); clf()
f=gcf();
f.color_map=jetcolormap(64);
f.pixmap='on';
colorbar(-1,1)
Sgrayplot(x,y,cos(t(1))*z, strf="042", zminmax=[-1,1])
c=gce(),e=c.children
xtitle("Kaa''s eyes")
for i = 1:nt
   e.data(:,3)=matrix(cos(t(i))*z,-1,1);
   show_pixmap()
end
f.pixmap='off';
  ]]></EXAMPLE>

  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>fec</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>fgrayplot</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>grayplot</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>Sfgrayplot</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>colorbar</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>

  <AUTHOR>J.Ph.C.</AUTHOR>
</MAN>
