ich einen Teil oder die Daten darstellen möchtenPython Grundstück nur einen Teil der Daten
hier ist der Code
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
... ...
xs = []
avg = []
for line in lines:
if len(line) > 1:
x, y1 = line.split(',')
xs.append(float(x))
avg.append(float(y1))
ax1.plot(xs, avg, label='avg')
ich einige der Code hinzugefügt, so dass Sie den Typ der Variablen sehen
ich habe versucht:
ax1.plot(xs[avg>0], avg[avg>0], label='avg')
und funktioniert nicht
im Matlab würde ich irgendeine Sache tun:
Indxs=find (ys>0)
Plot(xs(indxs),ys(indxs))
Sie bei numpy.where aussehen kann (https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.where.html) um die Indizes der gewünschten Teilmenge zu finden. – KPLauritzen