data
contains nouns (noun) and appearance rate % (freq), and I tried to create a Treemap with the following script, but all Japanese characters on the label (like □□) are garbled.
Could you tell me how to solve this problem?
library(treemap)
treemap(data, index=c("noun", "freq"),
vSize = "freq",
vColor="freq",
type = "dens",
palette = "RdYlGn",
fontsize.labels = 10 )
In my Windows environment, the characterization does not occur, so it is not reproducible, but I think I can solve it by specifying the arguments of the fontfamily.xxx
series in treemap()
.This answer is based on 's article which is good for your health.
The following is an example of a mac environment.
treemap(res3, index=c("Term", "Freq"),
vSize = "Freq",
vColor="Freq",
type = "dens",
palette = "RdYlGn",
fontsize.labels = 10,
fontfamily.labels="HiraKakuProN-W3",
fontfamily.title="HiraKakuProN-W3",
fontmail.legend="HiraKakuProN-W3")
© 2024 OneMinuteCode. All rights reserved.