[Scilab-users] RGB color plot, trying to color each mark with its respective color

Samuel Gougeon sgougeon at free.fr
Fri Oct 11 21:20:57 CEST 2013


Hello,

Le 10/10/2013 03:08, William Drago a écrit :
> All,
>
> I have made a 3d plot of some colors in the RGB color space. Currently 
> the marks are all the same color. I would like each mark to be the 
> color it represents in the space. So, a mark in the red corner of the 
> plot should be red, etc...
>
> The code I have so far is below.
.
The implementation of new features as this one has been started here:
https://codereview.scilab.org/#/c/10582/
For the time being, as far as i know, the only possibility is to use 
param3d1().
Herebelow is an example.
HTH
Samuel


// Data
nc = 100; // number of colors
n = 500; // number of points
x = rand(1,n); y = rand(1,n);
z = rand(1,n); w = rand(1,n)*nc;

// Display :
clf
f = gcf();
f.color_map = jetcolormap(nc);
drawlater
param3d1([x ; x],[y ; y],[z ; z])

// Display and size of points :
e = gce();
e.children.mark_mode = "on";
e.children.mark_size_unit = "point";
e.children.mark_size = 5;

// Assigning colors to the points:
for i = 1:length(e.children)
e.children(i).mark_foreground = w(i);
end
drawnow




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20131011/bb63c3e8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jghbicfe.png
Type: image/png
Size: 19161 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20131011/bb63c3e8/attachment.png>


More information about the users mailing list