首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在河图中使我的字体变小?

如何在河图中使我的字体变小?
EN

Stack Overflow用户
提问于 2020-02-10 12:09:51
回答 1查看 73关注 0票数 0

我终于想出了如何在R中制作我的河图,现在我想知道如何让我的字体更小?

代码语言:javascript
复制
    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)

[

EN

回答 1

Stack Overflow用户

发布于 2020-02-10 13:52:46

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

代码语言:javascript
复制
w <- 3 # tinker with these multipliers
h <- 2
tiff(file="Figure_1.tiff", width=480*w, height=480*h)
plot(rp)
dev.off()

看看这能不能用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60143971

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档