开发者

R ggplot2: possible to customize the continuity of a time scale?

Is it possible to have a datetime scale not consider weekends as part of the time continuum? For instance, if I开发者_如何学编程 am plotting stock prices over a 2 week period with a line geometry, I do not want to plot a 2 day period of flattness during the weekend. I would like friday to connect with Monday.


I imagine that there's a better way, but you could always just use an index for the plot and then assign the dates as labels afterwards:

p <- qplot(1:3, 1:3, geom='line') 
p + scale_x_continuous("", breaks=1:3, labels = as.Date(c("2010-06-03", "2010-06-04", "2010-06-07")))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜