Get rid of show_pixmap + add new sample images 81/8681/2
Sylvestre Ledru [Mon, 13 Aug 2012 11:33:29 +0000 (13:33 +0200)]
Change-Id: I18257ba811bf5ec0190b67dbe3f511d239e95948

scilab/modules/graphics/help/en_US/2d_plot/Matplot1.xml
scilab/modules/graphics/help/en_US/2d_plot/Sgrayplot.xml
scilab/modules/graphics/help/en_US/color_management/hsv2rgb.xml

index 9917764..4ee1e1a 100644 (file)
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[ 
-//--- first example
 clf();
 ax=gca();//get current axes handle
 ax.data_bounds=[0,0;10,10];//set the data_bounds
-ax.box='on'; //draw a box 
-a=5*ones(11,11); a(2:10,2:10)=4; a(5:7,5:7)=2;
+ax.box='on'; //draw a box
+a=5*ones(11,11);
+a(2:10,2:10)=4;
+a(5:7,5:7)=2;
 // first matrix in rectangle [1,1,3,3]
 Matplot1(a,[1,1,3,3])
-a=ones(10,10); a= 3*tril(a)+ 2*a; 
+a=ones(10,10);
+a= 3*tril(a)+ 2*a;
 // second matrix in rectangle [5,6,7,8]
 Matplot1(a,[5,6,7,8])
-
-//--- second example  (animation)
+ ]]></programlisting>
+        <scilab:image>
+            ax=gca();//get current axes handle
+            ax.data_bounds=[0,0;10,10];//set the data_bounds
+            ax.box='on'; //draw a box
+            a=5*ones(11,11); a(2:10,2:10)=4; a(5:7,5:7)=2;
+            // first matrix in rectangle [1,1,3,3]
+            Matplot1(a,[1,1,3,3])
+            a=ones(10,10); a= 3*tril(a)+ 2*a;
+            // second matrix in rectangle [5,6,7,8]
+            Matplot1(a,[5,6,7,8])
+        </scilab:image>
+        <programlisting role="example"><![CDATA[ 
+//--- (animation)
 n=100;
 
 clf();
@@ -77,8 +91,7 @@ f=gcf();//get current figure handle
 f.pixmap='on';//double buffer mode
 ax=gca();//get current axes handle
 ax.data_bounds=[0,0;10,10];//set the data_bounds
-ax.box='on'; //draw a box 
-show_pixmap()
+ax.box='on'; //draw a box
 for k=-n:n,
   a=ones(n,n);
   a= 3*tril(a,k)+ 2*a;
@@ -86,7 +99,6 @@ for k=-n:n,
   k1= 3*(k+100)/200;
   if k>-n then delete(gce()),end
   Matplot1(a,[k1,2,k1+7,9])
-  show_pixmap() //send double buffer to screen
   sleep(8); // Slow down the simulation
 end
 f.pixmap='off';
index c22e2f1..2580b3f 100644 (file)
@@ -280,20 +280,35 @@ _____________
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
+        <programlisting role="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])
-
+ ]]></programlisting>
+        <scilab:image>
+            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])
+        </scilab:image>
+        <programlisting role="example"><![CDATA[
 // 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")
-
+Sgrayplot(t,t,m, strf="041") 
+]]></programlisting>
+        <scilab:image>
+            t=-%pi:0.1:%pi; m=sin(t)'*cos(t);
+            clf()
+            xset("colormap",jetcolormap(64))
+            colorbar(-1,1)
+            Sgrayplot(t,t,m, strf="041") 
+        </scilab:image>
+        <programlisting role="example"><![CDATA[
 // example #3: an animation display cos(t)*sin(x)sin(y).
 n = 30;
 nt = 100;
@@ -311,10 +326,29 @@ 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';
  ]]></programlisting>
+        <scilab:image>
+            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);
+            show_window(); 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);
+            end
+            f.pixmap='off';
+        </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
index fbc6f88..8374d20 100644 (file)
             for h=0:0.1:1
             hsv=[h*ones(32,1) linspace(0,1,32)' 0.7*ones(32,1)];
             f.color_map=hsv2rgb(hsv);
-            show_pixmap()
             xpause(10000)
             end
             for v=0:0.1:1
             hsv=[ones(32,1) linspace(0,1,32)' v*ones(32,1)];
             f.color_map=hsv2rgb(hsv);
-            show_pixmap()
             xpause(10000)
             end
         </scilab:image>
@@ -125,13 +123,11 @@ f=gcf();f.pixmap='on';
 for h=0:0.1:1
   hsv=[h*ones(32,1) linspace(0,1,32)' 0.7*ones(32,1)];
   f.color_map=hsv2rgb(hsv);
-  show_pixmap()
   xpause(10000)
 end
 for v=0:0.1:1
   hsv=[ones(32,1) linspace(0,1,32)' v*ones(32,1)];
   f.color_map=hsv2rgb(hsv);
-  show_pixmap()
   xpause(10000)
 end
  ]]></programlisting>