如何在Riverplot中减小字体大小?

问题描述 投票:0回答:1

最后弄清楚了如何在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)

[<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9aUXBkai5wbmcifQ==” alt =“ riverplot [1]”>] >>

最后弄清楚了如何在R中制作我的Riverplot,现在我想知道如何缩小我的字体大小? library(riverplot)#引入节点和边缘节点的文件

r fonts font-size riverplot
1个回答
0
投票

我在plot.riverplot的帮助页面上看不到任何更改文本字体大小的方法,但是您始终可以使用width / height参数来修改图形设备的尺寸。例如:

© www.soinside.com 2019 - 2024. All rights reserved.