Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (37 sloc) 1.11 KB
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
tlpscatter.py -- 2018 ckunte
"""
import numpy as np
import matplotlib.pyplot as plt
tlpdata = np.loadtxt('tlp.csv', dtype='int,int,int', \
delimiter=',', usecols=(2, 3, 4), \
unpack=True, skiprows=1)
def topside_disp(topside, disp):
plt.scatter(topside, disp, c='blue', alpha=0.45)
plt.ylabel('Displacement (t)')
def topside_depth(topside, depth):
plt.scatter(topside, depth, c='red', alpha=0.45)
plt.ylabel('Water depth (m)')
def plotoptions():
plt.xlabel('Topside weght (t)')
plt.xlim(xmin=0)
plt.ylim(ymin=0)
plt.grid()
if __name__ == '__main__':
print "Options:"
print " 0: Exit"
print " 1: Plot topside v. displacement"
print " 2: Plot topside v. water depth"
ptype = input("Select option: ")
if ptype == 1:
topside_disp(tlpdata[1], tlpdata[0])
plotoptions()
plt.savefig('tlp_disp_vs_topsidewt.png')
elif ptype == 2:
topside_depth(tlpdata[1], tlpdata[2])
plotoptions()
plt.savefig('tlp_depth_vs_topsidewt.png')
else:
print "No plot options were chosen."