mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added script to analyze AIMD
This commit is contained in:
parent
623385cda9
commit
aff3e56a5b
1 changed files with 27 additions and 0 deletions
27
tools/plots/plot_aimd.py
Normal file
27
tools/plots/plot_aimd.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import matplotlib as mpl
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
def read_datafile(file_name):
|
||||
# the skiprows keyword is for heading, but I don't know if trailing lines
|
||||
# can be specified
|
||||
data = np.loadtxt(file_name, delimiter='\t', skiprows=1)
|
||||
return data
|
||||
|
||||
filename = sys.argv[1]
|
||||
|
||||
data = read_datafile(filename)
|
||||
|
||||
print(data[:,0])
|
||||
|
||||
fig, ax1 = plt.subplots()
|
||||
ax1.plot(data[:,0], data[:,1])
|
||||
|
||||
ax2 = ax1.twinx()
|
||||
ax2.plot(data[:,0], data[:,2], c='red')
|
||||
|
||||
fig.tight_layout()
|
||||
plt.show()
|
Loading…
Add table
Reference in a new issue