Adding a trendline or line of best fit

There actually are a few posts on this if you search the forum. This one could be helpful: Plot the confidence interval for a model fit

In short you can plot the output of predict from the GLM package for a simple linear fit, or of course a logarithmic fit if you parametrize the model appropriately.

Moving averages are available from the RollingFunctions package.

I’m not normally one to present missing functionality as a “feature”, but this pre-packaged application of one-click trendlines has gotten people in trouble before, so there is something to be said for Julia requiring you to explicitly specify some form of model for your trendline:

3 Likes