folgende Fragestellung: ich habe mehrere Datenlisten in einem Dict (dictionary) gepeichert, die ich nun gerne plotten würde. Dabei loope ich mittels dem Zähler "counter" durch.
Code: Alles auswählen
csv=0
while counter<csv:
fig1, ax1 = plt.subplots()
## Signal A plotten
ax1.plot(dictionaryT[counter],dictionaryA[counter],color=next(colors), linewidth=0.5,zorder=1, label = "A")
ax1.legend(loc="upper right",bbox_to_anchor=(1,1))
ax1.grid(color='grey', linestyle='-', linewidth=0.5)
ax1.axhline(0, color='black',linewidth=0.5)
## S plotten
ax2 = ax1.twinx()
ax2.plot(dictionaryT[0],dictionaryS[0],zorder=2,color=next(colors), linewidth=0.8,label = "S")
ax2.set_ylabel('S')
ax2.legend(loc="upper right",bbox_to_anchor=(1,0.95))
fig1.tight_layout()
counter=counter+1
für jeden Loop ein neuen Plot erzeugen ODER eine neue figure Umgebung . Hierfür müsste ich quasi in jedem Loop: fig1, ax1 = plt.subplots() hochzählen (fig1, ax1 = plt.subplots() --- > fig2, ax1 = plt.subplots() )
Wisst Ihr was ich meine
Viele Grüße
Helmut