Q:

igraph simplifies when trying to color edges

I have several cell types and want to show their connections with each others. My problem if I just use plot(all.cnx), it shows all the connections. However, if I want to add edge.color, etc. then it simplifies the graph. For instance, the connections from "CT#1_3" to other cell types. How can I prevent this simplifications, as I want to show all the edges?
thanks,
ilyas.
library("igraph")
my_cnxs = c("CT#1_0","CT#2_7","CT#1_2","CT#2_7","CT#1_3","CT#2_7","CT#1_5","CT#2_7","CT#1_6","CT#2_7","CT#1_0","CT#2_0","CT#1_0","CT#2_2","CT#1_0","CT#2_8","CT#1_2","CT#2_8","CT#1_3","CT#2_8","CT#1_5","CT#2_8","CT#1_6","CT#2_8","CT#1_2","CT#2_0","CT#1_2","CT#2_2","CT#1_3","CT#2_0","CT#1_3","CT#2_2","CT#1_5","CT#2_0","CT#1_5","CT#2_2","CT#1_6","CT#2_0","CT#1_6","CT#2_2","CT#1_1","CT#3_2","CT#1_1","CT#2_0","CT#1_1","CT#2_2","CT#1_2","CT#3_2","CT#1_3","CT#3_2","CT#1_5","CT#3_2","CT#1_6","CT#3_2","CT#3_2","CT#3_2","CT#3_2","CT#2_0","CT#3_2","CT#2_2","CT#2_8","CT#3_2","CT#2_8","CT#2_0","CT#2_8","CT#2_2","CT#1_1","CT#2_7","CT#1_2","CT#2_7","CT#1_3","CT#2_7","CT#1_5","CT#2_7","CT#1_6","CT#2_7","CT#3_2","CT#2_7","CT#2_8","CT#2_7")

my_edge_colors = c("green","green","green","green","green","green","green","green","green","green","green","green","black","black","black","black","black","black","black","black","red","red","red","red","red","red","red","red","red","red","red","red","red","red","red","red","red","red","red","red")

all_cell_colors = c("yellow3","red","skyblue","orange","violet","cyan3","gray80","green","darkgreen","pink","gold","cadetblue1","purple","darkkhaki","chocolate","darkred","aquamarine","darkslategray4","blue","cyan1")

names(all_cell_colors) = c("CT#4_0","CT#1_0","CT#1_1","CT#1_2","CT#1_3","CT#1_4","CT#1_5","CT#1_6","CT#1_7","CT#3_1","CT#3_2","CT#2_0","CT#2_1","CT#2_2","CT#2_3","CT#2_4","CT#2_5","CT#2_6","CT#2_7","CT#2_8")

all.cnx = graph(my_cnxs)
my_layout = layout_(all.cnx, nicely())
my.cx.names = names(edges(all.cnx)[[1]][1]) 
my_vertex_colors = all_cell_colors[match(my.cx.names, names(all_cell_colors))]
plot(all.cnx, layout = my_layout, edge.color = my_edge_colors, edge.arrow.size=0.4, vertex.color = my_vertex_colors, vertex.size=30,vertex.frame.color="black", vertex.label.color="black",vertex.label.cex=0.5, vertex.label.dist=0, edge.curved=0.2)
plot(all.cnx ,layout = my_layout)

A:

The edges are overlapping because of edge.curved = 0.5. It is making all of the edges have the same curvature, so it appears if the graph is being simplified, but really the edge are there, just overlapping perfectly.
To get back to what you wanted, less curve in edges, you can use the function curve_multiple() on the igraph object directly and pass the resulting vector to edge.curve.
plot(all.cnx, layout = my_layout,
     edge.color = my_edge_colors, edge.arrow.size=0.4,
     vertex.color = my_vertex_colors, vertex.size=30,vertex.frame.color="black",
     vertex.label.color="black",vertex.label.cex=0.5, vertex.label.dist=0,
     edge.curved = curve_multiple(all.cnx, .2)) # the default is 0.5

This will only curve edges where curve is needed, ie there would be overlap. If you just remove the edge.curved argument it resets to the default value, resulting in edges with more curvature, but no overlap.

