r - how to break x-axis in a density plot -


i want plot distribution , single value (with abline) smaller minimum value in distribution, abline won't appear in plot. how can plot them in same plot manipulating x-axis scale or maybe inserting breaks?

data <- rnorm(1000, -3500, 27) estimate <- -80000  plot(density(data)) abline(v = estimate) 

here's rough solution, it's not particularly pretty:

library(plotrix)  d <- density(data) gap.plot(c(-8000,d$x), c(0,d$y), gap=range(c(-7990,-3620)),           gap.axis="x", type="l", xlab="x", ylab="density",           xtics=c(-8000,seq(-3600,-3300,by=100))) abline(v=-8000, col="red", lwd=2) 

enter image description here


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -