Git Product home page Git Product logo

Comments (13)

Xethic avatar Xethic commented on August 26, 2024 2

Hi,
This error generally occurs when non-standard fonts like Arial or Times New Roman are not available in your R session. (This has been mentioned before #29 (comment))
I was able to fix this as follows (Ubuntu):

  1. Download TTF files for font Arial and Times New Roman, e.g. from here.
  2. Unzip the files and put them into a reasonable directory, e.g. /home/USERNAME/fonts.
  3. Install the R extrafont package, and add the following code to the header of your script:
library(extrafont)
font_import(paths="/home/USERNAME/fonts", prompt=F)
loadfonts(device = "pdf", quiet = F)
  1. Run the code to generate PDF figures, for example:
pdf("/home/USERNAME/CellChat_results/network.pdf", width=7, height=7)
netVisual_aggregate(cellchat, signaling = pathways.show,  vertex.receiver = vertex.receiver, vertex.size = groupSize)
dev.off()

Worked like a charm for me.
Cheers.

from cellchat.

sqjin avatar sqjin commented on August 26, 2024

@chuiqin Try install.packages("extrafont")

from cellchat.

chuiqin avatar chuiqin commented on August 26, 2024

Thank you very much for your help!

from cellchat.

chuiqin avatar chuiqin commented on August 26, 2024

@chuiqin Try install.packages("extrafont")
I'm sorry but I still get the same error after installing packages("extrafont").

Error in text.default(x, y, labels = labels, col = label.color, family = label.family, : invalid font type

Can you help me with this problem again? Thank you!

from cellchat.

sqjin avatar sqjin commented on August 26, 2024

@chuiqin It looks like your R does not support 'Arial' font style when doing plotting. Can you google such issue based on your system of the computer as I did not hear of such issue from other users? The extrafont package is available here. In addition, please try save the plot using svglite(file ="a.pdf")...dev.off()

from cellchat.

chuiqin avatar chuiqin commented on August 26, 2024

@chuiqin It looks like your R does not support 'Arial' font style when doing plotting. Can you google such issue based on your system of the computer as I did not hear of such issue from other users? The extrafont package is available here. In addition, please try save the plot using svglite(file ="a.pdf")...dev.off()

Thank you very much!
You're right!
When I change my code:
`library(svglite)

svglite(file = "pathway.svg", width=10, height=10)

netVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = c(1,2,3,5), vertex.size = groupSize)
dev.off()`
It‘s surperised that the picture can created correctly!
Thank you very much for your help again!

from cellchat.

Portulaca666 avatar Portulaca666 commented on August 26, 2024

Well, I got this error again .I have no idea about that how can I save the picture with the pdf format. who can help me ?

from cellchat.

sqjin avatar sqjin commented on August 26, 2024

@wuzhigui Have you tried svglite(file ="a.pdf")...dev.off() or saving as .svg file?

from cellchat.

sqjin avatar sqjin commented on August 26, 2024

Hi @Xethic , thank you so much for sharing this!

from cellchat.

Aby-GGG avatar Aby-GGG commented on August 26, 2024

I can't use netVisual_aggregate to get the graphics I want。I hope to get the following figure:
1645112229(1)
However, I always get such a circle
1645112273(1)

Can you help me, thank you~

from cellchat.

sqjin avatar sqjin commented on August 26, 2024

@Aby-GGG You should set 'layout = "hierarchy"'.

from cellchat.

Aby-GGG avatar Aby-GGG commented on August 26, 2024

from cellchat.

Aby-GGG avatar Aby-GGG commented on August 26, 2024

from cellchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.