SciLab: RGB color plot, trying to color each mark with its respective color -
all,
i have made 3d plot of colors in rgb color space. marks same color. each mark color represents in space. so, mark in red corner of plot should red, etc...
the code have far below.
thanks help,
-bill
// rgb color data few shades of pink , red r = [1, 1, 1, 1, 0.8588235294117647, 0.7803921568627451, 1, 0.9803921568627451, 0.9137254901960784, 0.9411764705882353]'; g = [0.7529411764705882, 0.7137254901960785, 0.4117647058823529, 0.07843137254901961, 0.4392156862745098, 0.08235294117647059, 0.6274509803921569, 0.5019607843137255, 0.5882352941176471, 0.5019607843137255]'; b = [0.796078431372549, 0.7568627450980392, 0.7058823529411765, 0.5764705882352941, 0.5764705882352941, 0.5215686274509804, 0.4784313725490196, 0.4470588235294118, 0.4784313725490196, 0.5019607843137255]'; // draw 3d graph r g b vectors param3d(r,g,b,35,45,"red@green@blue",[2,4]); title("some shades of pink , red"); // set marks ball style p=get("hdl"); p.mark_style = 9; // turn lines off have points e = gce(); e.line_mode="off"; e.mark_mode="on"; // set color map our rgb values cmap=[r g b]; // put code here color each mark respective color // have no idea @ point.
as far know, can set mark_foreground color of marks in polyline same color. confirmed the documentation.
a fast solution create polyline each marker , color it. nicer solution implementing surface plot.
working example
i created working example based on code, not pretty , has lot of room improvement. solves direct question.
// rgb color data few shades of pink , red r = [1, 1, 1, 1, 0.8588235294117647, 0.7803921568627451, 1, 0.9803921568627451, 0.9137254901960784, 0.9411764705882353]'; g = [0.7529411764705882, 0.7137254901960785, 0.4117647058823529, 0.07843137254901961, 0.4392156862745098, 0.08235294117647059, 0.6274509803921569, 0.5019607843137255, 0.5882352941176471, 0.5019607843137255]'; b = [0.796078431372549, 0.7568627450980392, 0.7058823529411765, 0.5764705882352941, 0.5764705882352941, 0.5215686274509804, 0.4784313725490196, 0.4470588235294118, 0.4784313725490196, 0.5019607843137255]'; // draw 3d graph r g b vectors i=1:length(r) param3d( r(i), g(i), b(i), 35,45,"red@green@blue",[2,4]); if( == 1 ) title("some shades of pink , red"); // set color map our rgb values cmap=[r g b]; // put code here color each mark respective color //assign colormap current figure f=gcf(); f.color_map=cmap; end p=get("hdl"); p.mark_style = 9; // turn lines off have points e = gce(); e.line_mode="off"; e.mark_mode="on"; // assign mark color e.mark_foreground= ; end
Comments
Post a Comment