Scale_size_area和scale_radius

时间:2016-09-27 16:59:05

标签: r ggplot2

美好的一天,

有谁知道R如何处理缩放功能?这不是以1:1比例绘制的圆圈。

library("ggplot2")
ggplot(mpg, aes(displ, hwy, size = hwy))+geom_point(data=, aes(x=1,y=1), colour="Red", shape=1)+scale_size_area(pi)
ggplot(mpg, aes(displ, hwy, size = hwy))+geom_point(data=, aes(x=1,y=1), colour="Red", shape=1)+scale_radius(1)

Drawn using scale_size_area Drawn using scale_radius

R控制台告诉我:

> scale_size_area()
<ScaleContinuous>
 Range:  
 Limits:    0 --    1
> scale_radius()
<ScaleContinuous>
 Range:  
 Limits:    0 --    1

1 个答案:

答案 0 :(得分:0)

可以使用scale_radius绘制任意大小的geom_point对象:

EXCEPTION: unable to parse url 'commission.json'; 
original error: Cannot read property 'split' of undefined

物体的大小因图像的宽度和高度而异,此处为直径= 1的圆,宽度为400,高度为400.

enter image description here

由于某些奇怪的原因,这不适用于scale_size_area()。