[Scilab-users] grayplot
Rafael Guerra
jrafaelbguerra at hotmail.com
Thu Oct 27 20:31:48 CEST 2016
Hi Samuel,
It looks brilliant J
Thanks and regards,
Rafael
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of Samuel Gougeon
Sent: Thursday, October 27, 2016 8:15 PM
To: Users mailing list for Scilab <users at lists.scilab.org>
Subject: Re: [Scilab-users] grayplot
Le 27/10/2016 18:50, Rafael Guerra a écrit :
Hi Samuel,
Scilab-6 'scatter' plot function seems indeed quite adequate for these data.
Would it be possible to produce such scatter plots with dots color coded (as attached) in Scilab 5?
.
yes it is, for instance using xfarcs() as below.
Regards
np = 40; // number of points
x = grand(1,np, "unf", -20, 140);
y = grand(1,np, "unf", -50, 300);
dz = 6.4;
z = grand(1,np, "unf", -dz, dz);
clf
f = gcf();
nc = 100;
f.color_map = jetcolormap(nc);
plotframe([-20 -50 140 300])
c = round((z+dz)/(2*dz)*(nc-1)+1); // colors of dots scaled against their z
// shaping dots
ar = f.axes_size; ar = ar(1)/ar(2); // w/h aspect ratio of figure
dotsize_r = 0.04; // relative size of dots
h = strange(y)*dotsize_r;
w = strange(x)*dotsize_r/ar;
dots = [x ; y ; ones(x)*w ; ones(x)*h ; zeros(x) ; ones(x)*64*360];
// plotting dots
xfarcs(dots, c);
// colorbar
colorbar(-dz,dz)
[cid:image001.png at 01D23091.20767130]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161027/59a52402/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 8775 bytes
Desc: image001.png
URL: <https://lists.scilab.org/pipermail/users/attachments/20161027/59a52402/attachment.png>
More information about the users
mailing list