如何给pajek中的节点和边着色?

 

 如何给pajek中的节点和边着色?_第1张图片

                                                      如何给pajek中的节点和边着色?

http://blog.csdn.net/lyh_shzu/article/details/55236817

 

今天用了pajek画了网络图,如下图:

如何给pajek中的节点和边着色?_第2张图片

但是,边的颜色不知道怎么加上去,找了很多网上的资料都没有详细说明的,后来在软件中测试一下,直接在.net文件中定义好颜色,然后在图的Options——>Colors——>Edges选项中勾选AsDefined on Input File

 

.net文件中的数据如下(数据来源于http://mrvar.fdv.uni-lj.si/pajek/SignedNetworks/SampsonT4.paj):

*Vertices18
 1 "John_Bosco" 0.0 0.0 0.0 ic Green bc Brown 
 2 "Gregory" 0.0 0.0 0.0 ic Green bc Brown 
 3 "Basil" 0.0 0.0 0.0 ic Green bc Brown
 4 "Peter" 0.0 0.0 0.0 ic Green bc Brown
 5 "Bonaventur" 0.0 0.0 0.0 ic Green bc Brown
 6 "Berthold" 0.0 0.0 0.0 ic Green bc Brown
 7 "Mark" 0.0 0.0 0.0 ic Green bc Brown
 8 "Victor" 0.0 0.0 0.0 ic Green bc Brown
 9 "Ambrose" 0.0 0.0 0.0 ic Green bc Brown
10 "Romuald" 0.0 0.0 0.0 ic Green bc Brown
11 "Louis" 0.0 0.0 0.0 ic Green bc Brown
12 "Winfrid" 0.0 0.0 0.0 ic Green bc Brown
13 "Amand" 0.0 0.0 0.0 ic Green bc Brown
14 "Hugh" 0.0 0.0 0.0 ic Green bc Brown
15 "Boniface" 0.0 0.0 0.0 ic Green bc Brown
16 "Albert" 0.0 0.0 0.0 ic Green bc Brown
17 "Elias" 0.0 0.0 0.0 ic Green bc Brown
18 "Simplicius" 0.0 0.0 0.0 ic Green bc Brown
*Edges
1 2 -2 c  Red(如果是无向边,则需要正反两个方向的边都要写颜色,否则,这条边是没有颜色的,eg:节点a和节点b之间)
1 3  3 c Black(有一条无向边,要让这条边显示为Green,则,需要这样写:a b ic Green  ;b a ic Green;这样才可以显示出颜色)
1 7 -3 c  Red(如果单独在a b 后面写 ic Green 而没在b a 后写ic Green,则,这条边不会显示为Green)
1 10 -1 c  Red
1 12  1 c Black
1 14  2 c Black
2 1  3 c Black
2 4 -3 c  Red
2 7  1 c Black
2 8 -2 c  Red
2 12  2 c Black
2 13 -1 c  Red
3 1  3 c Black
3 2 -2 c  Red
3 4 -3 c  Red
3 6 -2 c  Red
3 13  2 c Black
3 16 -1 c  Red
3 17  1 c Black
3 18  2 c Black
4 1 -2 c  Red
4 2 -3 c  Red
4 5  3 c Black
4 6  1 c Black
4 11  2 c Black   
4 14 -1 c  Red
5 4  3 c Black
5 9  1 c Black
5 11  2 c Black
6 2 -1 c  Red
6 3 -3 c  Red
6 4  3 c Black
6 5  1 c Black
6 7 -2 c  Red
6 9  2 c Black
6 17 -2 c  Red
7 2  3 c Black
7 4 -3 c  Red
6 -2 c  Red
7 8 -1 c  Red
7 12  1 c Black
7 16  2 c Black
8 2 -3 c  Red
8 3 -2 c  Red
8 4  3 c Black
8 6  2 c Black
8 9  1 c Black
8 14 -1 c  Red
9 3 -3 c  Red
9 5  1 c Black
9 8  3 c Black
9 12  2 c Black
9 17 -2 c  Red
9 18 -1 c  Red
10 4  3 c Black
10 5  1 c Black
10 9  1 c Black
10 13  2 c Black
11 1 -1 c  Red
11 2 -3 c  Red
11 3 -2 c  Red
11 5  2 c Black
11 8  3 c Black
11 14  1 c Black
12 1  3 c Black
12 2  2 c Black
12 7  1 c Black
13 2 -3 c  Red
13 5  2 c Black
13 6 -2 c  Red
13 7  1 c Black
13 12 -1 c  Red
13 18  3 c Black
14 1  3 c Black
14 4 -3 c  Red
14 8 -2 c  Red
14 12  1 c Black
14 15  2 c Black
14 17 -1 c  Red
15 2  3 c Black
15 3 -2 c  Red
15 4 -1 c  Red
15 7  1 c Black
15 12  2 c Black
15 13 -3 c  Red
16 2  3 c Black
16 3 -1 c  Red
16 4 -3 c  Red
16 7  2 c Black
16 15  1 c Black
16 17 -2 c  Red
17 2  1 c Black
17 3  2 c Black
17 4 -1 c  Red
17 6 -3 c  Red
17 8 -2 c  Red
17 18  3 c Black
18 2  1 c Black
18 3  2 c Black
18 4 -1 c  Red
18 8 -3 c  Red
18 10 -2 c  Red
18 17  3 c Black

我自己的例子:

*Vertices  59

1                                                   "0"

2                                                   "1"

3                                                   "2"

4                                                   "3"

5                                                   "4"

6                                                   "5"

7                                                   "6"

8                                                   "7"

9                                                   "8"

10                                                 "9"

11                                                 "10"

12                                                 "11"

13                                                 "12"

14                                                 "13"

15                                                 "14"

16                                                 "15"

17                                                 "16"

18                                                 "17"

19                                                 "18"

20                                                 "19"

21                                                 "20"

22                                                 "21"

23                                                 "22"

24                                                 "23"

25                                                 "24"

26                                                 "25"

27                                                 "26"

28                                                 "27"

29                                                 "28"

30                                                 "29"

31                                                 "30"

32                                                 "31"

33                                                 "32"

34                                                 "33"

35                                                 "34"

36                                                 "35"

37                                                 "36"

38                                                 "37"

39                                                 "38"

40                                                 "39"

41                                                 "40"

42                                                 "41"

43                                                 "42"

44                                                 "43"

45                                                 "44"

46                                                 "45"

47                                                 "46"

48                                                 "47"

49                                                 "48"

50                                                 "49"

51                                                 "v0"ic Green bc Brown(注意:"v0"和ic之间需要有空格,颜色的单词必须首字母大写,且,只写 ic Green 画出来的也是Green,但是,)

52                                                 "v1"ic Green bc Brown(如果只写bc Brown  则,画出来的不是Brown ,我现在也不知道这个bc 的功能是什么)

53                                                 "v2"ic Green bc Brown

54                                                 "v3"ic Green bc Brown

55                                                 "v4"ic Green bc Brown

56                                                 "v5"ic Green bc Brown

57                                                 "v6"ic Green bc Brown

58                                                 "v7"ic Green bc Brown

59                                                 "v8"ic Green bc Brown

*Edges

1                                                   42       42 l "42,6"

1                                                   14       8 l "8,1"

1                                                   8         6 l "6,10"

1                                                   7         40 l "40,5"

1                                                   2         43 l "43,1"

1                                                   3         12 l "12,7"

1                                                   4         27 l "27,7"

1                                                   5         22 l "22,9"

2                                                   47       5 l "5,5"

2                                                   41       23 l "23,10"

2                                                   40       2 l "2,8"

2                                                   14       22 l "22,5"

2                                                   42       46 l "46,9"

2                                                   26       48 l "48,8"

2                                                   25       9 l "9,3"

2                                                   23       3 l "3,2"

2                                                   15       36 l "36,2"

2                                                   3         5 l "5,3"

2                                                   4         36 l "36,8"

2                                                   5         38 l "38,1"

3                                                   15       32 l "32,9"

3                                                   34       13 l "13,4"

3                                                   36       32 l "32,5"

3                                                   29       32 l "32,5"

3                                                   27       29 l "29,6"

3                                                   4         40 l "40,7"

3                                                   5         17 l "17,4"

4                                                   43       12 l "12,6"

4                                                   41       33 l "33,6"

4                                                   36       46 l "46,8"

4                                                   34       14 l "14,3"

4                                                   5         9 l "9,3"

5                                                   42       1 l "16,4"

5                                                   48       7 l "7,1"

5                                                   45       21 l "21,8"

6                                                   7         6 l "6,1"

8                                                   9         21 l "21,2"

8                                                   10       2 l "2,8"

9                                                   10       1 l "1,7"

10                                                 38       2 l "2,2"

11                                                 12       31 l "31,9"

11                                                 13       41 l "41,1"

11                                                 14       28 l "28,4"

12                                                 13       14 l "14,10"

12                                                 14       31 l "31,8"

13                                                 14       9 l "9,8"

15                                                 40       28 l "28,6"

15                                                 16       38 l "38,6"

17                                                 18       13 l "13,8"

17                                                 19       40 l "40,9"

17                                                 20       33 l "33,3"

17                                                 21       14 l "14,6"

17                                                 22       7 l "7,3"

17                                                 23       8 l "8,3"

17                                                 24       12 l "12,6"

18                                                 19       18 l "18,4"

18                                                 20       47 l "47,1"

18                                                 21       34 l "34,5"

18                                                 22       18 l "18,9"

18                                                 23       25 l "25,6"

18                                                 24       8 l "8,4"

19                                                 20       40 l "40,9"

19                                                 21       1 l "1,5"

19                                                 22       21 l "21,5"

19                                                 23       44 l "44,3"

19                                                 24       7 l "7,1"

20                                                 21       17 l "17,9"

20                                                 22       41 l "41,6"

20                                                 23       22 l "22,8"

20                                                 24       27 l "27,2"

21                                                 22       27 l "27,4"

21                                                 23       15 l "15,5"

21                                                 24       23 l "23,10"

22                                                 23       46 l "46,1"

22                                                 24       13 l "13,2"

23                                                 24       45 l "45,9"

28                                                 29       17 l "17,1"

28                                                 30       47 l "47,4"

28                                                 31       38 l "38,8"

28                                                 32       1 l "1,9"

29                                                 30       46 l "46,9"

29                                                 31       5 l "5,7"

29                                                 32       2 l "2,1"

30                                                 31       11 l "11,8"

30                                                 32       39 l "39,9"

31                                                 32       21 l "21,1"

33                                                 34       49 l "49,6"

35                                                 36       12 l "12,3"

35                                                 37       48 l "48,8"

35                                                 38       5 l "5,9"

35                                                 39       23 l "23,10"

36                                                 37       17 l "17,6"

36                                                 38       49 l "49,9"

36                                                 39       33 l "33,3"

37                                                 38       11 l "11,2"

37                                                 39       6 l "6,2"

38                                                 39       43 l "43,8"

40                                                 41       29 l "29,2"

41                                                 49       44 l "44,4"

42                                                 43       10 l "10,3"

42                                                 44       31 l "31,4"

43                                                 44       20 l "20,8"

44                                                 48       14 l "14,8"

46                                                 47       9 l "9,5"

46                                                 48       10 l "10,10"

46                                                 49       10 l "10,4"

46                                                 50       50 l "50,5"

47                                                 48       26 l "26,5"

47                                                 49       41 l "41,9"

47                                                 50       27 l "27,3"

48                                                 49       22 l "22,4"

48                                                 50       50 l "50,8"

49                                                 50       8 l "8,5"

51                                                 39       58 l "58"

52                                                 6         4 l "4"

53                                                 24       47 l "47"

54                                                 19       80 l "80"

55                                                 30       70 l "70"

56                                                 22       50 l "50"

57                                                 13       41 l "41"

58                                                 32       34 l "34"

59                                                 49       47 l "47"

你可能感兴趣的:(pajek)