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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -