Search code examples
ggplot2rstudiophyloseq

How to resize font in plot_net feature of phyloseq?


I want to resize my text in plot_net but none of the options are working for me. I am trying

p <- plot_net(physeqP, maxdist = 0.4, point_label = "ID", color = "Cond", shape = "Timeperiod") p + geom_text(size=15)

This gives me error

"Error: geom_text requires the following missing aesthetics: x, y, label".

Can anyone please tell me how can I fix the issue?

I dont want to resize legends or the axis, but the nodes text.

this image is drawn using phyloseq but since the font size is very small, i want to make it prominent.


Solution

  • Without an example it's hard to reproduce.

    p <- plot_net(physeqP, maxdist = 0.4, point_label = "ID"
         , color = "Cond", shape = "Timeperiod", cex_val  = 2) 
    

    I believe this is with the NeuralNetTools package.

    Try using: cex_val numeric value indicating size of text labels, default 1

    https://www.rdocumentation.org/packages/NeuralNetTools/versions/1.5.0/topics/plotnet