Set color of patches in graypolarplot as the mean of its four corners as specified...
Jean-Baptiste Silvy [Wed, 4 Mar 2009 09:53:48 +0000 (10:53 +0100)]
scilab/modules/graphics/macros/graypolarplot.sci

index c490507..2073dd1 100644 (file)
@@ -149,7 +149,10 @@ for i=1:(nbRho - 1)
                         rho(i + 1) * sinTheta(j)];
 
     // color is the same for each nbDecomposition facets
-    colors(index) = z(j / nbDecomposition + 1, i);
+       // retrieve the not refined index
+       thetaIndex = (j - 1) / nbDecomposition + 1;
+       // colors is the mean of the 4 vertices of the patch
+    colors(index) = (z(thetaIndex, i) + z(thetaIndex + 1, i) + z(thetaIndex + 1, i + 1) + z(thetaIndex, i + 1)) / 4;
 
     index = index + 1;
   end