is an option to visualization functions such as ListPlot and ListPlot3D that determines how to fit a model to the data.
PlotFit
is an option to visualization functions such as ListPlot and ListPlot3D that determines how to fit a model to the data.
Details
- PlotFit is used to fit a model to the data, resulting in an approximating curve or surface.
- PlotFitfit determines what method is used to fit a curve to the data.
- Possible settings for fit include:
-

Automatic automatically choose the fitting model 
"Linear" use linear regression 
"Quadratic" use a quadratic model 
"Cubic" use a cubic model 
"Exponential" use an exponential model 
"Log" use a logarithmic model 
"Power" use a power law model 
"Logistic" use a logistic model 
"Local" use LocalModelFit 
"Kernel" use KernelModelFit 
model fit model on the data - Valid model specifications include:
-
DecisionTreeModel[] decision tree ExponentialModel[] product of 
FormulaModel[expr,…] generic expression expr LinearModel[basis,…] linear combination of the terms in basis LogModel[] sum of 
NearestModel[] nearest neighbor model PerceptronModel[] multilayer perceptron PeriodicModel[] sum of 
PolynomialModel[d] polynomial of degree d PowerModel[] product of ![alpha_i TemplateBox[{x, i, {beta, _, i}}, Subsuperscript] alpha_i TemplateBox[{x, i, {beta, _, i}}, Subsuperscript]](Files/PlotFit.en/1.png)
Examples
Basic Examples (5)
ListPlot[ResourceData["Sample Tabular Data: Car Models"] -> {"displacement", "mpg"}, PlotFit -> Automatic]ListPlot[ResourceData["Sample Tabular Data: Car Models"] -> {"displacement", "mpg"}, PlotFit -> "Linear"]ListPlot[ResourceData["Sample Tabular Data: Car Models"] -> {"displacement", "mpg"}, PlotFit -> "Quadratic"]Fit a logarithmic model to the data:
ListPlot[ResourceData["Sample Tabular Data: Car Models"] -> {"displacement", "mpg"}, PlotFit -> LogModel[]]ListPointPlot3D[QuantityArray[«1»], PlotFit -> Automatic]Related Guides
History
Introduced in 2025 (14.3) | Updated in 2026 (15.0)
Text
Wolfram Research (2025), PlotFit, Wolfram Language function, https://reference.wolfram.com/language/ref/PlotFit.html (updated 2026).
CMS
Wolfram Language. 2025. "PlotFit." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. https://reference.wolfram.com/language/ref/PlotFit.html.
APA
Wolfram Language. (2025). PlotFit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PlotFit.html
BibTeX
@misc{reference.wolfram_2026_plotfit, author="Wolfram Research", title="{PlotFit}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/PlotFit.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_plotfit, organization={Wolfram Research}, title={PlotFit}, year={2026}, url={https://reference.wolfram.com/language/ref/PlotFit.html}, note=[Accessed: 13-June-2026]}