[BioC] hyperdraw: How can I control node label font size?

hettling j.hettling at vu.nl
Tue May 7 11:39:00 CEST 2013


Hello,

I am using the Hyperdraw package and am wondering how I can set the font
size for the labels of my node?

I took the example from the vignette:

##
dh1 <- DirectedHyperedge("A", "B", "R1")
dh2 <- DirectedHyperedge(c("A", "B"), c("C", "D"), "R2")
dh3 <- DirectedHyperedge("D", "E", "R3")
hg <- Hypergraph(LETTERS[1:5], list(dh1, dh2, dh3))
testbph <- graphBPH(hg)
testrabph <- graphLayout(testbph) 
nodeDataDefaults(testrabph, "shape") <- "plain"
plot(testrabph)
##

Here is what I tried:

##
nodeDataDefaults(testrabph, "cex") <- 0.5
##

the above seems to control the size of the labels for the edges, not the
nodes A-E.
Then I tried to set the font size manually for each node:

##
for (i in seq_along(testrabph at graph@AgNode)){
  testrabph at graph@AgNode[[i]]@txtLabel at labelFontsize <- 2
}
##

but this did not work either. 

Does anyone know how I could set the font size in this example? Any help
is appreciated,

many thanks in advance,

Hannes



More information about the Bioconductor mailing list