[R] scale_x_continuous

Felipe Carrillo mazatlanmexico at yahoo.com
Wed Dec 26 21:45:19 CET 2007


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



More information about the R-help mailing list