Dashed black and white line always visible

If you have a graph with lot of black dots on some places without dots, a black or white line will not be visible on some part of the plot. A solution is to draw a dashed white and black line. Here is how to do:

> a <- 1:10000
> a <- 1:1000
> b <- a+rnorm(1000, a, a)
> plot(a, b, bty="n", las=1, pch=19)

> abline(a=0, b=1, col="black")
> abline(a=0, b=1, col="white", lty=2)

> abline(a=100, b=1, col="white")
> abline(a=100, b=1, col="black", lty=2)


Note that the white and black segments are shifted depending on the order of the white or black segments.

Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04