Closed DQKF closed 3 years ago
Hello @DQKF
Can you share your model02
object such that I can reproduce this locally save(model02, file = "model02.RData")
or provide a reproducible example with some simplified chinese terms in there showing this behaviour.
I'm not sure what the cause of this is. This is what I'm getting when applying on your model object:
I'm running this on Windows. And got a similar plot on a Ubuntu system. Maybe you are on another system?
library(BTM)
library(textplot)
library(ggraph)
library(ggforce)
library(concaveman)
library(ggplot2)
library(igraph)
load("C:/Users/Jan/Desktop/model02.RData")
plot(model02, biterms = model02$biterms$biterms, top_n = 10, family = "SimSun")
Sys.getlocale()
[1] "LC_COLLATE=Dutch_Netherlands.1252;LC_CTYPE=Dutch_Netherlands.1252;LC_MONETARY=Dutch_Netherlands.1252;LC_NUMERIC=C;LC_TIME=Dutch_Netherlands.1252"
I am running all the jobs on the Apple IOS system, pretty weird! Thanks anyway!
This plotting functionality relies on the ggraph package and the ggplot2 package. Maybe this is the solution to your question: https://community.rstudio.com/t/chinese-characters-in-ggplot-on-macos/4429
Maybe you need to set this upfront:
library(BTM)
library(textplot)
library(ggraph)
library(ggforce)
library(concaveman)
library(ggplot2)
library(igraph)
load("C:/Users/Jan/Desktop/model02.RData")
theme <- theme_get()
theme$text$family <- "STFangsong"
theme_set(theme)
plot(model02, biterms = model02$biterms$biterms, top_n = 10)
I just add > showtext_auto(), and everything's fine with the graph! Thanks, Dr. Wijffels!
Ok great. Good to know.
I have some problems with the font issues as I use R Package BTM. As one may see in the graph as attached, "Simplified Chinese" is not working as plotted.
Here's the plot code: M02<-plot(model02, top_n = 10, family = "SimSun", title = "BTM model", subtitle = "R packages in the NLP/Machine Learning task views", labels = c("Topic01", "Topic02", "Topic03", "Topic04", "Topic05", "Topic06", "Topic07", "Topoc08", "Topic09", "Topic10", "Topic11", "Topic12", "Topic13", "Topic14", "Topic15"))
Text mining in Simplified Chinese.