i got this code:
while cap.isOpened():
pose = results.pose_landmarks.landmark
pose_row_x = list(np.array([[landmark.x] for landmark in pose]).flatten())
pose_row_y = list(np.array([[landmark.y] for landmark in pose]).flatten())
pose_row_z = list(np.array([[landmark.z] for landmark in pose]).flatten())
df = pd.DataFrame(data=[pose_row_x, pose_row_y, pose_row_z ]).T
df.columns = ["x", "y", "z"]
plt.scatter(df['x'],df['y'])
plt.plot()
I would like to print the new added values in "real Time" in the same plot. For every loop i got a new plot.
Is there any way to update the plot in every loop iteration ?
EDIT: PLOT: I would be grateful for any help!
CodePudding user response:
I would recommend using a single Axes object for all of your plots. Something like this:
fig, ax = plt.subplots()
while cap.isOpened():
# generate data here
ax.scatter(df['x'], df['y'])