当前位置:  开发笔记 > 编程语言 > 正文

在扇形图中R与其他包比fanplot

如何解决《在扇形图中R与其他包比fanplot》经验,为你挑选了0个好方法。

我通常会创建一个这样的粉丝图:

n.ahead <- 10
m <- matrix(,nrow = 5000,ncol = 10)

library(fanplot)
m[,1] <- rnorm(5000,0.01,sd = 0.005)
m[,2] <- rnorm(5000,0.02,0.006)
m[,3] <- rnorm(5000,0.03,0.008)
m[,4] <- rnorm(5000,0.04,0.01)
m[,5] <- rnorm(5000,0.06,0.013)
m[,6] <- rnorm(5000,0.1,0.015)
m[,7] <- rnorm(5000,0.11,0.02)
m[,8] <- rnorm(5000,0.13,0.025)
m[,9] <- rnorm(5000,0.14,0.05)
m[,10] <- rnorm(5000,0.18,0.07)

n.ahead <- 10
fancol <- colorRampPalette(c('black', 'white'))
plot(
  NULL, type = 'n', lwd = 3, col = 'black',
  xlim = c(0, n.ahead), ylab = 'Y', ylim = c(0,max(m)), xlab = 'Year',
  las = 1, xaxt = 'n', main = 'Y'
)
fan(
  m, fan.col = fancol, ln.col = 'grey', txt = c('90','95', '99'),
  anchor = 0, frequency = 1, probs = c(seq(1, 99, 1), 99.9, 99.95, 99.99), ln =
    c(50, 90, 99, 99.9, 99.95, 99.99)
)
axis(1, at = 0:n.ahead, tcl = 0.5)
axis(1, at = seq(0, n.ahead, 0.25), labels = FALSE, tcl = 0.25)

它就是创建了一个fanlplot的意思.但是,我真的不喜欢它.是否有与动态图表的选择就像我们看到的dygraphsrCharts我在闪亮的使用?

谢谢.

推荐阅读
个性2402852463
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有