在ggvis图表中注释脚注?

时间:2016-06-08 16:41:51

标签: r ggvis

我想在ggvis图表中添加类似脚注的内容。我认为ggvis中没有注释功能。一个想法是使用轴标题,但我不能让文本更改行。有没有人有建议?

下面是一个mre。

df <- data.frame(x = rnorm(10), y=rnorm(10))
ggvis(df, x=~x, y=~y) %>%
    layer_points() %>%
    add_axis("x", orient = "bottom", title = "X") %>%
    add_axis("x", orient = "bottom", grid=F, ticks = 0, title = "footnote here?
            \n line 1 \n line2 \n line 3", title_offset= 60,
             properties = axis_props(
                 ticks = list(stroke= NULL),
                 axis = list(stroke = NULL),
                 labels = list(fontSize = 0),
                 title=list(fontSize=14) ) ) # this creates one line title

0 个答案:

没有答案