问题
The file to generate the graph can be downloaded from https://db.tt/hHYq0mSA. I'm sharing a link because dput generates a huge output. This is what I'm runing
require(rCharts)
dense<-readRDS("dense.RDS")
nPlot(x = "minutes", y = "FBS", data = dense, type = "lineChart")
This is what I get
What are the numbers (63382626 and 67270968) in the Y axis? how can I make them go away?
Thanks!
回答1:
The strange digits are the final digits of the min and max of y
> options(digits=12)
> min(dense[,2])
[1] 0.000239026338263
> max(dense[,2])
[1] 0.0417486727097
You need to add some formatting rules on the y axis ticks:
require(rCharts)
dense<-readRDS("dense.RDS")
n1 <- nPlot(x = "minutes", y = "FBS", data = dense, type = "lineChart")
n1$yAxis(tickFormat = "#! function(d) {return d3.format(',.2f')(d)} !#")
n1
Aternative you can set the domain of the yaxis and keep the digits
require(rCharts)
dense<-readRDS("../Downloads/dense.RDS")
n1 <- nPlot(x = "minutes", y = "FBS", data = dense, type = "lineChart")
n1$chart(forceY = c(0, 0.05))
n1
来源:https://stackoverflow.com/questions/24494614/rcharts-weird-numbers-in-the-y-axis