stefpeschel / NetCoMi

Network construction, analysis, and comparison for microbial compositional data
GNU General Public License v3.0
143 stars 24 forks source link

saving a plot #99

Closed hyoj-seo closed 8 months ago

hyoj-seo commented 9 months ago

Thank you for making a great program!

Following the tutorial, I created a network using Pearson.

However, the image created through plot() cannot be saved in an environment where you are using a remote connection using a jupyter notebook.

I tried using pdf() + dev.off() and ggsave() but failed.

The local Rstudio succeeded in resizing and saving the image with the Rstudio's image function, but the current environment requires a way to save it in the jupyter notebook.

image

In the preview of the jupyter, the image looks truncated, so it is essential to save after resizing the image.

Would you be so kind as to offer your assistance? I express my gratitude in advance HJ

stefpeschel commented 9 months ago

Hi, Have you tried changing the width and height arguments of the pdf() function? In general, the larger the size, the better the network will fit into the plot area. For R Markdown, which I work with, it's the same. In addition, NetCoMi's plot function has a mar argument to define the margins. You can increase the right margin so that the legend fits into the plotting region. Best, Stefanie