[R] scale_x_continuous

From: Felipe Carrillo <mazatlanmexico_at_yahoo.com>
Date: Wed, 26 Dec 2007 12:45:19 -0800 (PST)


Hello all: Any ideas on how can I set the X axis limits to week 1? I tried the
scale_x_continuous(limits=c(1,NA)
but I get an error message. It works for the Y axis though.

library(ggplot2)
df <- data.frame(date = seq(Sys.Date(), len=100, by="1 day")[sample(100, 50)],price = runif(50)) df <- df[order(df$date), ]
dt <- qplot(date, price, data=df, geom="line") dt$aspect.ratio <- 1/4
dt + scale_x_date()

 dt + scale_x_date(format="%m/%d")
 dt + scale_x_date(format="%W")+
scale_y_continuous(limits = c(0, NA))

Felipe D. Carrillo
  Fishery Biologist
  US Fish & Wildlife Service
  California, USA



Be a better friend, newshound, and

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 26 Dec 2007 - 20:51:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 26 Dec 2007 - 22:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.