正在ggplot上浏览虹膜示例,收到以下错误消息,想知道为什么调整alpha无法解决问题。
library (datasets)
# Scatterplot, colored by species, fit line, density
ggplot(iris,
aes(Petal.Width, Petal.Length,
color = Species)) +
geom_point(size = 3) +
geom_smooth(method = lm) +
geom_density2d(alpha = .5) +
theme(legend.position = "bottom")
geom_smooth()` using formula 'y ~ x'
Warning messages:
1: stat_contour(): Zero contours were generated
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
4: stat_contour(): Zero contours were generated
5: In min(x) : no non-missing arguments to min; returning Inf
6: In max(x) : no non-missing arguments to max; returning -Inf
1条答案
按热度按时间oxiaedzo1#
我无法让bin大小起作用,所以经过一番研究,我找到了contour_var选项。
这就成功了,并得到了IRIS数据集的预期结果(根据我所遵循的训练:-)