How to add a line to a figure? I tried figure.add_, but I do not know what to use for a line. When I reversed the order and used figure.add_scatter, I obtained an error:
The 'cliponaxis' property must be specified as a bool (either True, or False)
import plotly.express as px
import numpy as np
import pandas as pd
from plotly.graph_objs import *
import plotly.graph_objects as go
data_n = np.loadtxt('f.dat', unpack=True, usecols=[0, 2, 5, 7])
data = data_n.tolist()
d = {'A': data[0], 'B': data[1]}
fig = px.scatter(df, x='A', y='B')
x_new = ...
y_new = ...
d_fit = {'x': x_new, 'y': y_new}
df_fit = pd.DataFrame(data=d_fit)
fig = px.line(df_fit, x='x', y='y') # to add
fig.show()