Trendline with equation #185
-
Hi, I would like to add a trendline (with the equation on the plot if possible) on a selected set of datapoints. I tried to add it as custom Kwarg like this Kwarg Name Kwarg Value but it doesn't appear anywhere. Am I missing something? Thanks a lot |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @brianjoubert , I just tried it on a scatter plot and it works for me. You may have been using a graph that doesn't support the trendline argument? Please check this reference https://plotly.com/python-api-reference/generated/plotly.express.scatter.html#plotly.express.scatter, and if that isn't the reason, create a minimum reproducible example that I can look into. Or are you saying the trendline works but you're just missing the equation showing on the plot? That would be a new feature request to make on the Plotly Express repo. In the meantime you would need to calculate it yourself and manually create a textbox on the Plotly figure |
Beta Was this translation helpful? Give feedback.
Hi @brianjoubert , I just tried it on a scatter plot and it works for me. You may have been using a graph that doesn't support the trendline argument? Please check this reference https://plotly.com/python-api-reference/generated/plotly.express.scatter.html#plotly.express.scatter, and if that isn't the reason, create a minimum reproducible example that I can look into.
Or are you saying the trendline works but you're just missing the equation showing on the plot? That would be a new feature request to make on the Plotly Express repo. In the meantime you would need to calculate it yourself and manually create a textbox on the Plotly figure