I am trying to make a plot in R, which has part of the gray plot to emphasize this area. Unlike other examples, I do not want to color the area for the plot, but instead I color the area in the area starting from one area and going to the end of the graph. When I try to use rect () or polygon (), it hides the graphics that I want to emphasize.
For example:
x_mean <- c(1, 2, 3, 4) y_mean <- c(1, 1, 1, 1) y_max <- c(4, 4, 4, 4) y_min <- c(-4, -4, -4, -4) x_shade <- c(2, 3, 4) y_max_shade <- c(4, 4, 4) y_min_shade <- c(-4, -4, -4) plot(x=rep(x_mean, 3), y=c(y_mean, y_max, y_min), bty='n', type="n" ) arrows(x0=x_mean, y0=y_min, x1=x_mean, y1=y_max, length=0) points( x=x_mean, y=y_mean, pch=16)
This will build 4 lines on the chart. How to draw a gray field in the background from the second line to the end of the graph?
Kevin
source share