Ich ziehe Daten aus einer CSV und zeichne die Daten. Ich zeichne eine Reihe von digitalen Signalen auf und lege dann Punkte für den Statuswechsel fest. Fügen Sie zusätzliche Plot zu Unterplot Plotly Python
Jetzt versuche ich einige Textmarker zu einigen der Plots hinzuzufügen. Ähnlich wie folgt aus:
Hier ist der Code, den ich jetzt haben:
points = {'A':[X_SoC[8][1], Y_SoC[8][1]], 'B': [X_SoC[9][1], Y_SoC[9][1]], 'C' :[X_SoC[9][2], Y_SoC[9][2]],
'D' : [X_SoC[1][1], Y_SoC[1][1]], 'E': [X_SoC[10][1], Y_SoC[10][1]], 'F' :[X_SoC[10][2], Y_SoC[10][2]],
'G' : [X_SoC[11][1], Y_SoC[11][1]], 'H': [X_SoC[10][3], Y_SoC[10][3]], 'J' :[X_SoC[9][3], Y_SoC[9][3]],
'K' : [X_SoC[10][4], Y_SoC[10][4]], 'L': [X_SoC[8][2], Y_SoC[8][2]], 'M' :[X_SoC[7][4], Y_SoC[7][4]],
'N' : [X_SoC[9][4], Y_SoC[9][4]], 'P': [X_SoC[7][5], Y_SoC[7][5]]}
pt_A = X_SoC[8][1]
pt_B = X_SoC[9][1]
pt_C = X_SoC[9][2]
pt_D = X_SoC[1][1]
pt_E = X_SoC[10][1]
pt_F = X_SoC[10][2]
pt_G = X_SoC[11][1]
pt_H = X_SoC[10][3]
pt_J = X_SoC[9][3]
pt_K = X_SoC[10][4]
pt_L = X_SoC[8][2]
pt_M = X_SoC[7][4]
pt_N = X_SoC[9][4]
pt_P = X_SoC[7][5]
for i in range(Num_Channels):
trace0.append(go.Scatter(x=df_lab["Time"], y = df_lab[Headers[i+1]], mode = 'lines', name = Headers[i+1]))
trace1.append(go.Scatter(x=X_SoC[i], y = Y_SoC[i], mode = 'markers', =
False))
trace1.append(go.Scatter(x = X_SoC[8][1], y = Y_SoC[8][1], mode =
'markers+text', text = 'A', textposition = 'bottom'))
print("The label 'A' should be at ", X_SoC[8][1], " and ", Y_SoC[8][1], " of the ninth graph down")
fig = tools.make_subplots(rows = Num_Channels, cols = 1,shared_xaxes = True)
for i in range(Num_Channels):
fig.append_trace(trace0[i],i+1,1)
fig.append_trace(trace1[i],i+1,1)
#fig.append_trace(trace2, 9, 1)
fig['layout'].update(height = 750, width = 950, title = 'Bit Timing!')
py.iplot(fig)
ich eine trace2 Variable versucht haben, diese neueste Methode ist, den aktuellen Punkt Plot anhängen, aber es wird nicht angezeigt in irgendeiner Form oder Form. Mein Ziel ist es, das Wörterbuch zu benutzen, damit ich es einfach durchlaufen kann.
Wie füge ich den dritten Plot hinzu?
Dank