Questions tagged [trendline]
270 questions
4
votes
1 answer
jqplot show trendline over barchart
Can anyone please tell me what I need to do with the code below to display a trendline over my barchart. Thanks!
I am using the JqPlot plugin. Here's the code to date...

decbrad
- 191
- 5
- 15
4
votes
1 answer
TypeError: scatter() got an unexpected keyword argument 'trendline_options' (Plotly, Python)
I'm getting the error:
TypeError: scatter() got an unexpected keyword argument 'trendline_options'
When trying to adjust the smoothing of the lowess tendline using plotly express.
Here is my code for the graph:
fig = px.scatter(dfg, x="Yr_Mnth",…

John Conor
- 722
- 6
- 20
4
votes
1 answer
Calculate slope and intercept value for logarithmic trendline as excel
I am generating Logarithmic trendlines and used Excel formula for this. But i can't calculate slope and intercept value as calculated in Excel. I think, i did some mistakes in my formula.
This is my code
var X= [10, 25, 30, 40]; Y= [5, 4, 7, 12];
…

Bharathi
- 1,288
- 2
- 14
- 40
4
votes
1 answer
Check if Trendline Exists in VBA
I have a sheet with a chart in it. I need to insert a button to TOGGLE the Trendline On/Off. So first, I need to check whether a trendline exists or not. Sounds simple, but is driving me NUTS!!!
Here is the code that I use to create the trednline…

Alaa Elwany
- 677
- 7
- 15
- 20
3
votes
1 answer
How to add a OLS trendline to a plotly scatter plot graph object that uses updatemenus to display subsets of data?
I am trying to make a plotly scatter plot with a OLS trendline and provide a dropdown menu what let's the user pick from a different of X's and Y's. The plot almost works. Where the first figure produced by the code has the data and the trendline,…

MartyMcFly
- 63
- 6
3
votes
1 answer
how to add confidence interval fillcontour using plotly express?
I am using plotly express to add trendline, now how to plot confidence interval like in seaborn regplot(),
df = px.data.tips()
fig = px.scatter(df, x="total_bill", y="tip", trendline="ols")
fig.show()

roudan
- 3,082
- 5
- 31
- 72
3
votes
1 answer
Plotly scatterplot trendline appears under the scatter. How do I get the trendline to appear over the scatterplot? [Python]
I'm trying to plot a trendline for a Plotly scatterplot and I can't figure out how to get the trendline to appear over the scatter. Below is the code that I used:
import plotly.express as px
fig = px.scatter(df, x='Percentage_LIFT',…

noha54
- 33
- 1
- 1
- 5
3
votes
1 answer
Plotly Trendline for Line Chart
Is there any way to easily add a trendline to a plotly express line chart like there is for plotly scatter plot?
I have tried using this line to create my dataframe:
fig = px.line(df4, x=df4["DATE"], y=df4['Ratio'], title="Market Ratio",…

LBJ33
- 425
- 11
- 29
3
votes
2 answers
How to make trend line go through the origin while plotting its R2 value - python
I am working with a dataframe df which looks like this:
index var1 var2 var3
0 0.0 0.0 0.0
10 43940.7 2218.3 6581.7
100 429215.0 16844.3 51682.7
I wanted to plot each variable, plot…

I.M.
- 344
- 3
- 14
3
votes
1 answer
How do I add a trend line to this data frame (Python)
I was wondering how I could add a trend line (or line of best fit) to my bar graph. I have tried searching but have only found myself confused. Here is the code that I use to create the bar graph:
dfY =…

BioFluorescent277
- 117
- 1
- 6
3
votes
1 answer
Polynomial trend line on a group by matplotlib line plot
I'm trying to add a polynomial trendline line on a matplotlib groupby line plot.
Without messing with the dataframe, is there anyway to achieve the trend line?
Thanks in advance!
Score = [1, 2, 3, 4, 5, 6]
Product = ['Apparel', 'Apparel…

Matthias Gallagher
- 475
- 1
- 7
- 20
3
votes
2 answers
Add trendline for timeseries graph
I want to add a trendline for a timeseries graph in python, that means my x-axis (Datum) has the format of datetime64[ns], when I am following this thread: How to add trendline in python matplotlib dot (scatter) graphs?
and run my code:
import numpy…

PV8
- 5,799
- 7
- 43
- 87
3
votes
1 answer
Making a regression line through a bar char using pandas or seaborn
I am new to Pandas and Seaborn and trying to learn. I am trying to add a trend line and a bar plot on the same graph. I have some data that looks like
Year Sample Size
2000 500
2001 3000
2003 10000
2004 20000
2004 …

paddy
- 123
- 1
- 2
- 13
3
votes
2 answers
Remove unsorted/outlier elements in nearly-sorted array
Given an array like [15, 14, 12, 3, 10, 4, 2, 1]. How can I determine which elements are out of order and remove them (the number 3 in this case). I don't want to sort the list, but detect outliers and remove them.
Another example:
[13, 12, 4, 9, 8,…

ksloan
- 1,482
- 1
- 13
- 19
3
votes
1 answer
Tableau, Scatterplot with Trendlines to show confidence levels
I have scatterplot in Tableau, and I displayed trendlines. However, I cannot understand why there are three of them.
When I research this on Tableau, they say upper line is upper 95% confidence, and lower line is lower 95% confidence.
When I think…

Rhonda
- 1,661
- 5
- 31
- 65