Ggraph appears to be unable to show legends

80 views Asked by At

I'd like to create different sizes for my nodes based on the value associated with that node.

I'm getting these weird number emoticons instead of what I'd expect for the legend labels.

I'm using RStudio Server on a linux machine and I've not had this error with ggplot

This is my visualization

enter image description here

This is my code

library(GGraph)
library(network)

netval1 <-
  network(netmat1_matrix, matrix.type = "edgelist")

netval1_tidy <-
    as_tbl_graph(netval1) 

ggraph(netval1_tidy) +
  geom_edge_link() + 
  geom_node_point(aes(size = (c))) +
  theme_graph()

This is my data

structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 
4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 
6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 
9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 
13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 
14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 
15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 
17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 
18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 
19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 
20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 
21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 
22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 
24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 
26, 26, 27, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 
31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 34, 
34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 
36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 
39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 42, 42, 
42, 42, 43, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 
45, 45, 45, 45, 45, 46, 46, 47, 47, 47, 47, 47, 47, 47, 47, 48, 
49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 
49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 
52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 
53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 
55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 
57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 
59, 60, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 64, 64, 64, 
64, 64, 64, 65, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 67, 
67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 
68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 
71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 
74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 
75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 
76, 76, 76, 76, 76, 77, 77, 78, 78, 78, 79, 79, 79, 79, 79, 79, 
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 
81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 83, 
83, 83, 83, 83, 84, 85, 86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 
87, 88, 88, 88, 89, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 
90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 
93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 94, 95, 95, 95, 95, 95, 
96, 96, 96, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 99, 99, 
99, 99, 99, 100, 100, 100, 100, 101, 101, 101, 101, 102, 102, 
103, 103, 104, 104, 105, 105, 105, 106, 106, 106, 106, 106, 107, 
107, 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 
109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, 110, 
110, 110, 110, 111, 111, 112, 112, 113, 113, 113, 113, 113, 114, 
114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 115, 115, 
115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 
116, 117, 117, 117, 117, 118, 119, 119, 119, 119, 120, 120, 120, 
121, 121, 121, 121, 121, 121, 121, 122, 122, 122, 122, 123, 123, 
124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 
126, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 
129, 129, 129, 129, 130, 130, 130, 131, 131, 132, 132, 132, 132, 
132, 132, 133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, 
134, 135, 135, 136, 136, 137, 138, 139, 139, 139, 140, 140, 140, 
140, 140, 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 
142, 143, 143, 144, 144, 144, 144, 144, 144, 144, 145, 145, 145, 
146, 146, 146, 147, 147, 148, 148, 149, 149, 149, 150, 150, 150, 
150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, 152, 
152, 152, 153, 153, 153, 153, 154, 154, 155, 155, 155, 155, 155, 
155, 156, 156, 156, 156, 157, 157, 158, 158, 158, 159, 159, 159, 
159, 159, 160, 161, 161, 162, 162, 163, 163, 163, 163, 163, 164, 
164, 165, 165, 165, 165, 165, 165, 166, 166, 166, 167, 167, 167, 
167, 168, 168, 168, 168, 169, 170, 171, 171, 172, 172, 172, 172, 
173, 173, 173, 174, 174, 175, 175, 175, 175, 175, 176, 177, 177, 
177, 177, 178, 179, 180, 181, 181, 181, 182, 183, 183, 183, 183, 
183, 184, 184, 185, 185, 186, 187, 187, 187, 187, 188, 188, 188, 
189, 189, 190, 190, 191, 191, 191, 192, 192, 193, 193, 194, 194, 
195, 195, 196, 197, 197, 197, 198, 198, 199, 200, 201, 202, 203, 
203, 204, 205, 205, 206, 206, 207, 208, 209, 1, 27, 28, 58, 108, 
120, 161, 178, 181, 208, 2, 6, 18, 97, 104, 140, 3, 10, 17, 23, 
28, 42, 45, 92, 100, 102, 111, 113, 148, 167, 175, 178, 180, 
183, 194, 4, 31, 34, 62, 63, 72, 79, 98, 155, 162, 166, 187, 
3, 5, 27, 37, 47, 102, 110, 131, 154, 164, 2, 6, 52, 68, 97, 
104, 139, 140, 150, 157, 165, 5, 7, 116, 131, 180, 8, 11, 22, 
35, 51, 55, 60, 64, 65, 71, 88, 95, 107, 118, 124, 138, 154, 
177, 9, 21, 25, 44, 45, 49, 54, 59, 90, 93, 94, 96, 129, 186, 
198, 3, 10, 13, 17, 32, 42, 47, 61, 77, 92, 93, 96, 100, 113, 
122, 131, 148, 151, 156, 158, 175, 183, 195, 11, 60, 107, 12, 
13, 15, 18, 20, 25, 29, 74, 76, 109, 121, 141, 144, 173, 206, 
10, 13, 14, 15, 44, 59, 62, 67, 75, 76, 97, 109, 122, 128, 141, 
144, 173, 184, 186, 189, 198, 13, 14, 40, 44, 54, 67, 68, 75, 
76, 77, 83, 109, 119, 123, 137, 141, 142, 144, 151, 155, 168, 
204, 206, 15, 19, 26, 28, 40, 82, 83, 98, 99, 108, 120, 126, 
140, 181, 8, 16, 22, 45, 64, 65, 95, 138, 177, 3, 17, 33, 36, 
48, 100, 113, 6, 12, 18, 20, 26, 29, 30, 72, 75, 79, 98, 105, 
109, 119, 123, 129, 133, 140, 141, 152, 192, 204, 15, 19, 40, 
41, 99, 134, 139, 2, 19, 20, 54, 57, 72, 80, 90, 129, 133, 134, 
137, 139, 188, 192, 203, 4, 9, 12, 13, 16, 21, 23, 24, 45, 49, 
50, 54, 94, 114, 198, 22, 35, 51, 55, 65, 71, 78, 85, 88, 107, 
118, 124, 138, 154, 23, 44, 49, 50, 76, 97, 109, 112, 130, 141, 
144, 151, 195, 13, 14, 24, 29, 44, 62, 67, 75, 76, 83, 109, 114, 
128, 137, 139, 141, 144, 149, 153, 189, 193, 206, 13, 14, 25, 
109, 128, 173, 184, 193, 2, 12, 18, 26, 72, 75, 27, 3, 28, 103, 
108, 120, 208, 14, 24, 29, 67, 75, 83, 109, 114, 115, 121, 125, 
137, 141, 142, 153, 196, 202, 204, 9, 16, 30, 101, 139, 31, 114, 
149, 165, 166, 173, 191, 193, 198, 17, 32, 36, 37, 33, 43, 34, 
44, 54, 62, 72, 98, 162, 164, 166, 189, 1, 35, 50, 91, 170, 17, 
36, 41, 48, 131, 32, 37, 158, 38, 90, 192, 20, 21, 26, 39, 70, 
87, 90, 94, 155, 171, 15, 19, 40, 148, 41, 116, 163, 3, 7, 10, 
42, 47, 102, 131, 148, 43, 4, 9, 13, 16, 21, 23, 24, 25, 34, 
44, 49, 50, 54, 59, 67, 82, 84, 91, 97, 106, 109, 134, 144, 186, 
189, NA, 21, 45, 62, 110, 151, 162, 206, 209, 46, 164, 36, 37, 
42, 47, 93, 100, 113, 132, 48, 2, 6, 12, 15, 18, 19, 20, 26, 
29, 38, 44, 49, 53, 56, 74, 75, 79, 86, 94, 105, 121, 129, 130, 
133, 150, 157, 172, 190, 6, 34, 35, 44, 50, 52, 54, 59, 97, 123, 
133, 156, 157, 189, 11, 51, 55, 88, 118, 6, 18, 50, 52, 125, 
157, 159, 13, 15, 18, 20, 53, 57, 89, 123, 130, 168, 188, 204, 
9, 16, 30, 34, 54, 90, 97, 129, 198, 41, 51, 55, 71, 116, 124, 
156, 163, 193, 56, 106, 121, 159, 184, 187, 191, 192, 13, 40, 
53, 57, 75, 123, 204, 28, 58, 120, 13, 44, 59, 68, 76, 77, 96, 
114, 141, 144, 195, 60, 10, 30, 49, 61, 77, 93, 100, 145, 154, 
172, 209, 22, 24, 30, 45, 54, 62, 98, 110, 149, 151, 162, 166, 
189, 206, 63, 204, 8, 22, 64, 95, 138, 161, 65, 47, 66, 116, 
145, 13, 14, 24, 29, 44, 49, 55, 62, 67, 75, 76, 97, 109, 114, 
125, 137, 139, 141, 144, 163, 189, 193, 206, 14, 68, 77, 81, 
113, 136, 179, 195, 69, 113, 158, 39, 70, 171, 71, 78, 88, 107, 
124, 26, 34, 62, 72, 79, 86, 98, 139, 73, 77, 81, 106, 181, 197, 
49, 59, 74, 89, 172, 188, 201, 12, 14, 18, 24, 26, 29, 53, 67, 
75, 83, 114, 115, 121, 123, 125, 141, 142, 153, 196, 204, 25, 
44, 49, 76, 114, 141, 144, 173, 193, 198, 59, 77, 8, 22, 78, 
26, 29, 63, 79, 98, 153, 12, 13, 18, 25, 74, 80, 82, 105, 130, 
173, 184, 188, 199, 14, 73, 81, 172, 179, 44, 50, 62, 76, 82, 
109, 121, 139, 141, 144, 156, 189, 203, 29, 67, 83, 115, 137, 
84, 85, 4, 31, 40, 63, 79, 86, 155, 187, 39, 87, 94, 71, 88, 
118, 18, 57, 74, 89, 97, 141, 188, 54, 90, 94, 98, 105, 123, 
129, 133, 188, 189, 200, 9, 16, 21, 54, 91, 134, 92, 148, 158, 
176, 10, 46, 93, 97, 113, 158, 189, 195, 87, 94, 192, 8, 64, 
95, 124, 138, 49, 96, 197, 76, 89, 97, 141, 144, 150, 18, 34, 
79, 98, 162, 15, 40, 90, 91, 99, 10, 69, 100, 113, 30, 90, 101, 
129, 3, 102, 28, 103, 15, 104, 105, 168, 188, 13, 56, 106, 184, 
192, 11, 107, 27, 28, 58, 108, 130, 161, 181, 208, 12, 24, 25, 
29, 44, 49, 59, 67, 76, 82, 109, 114, 144, 198, 206, 45, 62, 
110, 151, 209, 111, 167, 112, 182, 47, 48, 93, 113, 197, 24, 
29, 76, 114, 137, 149, 173, 191, 193, 198, 14, 24, 29, 67, 75, 
83, 114, 115, 121, 125, 137, 142, 153, 196, 202, 204, 41, 116, 
64, 84, 117, 170, 118, 102, 119, 144, 189, 28, 63, 120, 13, 56, 
82, 99, 106, 121, 123, 10, 122, 160, 175, 74, 123, 7, 8, 124, 
56, 115, 125, 153, 193, 196, 204, 40, 104, 126, 174, 9, 12, 13, 
16, 21, 23, 24, 49, 47, 55, 93, 128, 30, 90, 129, 139, 112, 130, 
133, 36, 131, 17, 36, 47, 48, 113, 132, 52, 90, 98, 123, 133, 
136, 157, 179, 20, 54, 134, 190, 120, 135, 87, 136, 137, 138, 
18, 19, 139, 18, 30, 94, 140, 190, 6, 56, 94, 123, 129, 139, 
141, 14, 29, 75, 142, 153, 143, 189, 14, 16, 68, 83, 137, 144, 
203, 41, 66, 145, 51, 146, 177, 147, 176, 148, 175, 149, 189, 
193, 97, 130, 139, 141, 150, 10, 62, 76, 77, 122, 151, 175, 182, 
206, 18, 101, 139, 152, 114, 115, 125, 153, 49, 154, 4, 20, 90, 
155, 168, 184, 10, 76, 93, 156, 30, 157, 14, 96, 158, 20, 72, 
98, 159, 190, 160, 120, 161, 62, 162, 51, 55, 116, 128, 163, 
27, 46, 44, 76, 97, 141, 144, 165, 31, 76, 166, 3, 10, 111, 167, 
105, 168, 184, 200, 169, 170, 70, 171, 77, 81, 93, 172, 109, 
173, 198, 99, 174, 111, 148, 175, 183, 194, 176, 107, 135, 146, 
177, 178, 179, 180, 28, 108, 181, 182, 10, 175, 180, 183, 194, 
130, 184, 18, 185, 186, 2, 4, 159, 187, 68, 188, 201, 143, 189, 
174, 190, 56, 166, 191, 80, 192, 76, 193, 3, 194, 68, 77, 196, 
17, 77, 197, 21, 198, 199, 200, 201, 202, 136, 203, 204, 110, 
139, 151, 206, 207, 28, 209, 36, 2, 4, 5, 6, 2, 2, 1, 1, 2, 246, 
3, 1, 2, 4, 2, 47, 7, 3, 1, 1, 3, 1, 1, 4, 5, 9, 2, 3, 8, 1, 
1, 10, 4, 1, 88, 2, 1, 1, 2, 1, 3, 1, 2, 1, 1, 1, 1, 18, 1, 1, 
5, 5, 1, 1, 1, 4, 15, 65, 6, 2, 1, 2, 1, 2, 1, 2, 2, 1, 51, 2, 
1, 9, 37, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 
59, 13, 1, 2, 3, 1, 8, 4, 2, 2, 1, 1, 2, 1, 3, 5, 31, 1, 2, 4, 
5, 4, 1, 4, 1, 5, 1, 1, 1, 5, 5, 2, 1, 1, 3, 10, 3, 1, 85, 4, 
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1, 4, 7, 1, 8, 1, 1, 14, 11, 3, 7, 1, 1, 1, 11, 1, 12, 1, 1, 
11, 1, 3, 5, 1, 1, 4, 1, 1, 1, 7, 10, 12, 6, 1, 2, 6, 8, 2, 1, 
1, 4, 1, 1, 6, 1, 8, 4, 1, 2, 1, 2, 1, 4, 1, 1, 2, 1, 3, 1, 1, 
4, 1, 4, 2, 1, 3, 1, 2, 2, 5, 1, 2, 1, 1, 3, 5, 5, 4, 4, 1, 2, 
1, 1, 1, 1, 1, 1, 1, 2), .Dim = c(1227L, 3L), .Dimnames = list(
    NULL, c("a", "b", "c")))
1

There are 1 answers

0
YBS On

You aesthetic c seems to be an issue here. Consider sample data below.

num_nodes <- 10

my_sociomatrix <- matrix(round(runif(num_nodes*num_nodes)), # edge values
                         nrow = num_nodes, #nrow must be same as ncol
                         ncol = num_nodes)

diag(my_sociomatrix) <- 0

net <- as.network(x = my_sociomatrix, # the network object
                  directed = TRUE, # specify whether the network is directed
                  loops = FALSE, # do we allow self ties (should not allow them)
                  matrix.type = "adjacency" # the type of input
)

network.vertex.names(net) <- LETTERS[1:10]

# Create the variable
gender <- c(rep("Female",num_nodes/2),rep("Male",num_nodes/2))

# Add it to the network object
set.vertex.attribute(net, # the name of the network object
                     "Gender", # the name we want to reference the variable by in that object
                     gender # the value we are giving that variable
) 

age <- round(rnorm(num_nodes,20,3))
set.vertex.attribute(net,"Age",age)

summary.network(net, # the network we want to look at
                print.adj = FALSE # if TRUE then this will print out the whole adjacency matrix.
)

Using your graph program

ggraph(net) +
  geom_edge_link() + 
  geom_node_point(aes(size=age/5)) +
  theme_graph()

output