# -*- coding: utf-8 -*-
"""
Created on 09 20 09:18:10 2018
@author [email protected]
"""
import matplotlib.pyplot as plt
import numpy as np
dN=[]
dE=[]
dU=[]
path="CUT018531.ppp" #输入的文件,PPP结果文件
with open(path, 'r') as f:
line=f.readline()
while(line):
if (line.find("dN")>0): 找到dN方向
start=line.find("dN")
# pass
dN.append(line[start+5:start+5+6]) 数字节,取后面的数字
# dN.append(line[])
if (line.find("dE")>0):
start=line.find("dE")
# pass
dE.append(line[start+5:start+5+6])
if (line.find("dU")>0):
start=line.find("dU")
# pass
dU.append(line[start+5:start+5+6])
line=f.readline()
plt.figure(1)
plt.plot(dN,"b-",label="N",linewidth=3.8) #绘图
plt.plot(dE,"r-",label="E",linewidth=3.8)
plt.plot(dU,"g-",label="U",linewidth=3.8)
font2 = {'family' : 'Times New Roman',
'weight' : 'normal',
'size' : 15,
}
plt.ylabel("/m",font2)
plt.xlabel("/hour",font2)
plt.title("picture",font2) #题目
#plt.ylim(-60,100)
plt.legend()
plt.grid("on")