I’m trying to create a curved line showing a trend in data in a graph, but I can’t figure out how to generate the necessary data points, similar to the second graph in this image:

All of the documentation and examples I find use math that goes over my head, any pseudocode would be great.
I was able to plot an exponential regression line with the below code: