如何在riverplot中缩小字体大小?

如何在riverplot中缩小字体大小?,r,fonts,font-size,riverplot,R,Fonts,Font Size,Riverplot,终于知道了如何在R中制作riverplot,现在我想知道如何使我的字体变小 library(riverplot) #Bring in file of nodes and edges nodes <- read_xlsx("riverplot_cell_p.xlsx", sheet = "nodes") edges <- read_xlsx("riverplot_cell_p.xlsx", sheet = "edges") #Convert

终于知道了如何在R中制作riverplot,现在我想知道如何使我的字体变小

    library(riverplot)

    #Bring in file of nodes and edges
    nodes <- read_xlsx("riverplot_cell_p.xlsx", sheet = "nodes")
    edges <- read_xlsx("riverplot_cell_p.xlsx", sheet = "edges")

    #Convert to data frame
    nodes <- as.data.frame(nodes)
    edges <- as.data.frame(edges)
    rownames(nodes) = nodes$ID


    #Construct a list of styles
    library(RColorBrewer)
    palette = paste0(brewer.pal(9, "Set1"), "60")
    styles = lapply(nodes$y, function(n) {
      list(col = palette[n+1], lty = 0, textcol = "black")})
    names(styles) = nodes$ID

    #Construct riverplot
    library(riverplot)
    rp <- list(nodes = nodes, edges = edges, styles = styles)
    class(rp) <- c(class(rp), "riverplot")
    plot(rp)
库(riverplot)
#引入节点和边的文件

节点我看不到任何方法可以从
plot.riverplot
的帮助页面更改文本字体大小,但您始终可以使用宽度/高度参数修改图形设备的尺寸。例如:

w <- 3 # tinker with these multipliers
h <- 2
tiff(file="Figure_1.tiff", width=480*w, height=480*h)
plot(rp)
dev.off()

w欢迎来到堆栈溢出!您能否通过共享您的数据样本使您的问题重现,以便其他人能够提供帮助(请不要使用
str()
head()
或屏幕截图)?您可以使用和包来帮助您实现这一点。另见&