mapWorld <- borders("world", colour="#0a0c2a", fill="#0a0c2a") # create a layer of borders
myPalette <- colorRampPalette((brewer.pal(11, "Spectral")))
sc <- scale_colour_gradientn(colours = myPalette(100))
mapWorld <- borders("world", colour="#0a0c2a", fill="#0a0c2a") # create a layer of borders
zp1 <- ggplot(all_edges) + mapWorld # Pretty simple plot code
zp1 <- zp1 + geom_path(aes(x = y, y = x, group = Group, # Edges with gradient
colour = Similarity, size = -Sequence/20000000)) # and taper
zp1 <- zp1 + scale_size(range = c(1, 5), guide = "none") # Customize taper
zp1 <- zp1 + scale_colour_gradientn(colours = ( myPalette(100)), name="dissimilarity")
zp1 <- zp1 + theme(panel.background = element_rect(fill = "white", colour = "black"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.ticks = element_blank(),
axis.text.x = element_text (size = 12, vjust = 0),
axis.text.y = element_text (size = 12, hjust = 1.3)) +
coord_cartesian() +
labs(y="",x="")
zp1 <- zp1+ scale_fill_gradientn(colours = rev(viridis(256)))
zp1<-zp1 + geom_point(data = metadata ,
aes(x = longitude, y = latitude, fill = eigcent, size = eigcent), shape = 21) # Customize gradient v
zp1 <- zp1 + theme_bw() + coord_equal(ratio=1) + theme(legend.position="right") +
xlab("") + ylab("") + scale_x_continuous(breaks=c(-100,0,100)) +
ggtitle(bquote(atop(.(name), atop(italic(.(name)), "")))) #