I want to create bar charts with "bar". There are 16 different data
rows in my input matrix.
The automatic color distribution obviosly create only 7 different
colors from data entry 1 to 7. Then it begins with the same colors
again from 8 to 14 and so on til 16.
My new Idea:
I created 16 "bar" commands in a loop. In every loop the bar gets a
different color. At the end "barhomogenize('stacked',1);" sum these
seperat bars up to the suggested result.
Fine for me BUT:
The color option for bar only accept a color string like "red" or
"green". These basic colors are not enough to create 16 or more color
divided bar parts. Colors like "scilab green1" or something like it are
not accepted.
My question: Is there any way to solve this problem?
I would like the have at least 50 different colors
my code:
n = 16;
cmap=jetcolormap(n); // sets the colormap jet
cmap=get(gcf(),"color_map"); // to get the actual color map
for i = 1:n;
names=rgb2name(cmap(i,:)*255); // gets the color name out of the r
g b
// also you can get the i'sted color from the colormap
(jetcolormap(n); )
names(1,1) // result is a matrix, because color can have more than
one name in scilab
bar(mat(:,i+1),names(1,1)); // creates a bar chart from matrix mat
from row 2 - 17 (n = 16)
end
barhomogenize('stacked',1); // sums up the created bars
Thanks for all answers
Tohasi
Does someone know of a good book or tutorial for an introduction to
"Scilab and finite elements" ?
Thanks in advance,
jF
http://www.scilab.org/contrib/index_contrib.php?page=download.php&category=FINITE%20ELEMENTS%20TOOLS
Francois
"gobin" <gobin...@gobinjf.be> a écrit dans le message de news:
1145619080....@chouchou.gobinjf.be...
Problem is in function getLineSpec (SCI/macros/xdess/getLineSpec.sci).
This function only knows about the following colors:
ColorVal = ['red' 'green' 'blue' 'cyan' 'magenta' 'yellow' 'black'
'black' 'white']
This should be expanded to be aware of all the colors listed in help
color_list. This improvement is however not completely trivial.
Good luck,
Francois
Tohasi a écrit :
To help Thomas, I have made a small hack such that any color from
the color_list help page should work. Also you could put colors in the
form "[r,g,b]" that is a vector of r,g,b inside a string with r,g and
b
integers in [0,255].
If you are interested you can download it at :
http://www.iecn.u-nancy.fr/~pincon/
hth
Bruno
thanks again for your help
It work fine. So nice to have this internet. Communication is
everything.
Thomas