[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: colours in nams
Hi Judith
Judith Mathewson wrote:
> Hi everyone,
>
> This is a really simple question that I am having trouble with in nams.
>
> I would like to make certain nodes of a different colour from the rest
> and I would like to do the same thing with links. I was wondering how
> to do this, I have tried with the following commands in the nam script
> file:
>
> ecolor $n1 $n2 green # to make the link between n1 and n2 green
> ncolor $n1 red # to make the node n1 red
>
> However none of these colours appear, all the nodes and links are in
> black.
> I would appreciate any help that anyone can offer.
I know you can color nodes by doing the following:
set node(0) [$ns node]
$node(0) color "blue"
You can color packets by setting a colorindex corresponding to the packts
flow ID to a certain color.
ex:
$ns color 1 red
set tcp [new Agent/TCP]
$tcp set fid_ 1
Will make the packets sent by this tcp agent red.
I don't know how to color the link :(
--
/Ingela
//The highway of life is always under construction. //
|\ _,,,--,,_ ,)
/,`.-'`' -, ;-;;'
|,4- ) )-,_ ) /\
'---''(_/--' (_/-'