plotly.express.trendline_functions package¶
The trendline_functions module contains functions which are called by Plotly Express
when the trendline argument is used. Valid values for trendline are the names of the
functions in this module, and the value of the trendline_options argument to PX
functions is passed in as the first argument to these functions when called.
Note that the functions in this module are not meant to be called directly, and are exposed as part of the public API for documentation purposes.
- 
plotly.express.trendline_functions.ewm(trendline_options, x_raw, x, y, x_label, y_label, non_missing)¶
- Exponentially Weighted Moment (EWM) trendline function - The value of the - functionkey of the- trendline_optionsdict is the function to use (defaults to- mean) and the value of the- function_argskey are taken to be its arguments as a dict. The remainder of the- trendline_optionsdict is passed as keyword arguments into the- pandas.Series.ewmfunction.
- 
plotly.express.trendline_functions.expanding(trendline_options, x_raw, x, y, x_label, y_label, non_missing)¶
- Expanding trendline function - The value of the - functionkey of the- trendline_optionsdict is the function to use (defaults to- mean) and the value of the- function_argskey are taken to be its arguments as a dict. The remainder of the- trendline_optionsdict is passed as keyword arguments into the- pandas.Series.expandingfunction.
- 
plotly.express.trendline_functions.lowess(trendline_options, x_raw, x, y, x_label, y_label, non_missing)¶
- LOcally WEighted Scatterplot Smoothing (LOWESS) trendline function - Requires - statsmodelsto be installed.- Valid keys for the - trendline_optionsdict are:- frac(- float, default- 0.6666666): the- fracparameter from the
 - statsmodels.api.nonparametric.lowessfunction
- 
plotly.express.trendline_functions.ols(trendline_options, x_raw, x, y, x_label, y_label, non_missing)¶
- Ordinary Least Squares (OLS) trendline function - Requires - statsmodelsto be installed.- This trendline function causes fit results to be stored within the figure, accessible via the - plotly.express.get_trendline_resultsfunction. The fit results are the output of the- statsmodels.api.OLSfunction.- Valid keys for the - trendline_optionsdict are:- add_constant(- bool, default- True): if- False, the trendline passes through
 - the origin but if - Truea y-intercept is fitted.- log_xand- log_y(- bool, default- False): if- Truethe OLS is computed with
 - respect to the base 10 logarithm of the input. Note that this means no zeros can be present in the input. 
- 
plotly.express.trendline_functions.rolling(trendline_options, x_raw, x, y, x_label, y_label, non_missing)¶
- Rolling trendline function - The value of the - functionkey of the- trendline_optionsdict is the function to use (defaults to- mean) and the value of the- function_argskey are taken to be its arguments as a dict. The remainder of the- trendline_optionsdict is passed as keyword arguments into the- pandas.Series.rollingfunction.
