SachaEpskamp / qgraph

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

centralityPlot - grouping graphs without colour #49

Closed nathan-monk closed 3 years ago

nathan-monk commented 3 years ago

Hi Sacha,

I am plotting centrality values for two graphs in the same panel, i.e.:

fig_list <- list(Group 1 = network1, Group 2 = network2) fig_plot <- centralityPlot(fig_list, include = "ExpectedInfluence", labels = names, orderBy = "ExpectedInfluence", theme_bw = TRUE)

By default, this plots the groups by colour (pink and blue). I'm wanting to plot the groups by dots vs. dashes instead of colour. I've tried transferring the centrality data into ggplot via centralityTable() and doing it that way, but have found it difficult trying to reproduce the centrality plot in ggplot (I'm fairly new to ggplot). Is there an easy way?

Cheers!

SachaEpskamp commented 3 years ago

The centralityPlot function returns a ggplot object you can add things to. But the easiest probably is to just take the ggplot code from the function and make the adjustments you need manually.