I would like to make a plot that has horizontal line (not at the x-axis), but I would like this line to extend indefinitely instead of just being a line segment. So far, I’m not sure how I can do this with plot_ly or ggplotly.
Basically, I want the person viewing the plot to be able to zoom out and always see the line extend to the edges of the graph.
Here is a toy example:
p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point()
p <- p + geom_hline(yintercept = 20, size = .25)
ggplotly§
That’s odd. With v 3.0.1 it works fine (for me anyway). Which version are you using? Also, can you share a screenshot of you get when you run that code snippet?