我如何在ggplot2图上叠加传奇? 我想在GGPLOT2图中放置一个传奇。例如,请参见代码 ggplot(iris,aes(sepal.length,petal。 geom_point() + 主题(传说

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

ggplot(iris, aes(Sepal.Length, Petal.Width, shape = Species, colour = Species)) + geom_point() + theme(legend.position = c(0.8, 0.2))

r ggplot2 legend
2个回答
0
投票
help for?theme主题say legend.position.position.inside是“长度的数字向量,两个设置具有“内部”位置的传说的位置。
为此参数可以执行您需要的任何事情

legend.position = "inside"enter image description here ggplot(iris, aes(Sepal.Length, Petal.Width, shape = Species, colour = Species)) + geom_point() + theme(legend.position = "inside", legend.position.inside = c(0.8, 0.2))


0
投票

	

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.