Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
import sys
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['text.usetex'] = True
f = open( sys.argv[1], 'r' )
data_lst = []
size = 0
for line in f:
line = line.strip()
a = line.split()
aux = []
for num in a:
aux.append( float( num ) )
data_lst.append( aux )
arrays = []
for a in data_lst:
arrays.append( np.array( a ) )
#x = arrays[ 0 ]
#arrays.remove( 0 )
n = len( arrays )
print( n )
fig, ax = plt.subplots( 1, n-1, figsize=(15, 3), sharey=True )
#fig, ax = plt.subplots( 1, n-1, sharey=True )
idx = 0
for array in arrays:
if idx > 0:
ax[ idx - 1 ].plot(arrays[0], array, linewidth=2.0)
ax[ idx - 1 ].set_xlabel( "t" )
ax[ idx - 1 ].set_ylabel( "u(t)" )
# ax[ idx - 1 ].axis('equal')
idx = idx + 1
plt.savefig( sys.argv[2] )
plt.close(fig)