How to Plot csv file

csv file format:
Name Jitter Latency PacketLoss TimeStamp
Joe 34 64 0 1324244672
Joe 54 23 1 1724584472
. . . . .
. . . . .
Mark 76 86 0 122428467
Mark 64 84 0 1824264672
. . . . .
. . . . .
John 74 23 1 1524284472
John 73 86 2 1224584672

my code:
#import libraries
import pandas as pd
import matplotlib.pyplot as plt

read data from csv file

data = pd.read_csv(r’C:\Users\james\Desktop\myfile.csv’,encoding=‘utf-8’).fillna(0)

#plot column “Jitter” of first 10 values
x=data[‘Jitter’].iloc[0:10].values
#display first 10 values
print(x)

#PLot item for line graph of RED color
#Need figure item
fig=plt.figure()
ax=fig.add_subplot(111)

#Title of the Graph
ax.set_title(“Plot of Jitter for Joe”)

#X axis label
ax.set_xlabel(“Time Samples”)

#Y axis label
ax.set_ylabel(“Data”)

#Legend
ax.plot(x,c=‘r’,label=“Jitter”)
leg = ax.legend()

#display graph
plt.show()

Note: this code is already working, it can already plot the Jitter values. I learned this in online tutorial

Questions:

  1. how i can insert the “Latency” and “PacketLoss” values to my graph of different color?
  2. How to plot remaining values for different names for Mark and John?
  3. How can I use the actual Timestamp to use as my time reference?

Your help is highly appreciated. I am a novice and just following examples from online tutorials.

To answer your questions:

  1. Use the line
x=data[‘Jitter’].iloc[0:10].values

and type “Latency” or “PacketLoss” instead of “Jitter”.
Add another line of

ax.plot(x,c=‘r’,label=“Jitter”)

but now instead with the label that you’ve assigned Latency or PacketLoss to.
2. You can filter your DataFrame values by the column Name
3. The ax.plot()-method takes both an x-argument and a y-argument, and you can use the column Timestamp as your x-value.

Thanks Emil, is there a way to automatically read all the values under name (e.g. Joe, Mark, John) that i dont need to do it manually?

Like for this command that i need to specify the range:
x=data[‘Jitter’].iloc[0:10].values