g4 <- graph( c("John", "Jim", "John", "Jack", "Jim", "Jack", "John", "John") ) # In named graphs we can specify isolates by providing a list of their names. plot(g4, edge.color="black", edge.arrow.size=.8, vertex.color="darkred", vertex.size=15, vertex.frame.color="black", vertex.label.color="black", vertex.label.cex=0.8, vertex.label.dist=2, edge.curved=0) tr <- make_tree(40, children = 3, mode = "undirected") plot(tr, vertex.size=10, vertex.label=NA) library(igraph) links <- read.csv("C://Users//Jay//Desktop//netscix2016//Dataset1-Media-Example-EDGES.csv", header=T, as.is=T) nodes <- read.csv("C://Users//Jay//Desktop//netscix2016//Dataset1-Media-Example-NODES.csv", header=T, as.is=T) net <- graph_from_data_frame(d=links, vertices=nodes, directed=T) class(net) layouts <- grep("^layout_", ls("package:igraph"), value=TRUE)[-1] # Remove layouts that do not apply to our graph. layouts <- layouts[!grepl("bipartite|merge|norm|sugiyama|tree", layouts)] par(mfrow=c(3,3), mar=c(1,1,1,1)) for (layout in layouts) { print(layout) l <- do.call(layout, list(net)) plot(net, edge.arrow.mode=0, layout=l, main=layout) } tkid <- tkplot(net) #tkid is the id of the tkplot that will open # l <- tkplot.getcoords(tkid) # grab the coordinates from tkplot # # tk_close(tkid, window.close = T) # # plot(net, layout=l)