R中的plot.ts:为什么大多数par()不会在其中工作?

时间:2017-08-10 04:23:36

标签: r plot

我想知道为什么大多数par()例如font.lab ; font.axis ; cex.lab甚至xlim()都不能与R中的plot.ts()一起使用?

有关如何plot.ts()接受font.lab ; font.axis ; cex.lab ; xlim效果的任何建议吗?

coin_outcome <- sample(x = c(0, 1), size = 20, prob = c(1 - .6, .6), replace = TRUE)

plot.ts(cumsum(coin_outcome) / 1:20, ylim = c(0, 1), font.lab = 2, font.axis = 2, 
cex.lab = 2, xlim = c(1, 20))

1 个答案:

答案 0 :(得分:2)

我在这种情况下使用par,它对我有用。

coin_outcome <- sample(x = c(0, 1), size = 20, prob = c(1 - .6, .6), 
 replace = TRUE)
 par(font.lab=3,font.axis = 2,cex.lab = 2)
 plot.ts(cumsum(coin_outcome) / 1:20, ylim = c(0, 1),
 xlim = c(1, 20))