I want to be able to draw a faint dotted or dashed line through y=0 to make it more obvious when the plotted line goes below 0. If possible id like the whole area of the graph below the y=0 line to be lightly shaded to show even better when the plotted line drops below zero.
Here is just an example of a type of graph that i would want to shade/draw a line:
http://s27.postimg.org/v94uey56r/Rplot02.png
There are lots of different graph types that i would like to do this to so it doesnt have to be specific, just aslong as it works so i have a general idea of what to do is good enough :)
thankyou
If you choose type = "l", R plots solid lines by default. Use the optional lty argument to set the line type. For example, plot(x, y, type = "l", lty = "dashed") plots a dashed line.
Create a plot with a red dashed line and circular markers by specifying the linespec argument as '--or' . For this combination, '--' corresponds to a dashed line, 'o' corresponds to circular markers, and 'r' corresponds to red. You do not need to specify all three aspects of the line.
How about abline(h = 0, lty = 2)
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With