我有散点图。我想按其频率缩放每个点的大小。所以我有一个长度相同的频率栏。但是,如果我这样做:为什么ggplot2不允许我为每个点设置一个尺寸?
... + geom_point(size=Freq)
我得到这个错误:
When _setting_ aesthetics, they may only take one value. Problems: size
我解释为所有点只能有1个大小。那么我怎么做我想要的?
更新:数据是here 我使用的基本代码是:
dcount=read.csv(file="New_data.csv",header=T)
ggplot(dcount,aes(x=Time,y=Counts)) + geom_point(aes(size=Freq))
也许你可以显示数据和/或更多的代码。看起来像这个人有类似的问题:http://groups.google.com/group/ggplot2/browse_thread/thread/0489a702f3afc83b – apeescape 2010-07-06 21:29:57
当然,你总是可以使用geom_hex()http://stackoverflow.com/questions/3160453/这是一个方法来添加一个图例为ggplots-alpha/3161015#3161015 – apeescape 2010-07-06 21:39:23
从ggplot2的版本2.0.0您可以使用'geom_count'并跳过创建一个新的“频率”列。请参阅http://stackoverflow.com/questions/17279027/ggplot2-visualizing-counts-of-points-plotted-on-top-of-each-other-stat-bin2d-or。此外,这篇文章中的数据链接现在重定向到亚马逊。 – 2016-06-27 14:33:39