[R] hide ends of line in a density plot

Albert Vilella avilella at gmail.com
Tue Jul 6 17:50:59 CEST 2010


Hi,

(I googled for this answer but didn't find anything)

I am using density plot and I want to trim the ends of the line. eg:

i = rnorm(100,100,2)
j = subset(i,i<102 & i>98)
summary(j)
plot(density(j))

I only want the line to go from 98 to 102. How can I limit the line
(and the axis)
to the values I specify?

Cheers,

Albert.



More information about the R-help mailing list