Consider:
x <- seq(-5,5,length.out = 100)
y <- x^2
data <- data.frame(x,y)
library(ggplot2)
ggplot(data,aes(x,y))+
? stat_function(
? ? fun = function(x) x^2,
? ? color = "blue", linewidth = 1.25
? ) +
? theme_linedraw()
I'd like to add an arrow to the ends of curve to illustrate the?curve continues indefinitely in that direction,
ChatGPT suggests using geom_segment or geom_link but there has an easier way to do this.
Any suggestions would be appreciated.