SachaEpskamp / qgraph

Developmental version of qgraph
GNU General Public License v2.0
68 stars 21 forks source link

Using centralityPlot with multiple networks #62

Closed uta-connolly closed 1 year ago

uta-connolly commented 2 years ago

I’m looking for documentation on how to use centralityPlot() in which the first argument is a list. The function works and plots the results for all lists on the same graph which is what I want. However, the default legend distinguishes the list elements as “type 1” and “type2,” etc. I would like to change this, e.g., to “male” and "female”. Is there a way of doing this?

SachaEpskamp commented 1 year ago

Please see below:

library("qgraph")

graph1 <- matrix(rnorm(4^2),4,4)
graph2 <- matrix(rnorm(4^2),4,4)

library("ggplot2")
centralityPlot(list(male = graph1, female = graph2)) + 
  scale_colour_discrete("gender")