我正在创建一个气泡图,我的所有值都是整数.但是,当代码运行时,图例比例给出了小数(即2.5,5,7.5,10).我希望它是像2,5,8,11这样的整数.
这是我的代码:
ggplot() +
geom_path(data = usa, aes(x = long, y = lat, group = group)) +
theme_general + geom_point(data = CombinedStudentsUSA1,
aes(x = Long, y = Lat, size = Number), color = "blue", shape=19, alpha=.5)+
scale_size_continuous(range = c(2, 4))
Run Code Online (Sandbox Code Playgroud)
我已经制作了这个图的多个版本,并且它们都默认为整数.出于某种原因,此特定版本的数据不会这样做.救命?
谢谢!那很有效.以下是我最终的代码:
ggplot() +
geom_path(data = usa, aes(x = long, y = lat, group = group)) + theme_general +
geom_point(data = CombinedStudentsUSA1, aes(x = Long, y = Lat, size = Number),
color = "blue", shape=19, alpha=.5)+ scale_size_continuous(range = c(2, 4),
breaks= c(2,4,6,8), name="Number of \nResponses")
Run Code Online (Sandbox Code Playgroud)
http://i57.tinypic.com/291jfcl.jpg
归档时间: |
|
查看次数: |
2290 次 |
最近记录: |