-1

Is it possible to extrapolate my plotly graph to get the Y-axis intercept?

Here is my code, i used Plotly express but can also use other types:

import pandas as pd
import numpy as np
import plotly.express as px
a = np.array([[0.5,1,2,3,5,7], [68,54,30,18.5,6,1.8]])
a = pd.DataFrame(a.T, columns = ["t", "c"])
a.set_index("t")

fig = px.scatter(a, x= a["t"], y=a["c"], log_y=True)
fig.update_traces(mode="lines+markers")
fig.show()

enter image description here

1 Answers1

0

You could use scipy.stats to do a linear regression! https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.linregress.html

This also returns the intercept.

Edit: i didn't see that your y-axis is non linear. Since you know how to make your data linear, just revert your intercept after fitting.

KaPy3141
  • 161
  • 14