hello, I want to display a graph using data from a text file with matplotlib and I am having some problems. Data is sent and received via sockets and stored in a text file.
here is my code:
here is my code:
import matplotlib.pyplot as plt X = [] Y = [] fichier = open('orde.txt', 'r') for row in fichier: row=row.split(' ') if len(row)>0: X.append(row[0]) Y.append(row[-1]) plt.xlabel('Time' , fontsize = 12) plt.ylabel('Amplitude', fontsize = 12) plt.plot(X, Y ,color = 'red', label = 'signal') plt.title('Courbe', fontsize = 20) plt.show()
Larz60+ write Aug-12-2022, 05:24 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.