Creating 12 subplots with plotly from a csv containing rows with 13 values. The last value indicates that the data in that row is estimated from this point until the status changes back in a later row.
Trying to make line graphs that plots a line, changes to red when the status changes to 1, then back to original color when the status changes back to 0. Is this possible?
with lock:
df = pd.read_csv(OCcsvFile, delimiter=',')
# plotly setup
plot_rows = 4
plot_cols = 3
# Create plot figure
fig = make_subplots(rows=plot_rows, cols=plot_cols, subplot_titles=("Header1", "Header2", "Header3", "Header4", "Header5",
"Header6", "Header7", "Header8", "Header9", "Header10",
"Header11", "Header12"))
# add traces
x = 1 # column counter
for i in range(1, plot_rows+1):
for j in range(1, plot_cols+1):
#print(str(i)+ ', ' + str(j))
fig.add_trace(go.Scatter(x=df.iloc[:, 0], y=df.iloc[:, x],
name=df.columns[x],
mode='lines'),
row=i,
col=j)
x = x+1