[R] xlim and ylim on npudens (np package)

Dan Stowell dan.stowell at elec.qmul.ac.uk
Fri Jul 24 10:49:12 CEST 2009


Hi -

I'm just geting started with R, specifically needing to plot some 3D 
joint distribution functions estimated from data. Happily, the "np" 
package includes example code which gets most of the way there.

The following tweak of the doc code gives me a nice cdf:

library(np)
library(datasets)
data(faithful)
f <- npudens(~eruptions+waiting,data=faithful)
plot(f,cdf = TRUE, xtrim = -0.2, view = "fixed", main = "")

...but I'm currently stuck on how to set the x and y limits of this 
plot. It seems that xlim and ylim should be what I need, but the 
following doesn't affect the limits:

plot(f,cdf = TRUE, xtrim = -0.2, view = "fixed", main = "", xlim=c(2,5), 
ylim=c(10,30))

Should the xtrim and ytrim args work with this kind of plot? Am I doing 
something wrong?

Thanks in advance for any advice -
Dan


-- 
Dan Stowell
Centre for Digital Music
School of Electronic Engineering and Computer Science
Queen Mary, University of London
Mile End Road, London E1 4NS
http://www.elec.qmul.ac.uk/department/staff/research/dans.htm
http://www.mcld.co.uk/




More information about the R-help mailing list