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.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to