[R] plot vs curve

Christian Ritz ritz at life.ku.dk
Wed Sep 12 10:12:31 CEST 2007


Dear list members,

is it intentional that:


curve(cos, xlim = c(-5, 5))
plot(cos, xlim = c(-5, 5))


produce different plots?

Shouldn't the 'xlim' argument in both cases set the 'from' and 'to' argument if they 
aren't supplied (at least that's what I understood reading the help page for 'curve' and 
'plot.function')?


Christian




 > sessionInfo()
R version 2.5.1 (2007-06-27)
i386-pc-mingw32

locale:
LC_COLLATE=Danish_Denmark.1252;LC_CTYPE=Danish_Denmark.1252;LC_MONETARY=Danish_Denmark.1252;LC_NUMERIC=C;LC_TIME=Danish_Denmark.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"

other attached packages:
       car       drc   plotrix      nlme      MASS   lattice
   "1.2-1"   "1.2-3"   "2.2-4"  "3.1-83"  "7.2-34" "0.15-11"



More information about the R-help mailing list