增加rCharts NVD3的所有点的点大小

时间:2015-02-26 23:52:05

标签: r nvd3.js rcharts

根据this问题,可以根据数据集中的变量改变点的大小。是否可以简单地增加所有点的大小以使它们更加明显?

library(rCharts)
p2 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p2$xAxis(axisLabel = 'Weight')
p2$chart(size = '1000') #Also tried 1000, '1000px', etc.
p2

1 个答案:

答案 0 :(得分:3)

使用这个非常有用的答案d3.v3 scatterplot with all circles the same radius

试试这个
library(rCharts)
p2 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p2$xAxis(axisLabel = 'Weight')
#p2$chart(size = 100) #Also tried 1000, '1000px', etc.
p2$chart(sizeRange = c(1000,1000))
p2