首页 > 解决方案 > DiagrammeR fontsize 参数什么都不做

问题描述

我可以将下面的 fontsize 参数更改为graph [fontsize = 1]or graph [fontsize = 10]or graph [fontsize = 100],并且我的 R Studio 查看器中的输出是相同的。看起来字体默认为填充它所占据的节点的合理大小。如何更改字体大小?

library(DiagrammeR)

grViz("
  digraph test {
    graph [fontsize = 10]

    node [shape = box]
    A [label = 'FooBar']
    B [label = 'BarFoo']

    A -> B
  }
")

标签: rdiagrammer

解决方案


您可以在节点声明中更改节点标签的字体大小。

您可以使用node:node [shape = box, fontsize=5]或在特定节点标签中更改它:A [label = 'FooBar', fontsize=5]


推荐阅读