[Scilab-users] grayplot

Rafael Guerra jrafaelbguerra at hotmail.com
Fri Oct 28 14:12:21 CEST 2016


Hi Samuel,

Fyi, on my Scilab 5.5.2 (64-bit) Win 7 configuration, the code here below still fails for one xfarcs() call.
Uncommenting the second xfarcs() call does fix the plot (attached).
It looks like a bug. Or could it be only an issue with my configuration?

/////// START OF CODE
clf();
x=[8030 8040 7998 8008 8037 7956 7937 7963 7919 7920];
y=[9478 9533 9578 9590 9597 9626 9627 9723 9766 9768];
z=[-2.39965177 1.81709373 -1.14068067 -2.95249772 -3.25881290 1.36802530 -1.46287727 ...
-6.40911865 1.03929353 1.49115121];

xm = min(x); xM = min(x); dx = strange(x);
ym = min(y); yM = min(y); dy = strange(y);
zm = min(z); zM = max(z);

xtitle("Color coded scatter data under Scilab 5x")
mg = 0.05;  // plot area relative margin
nc = 64;  // number of colors
rect0 = [xm,ym,xM,yM] + mg*[-dx,-dy,dx,dy];
//plotframe(rect)  // currently is issuing error message
plot2d([],[],rect=rect0, axesflag=1)
f = gcf();
f.color_map = jetcolormap(nc);

//shaping dots (by S.Gougeon)
ar = f.axes_size; ar = ar(1)/ar(2); // w/h aspect ratio of figure
dotsize_r = 0.04;  //  relative size of dots
h = dy*dotsize_r;
w = dx*dotsize_r/ar;
dots = [x-w/2; y+h/2; ones(x)*w; ones(x)*h; zeros(x); ones(x)*64*360];
c = round(1+(z-zm)*(nc-1)/(zM-zm));  //dots colors scaled against z-value
xfarcs(dots, c);
//xfarcs(dots, c);  // Uncomment to display all data in Scilab 5.5.2 (64-bit) Win7
xgrid(color("grey70"));  //a better grid style:
a = gca();
a.grid_style=[8 8];
colorbar(zm,zM);
/////// END OF CODE


Thanks and regards,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfarcs_one_call_Scilab5.5.2_Win7.gif
Type: image/gif
Size: 10284 bytes
Desc: xfarcs_one_call_Scilab5.5.2_Win7.gif
URL: <https://lists.scilab.org/pipermail/users/attachments/20161028/fb2eb5fb/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfarcs_two_calls_Scilab5.5.2_Win7.gif
Type: image/gif
Size: 10462 bytes
Desc: xfarcs_two_calls_Scilab5.5.2_Win7.gif
URL: <https://lists.scilab.org/pipermail/users/attachments/20161028/fb2eb5fb/attachment-0001.gif>


More information about the users mailing list