-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflowplot.py
More file actions
60 lines (41 loc) · 1.1 KB
/
flowplot.py
File metadata and controls
60 lines (41 loc) · 1.1 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 13 11:38:25 2020
@author: Andrew
"""
import matplotlib.pyplot as plt
import pandas as pd
dataFrame = pd.read_csv("out_0_ms.csv")
position = dataFrame['X']
flowrate = dataFrame['Q']
area = dataFrame['A']
fig, [ax1, ax2] = plt.subplots(2, 1)
ax1.plot(position, flowrate, label='t = 0s')
ax2.plot(position, area)
dataFrame = pd.read_csv("out_709_ms.csv")
position = dataFrame['X']
flowrate = dataFrame['Q']
area = dataFrame['A']
ax1.plot(position, flowrate, label='t = 0.7s')
ax2.plot(position, area)
dataFrame = pd.read_csv("out_1410_ms.csv")
position = dataFrame['X']
flowrate = dataFrame['Q']
area = dataFrame['A']
ax1.plot(position, flowrate, label='t = 1.4s')
ax2.plot(position, area)
dataFrame = pd.read_csv("out_2111_ms.csv")
position = dataFrame['X']
flowrate = dataFrame['Q']
area = dataFrame['A']
ax1.plot(position, flowrate, label='t = 2.1s')
ax2.plot(position, area)
ax2.set_xlabel("x")
ax1.set_ylabel("Q")
ax2.set_ylabel("A")
ax1.legend(loc='upper left')
#ax1.set_xlim(0, 20)
#ax1.set_ylim(1, 3)
#ax2.set_xlim(0, 20)
#ax2.set_ylim(0, 3)
plt.show()