I have a DataFrame with the columns: start date, end date, and value. How can I plot one line for each start-end date in Plotly?
Example:
import pandas as pd
import plotly.express as px
df = pd.DataFrame({"start date": [1,2,3,4], "end date":[8,7,4,9], "value":[11,3,11,4]})
fig = px.line(df, x=["start date","end date"], y="value")
fig.show()
In this case, there are only two lines for the columns start date and end date. However, what I'm looking for is 1 line for each start-end date. I tried with the parameter color="value" but, in value 11 it only plots 1 line. I could print it with simple plot of plt as:
import matplotlib.pyplot as plt
x = [df["start date"], df["end date"]]
y = [df["value"], df["value"]]
plt.plot(x, y)
plt.show()

