Skip to content

Colour co-occurance network text #1

@rachaelantwis

Description

@rachaelantwis

Hi,
thank you very much for this excellent GitHub!

I have made a number of co-occurance networks using this code as follows:

results_sub<-subset(results2, as.numeric(as.character(rho)) > 0.80) #change rho
head(results_sub)
g1<-graph.edgelist(as.matrix(subset(results_sub, trt=="Absent")[,2:3]),directed=FALSE)
g2<-graph.edgelist(as.matrix(subset(results_sub, trt=="Low")[,2:3]),directed=FALSE)
g3<-graph.edgelist(as.matrix(subset(results_sub, trt=="Medium")[,2:3]),directed=FALSE)
g4<-graph.edgelist(as.matrix(subset(results_sub, trt=="High")[,2:3]),directed=FALSE)
V(g1)$color<-"green"
V(g2)$color<-"yellow"
V(g3)$color<-"orange"
V(g4)$color<-"red"
E(g1)$color<-"black"
E(g2)$color<-"black"
E(g3)$color<-"black"
E(g4)$color<-"black"
V(g1)$size<-6
V(g2)$size<-6
V(g3)$size<-6
V(g4)$size<-6
par(mfrow=c(1,2))
plot(g1,layout=layout.fruchterman.reingold)
plot(g2,layout=layout.fruchterman.reingold)
plot(g3,layout=layout.fruchterman.reingold)
plot(g4,layout=layout.fruchterman.reingold)

However I was wondering if it's possible to change the colour of the text in the figures? The networks are between bacteria and fungi and I'd like to colour code the two different kingdoms.

Many thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions