在 ggvis
中,如果要更改图例的位置,则必须使用 add_legend(orient = 'left')
函数,但它只允许您在'left'和'right'之间进行选择 . 在 ggplot2
中,我可以使用 theme
函数将图例放在图的顶部
ggplot(iris, aes(x = Petal.Width, y = Petal.Length, colour = Species)) +
geom_point() +
theme(legend.position = 'top')
是否可以用 ggvis
实现这一目标?
1 回答
根据ggvis文档,它是可能的 . 以下示例来自该文档 .
试试这个