forked from andylitalo/Spin-Coater
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot_r_splash.py
More file actions
76 lines (64 loc) · 1.96 KB
/
plot_r_splash.py
File metadata and controls
76 lines (64 loc) · 1.96 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 29 07:57:09 2017
@author: Andy
"""
import matplotlib.pyplot as plt
import cPickle as pkl
import numpy as np
import Functions as Fun
# Data parameters
dataFolder = 'Data\\'
dataFile = 'r_splash.pkl'
# Save parameters
savePlot = True
saveFolder = 'plot_r_splash\\'
saveName = 'r_splash_vs_Q'
# Disk Parameters
diskRad = 15.0 # [cm]
radiusNoisy = diskRad / 4.0
# Plot parameters
logScale = False
legend_fs = 8
xLim = [300, 3000]
yLim = [diskRad/100, diskRad/1.5]
###############################################################################
# Load data
with open(dataFolder + dataFile,'rb') as f:
rSplashData = pkl.load(f)
# Extract parameter lists
QList = rSplashData['QList']
conditionList = rSplashData['conditionList']
# Plot on one figure
fig = plt.figure()
for i in range(len(conditionList)):
condition = conditionList[i]
rSplash = rSplashData[condition] # matrix of r_crit where rows=Q and cols=RPM
rSplash2Plot = []
Q2Plot = []
# Plot one trendline per Q
for r in range(len(QList)):
if rSplash[r] != 0:
Q2Plot += [Fun.convert_flowrate(QList[r])]
rSplash2Plot += [rSplash[r]]
# Plot trendline
label = condition
plt.plot(Q2Plot, rSplash2Plot, linewidth=2, marker='o', label=label)
# Format plot
plt.xlabel('Jet Flow Rate [RPM]')
plt.ylabel('Splash Radius [cm]')
if logScale:
plt.xscale('log')
plt.yscale('log')
plt.xlim(xLim)
plt.ylim(yLim)
plt.grid()
plt.legend(loc=0, fontsize=legend_fs)
pltTitle = 'Splash Radius vs. Q, %s' %(condition)
plt.title(pltTitle)
if savePlot:
condition = condition.replace('.','-') # can't save with decimals in name
savePlotName = saveFolder + saveName + '_cond_' + condition
plt.savefig(savePlotName, bbox_inches='tight')
plt.show()
plt.close()