Questions tagged [ggraph]

ggraph is the "Grammar for Graph Graphics". At the time of writing, it is an actively maintained library for R that builds upon ggplot2 providing support for relational data structures such as networks, graphs and trees. It provides a concept of layouts to aid in the layout of a graph when visualising it.

Additional information, examples, documentation and the source can be obtained from GitHub - ggraph

209 questions
1
vote
1 answer

Choose color ggraph R

I try to plot a bipartite network with the edges of the same color than one of their nodes. For example, let's take an movie/actor bipartite graph as an exemple, with 7 movies and 15 actors, and each actor has a nationality. I want to have the edge…
abichat
  • 2,317
  • 2
  • 21
  • 39
1
vote
1 answer

how to use circle pack layout in ggraph library in r

what data format is necessary to create ggraph circlepack layout? It seems to require a hierarchy. I tried normally vertices and nodes, which apparently doesn't work. library(ggraph) library(igraph) edges=data.frame(from=c('a','b','c'), to=…
santoku
  • 3,297
  • 7
  • 48
  • 76
0
votes
1 answer

Multiple plots in ggraph using one dataframe

This is the data I'm using also I'm attaching the sample figure down below. df <- data.frame( "PersonName1" = c("F","H","H","H","K","K","K","K","N","N","G","N","N","N","K","G","K"), "PersonName2" = c("G","G",…
People
  • 63
  • 5
0
votes
0 answers

How to plot extract igraph layout to plot with ggraph ? Example with community graph

I would like to plot a graph with communities, in a similar way as igraph do but using ggraph. Here is an example: library(data.table) library(ggplot2) library(igraph) actors <- data.table(name=c("Alice", "Bob", "Cecil", "David", …
denis
  • 5,580
  • 1
  • 13
  • 40
0
votes
0 answers

How to use "fill" aesthetic on a column when data frame has been converted to list

I am creating a circlepack graph using ggraph and want to be able to apply the fill aesthetic to my "from" column in my edges list. The problem I am running into is that after using graph_from_data_frame to merge the two dataframes into a list the…
0
votes
0 answers

Using ggraph with undirected graphs

I am working with an undirected graph I'd like to visualize as a dendogram with shaded node labels by a nodal attribute. The best option seems to be ggraph, but it requires a directed graph, and cannot turn my graph into one as there is no root.…
PSR
  • 197
  • 1
  • 7
0
votes
1 answer

grid misalignment with ggplot2

i am trying to create a figure which shows a spatially explicit system of nodes on a background grid. Here I have created a code which is lattice-like, but the shapes can vary so ideally the code would be working with any set of coordinates and…
0
votes
1 answer

R ggraph: how to plot bi-directional arrows in network?

I would like to do a network graph in R using ggraph where an an edge relationship goes both ways A -> B and B -> A. I would like top plot this with ggraph as a single bi-directional arrow? A solution on ggraph's Github issue is to use…
Matifou
  • 7,968
  • 3
  • 47
  • 52
0
votes
0 answers

ggraph/igraph not recognizing numeric edge attributes

I am trying to use igraph (1.3.2) & ggraph (2.0.5) to visualize networks where the edge aesthetics are modulated by a numeric value. I would assume this is a pretty common thing, but I have been running into issues lately (likely due to an update?…
0
votes
2 answers

ggraph node color and legend not matching

This is my tidygraph object which I'm trying to plot hub_plot1 # A tbl_graph: 50 nodes and 540 edges # # An undirected simple graph with 2 components # # Node Data: 50 × 4 (active) name mod kme color 1…
PesKchan
  • 868
  • 6
  • 14
0
votes
1 answer

Is it possible to create a community plot using ggraph?

I want to create a community plot in ggraph. Is this possible? I made a version of it using the base plot function and igraph. Not sure how I can do this using ggraph.
Muginson
  • 11
  • 1
0
votes
0 answers

Network graph not render within Databricks R noteboook using plotly and igraph

I am trying to create an interactive network graph within Databricks R notebook using igraph and plotly. The sample code runs fine but I am not able to see the graph in the notebook after the run. Also, the same code renders an interactive graph in…
user17
  • 1
0
votes
0 answers

How to add all labels in the widget created by circlepacker?

Im trying to create a packing circle graph using the R package circlepacker. So far I haven't got any problems creating the graph but I would like to add all labels to be visible before clicking on each group. For reference this is the tibble I'm…
0
votes
1 answer

igraph node annotation with external annotation information

This was the question which was solved where I had colors coming from modules which I wanted to label. Now I would like to know how can I put the annotation if I have another node file I would like my graph something like this or similar where…
PesKchan
  • 868
  • 6
  • 14
0
votes
1 answer

Unable to color lines by group on a circular dendogram using R/ggraph

I've created a circular dendogram using R and the ggraph package. I have my labels and nodes correctly colored by "group". However, I'm unsure how to color the lines by "colors" (my color column). Currently I can change the line color to a single…
Beatdown
  • 187
  • 2
  • 7
  • 20