登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
path_name='C:\\Python27\\database\\'
f=open(path_name+'huizong1.txt')
data=f.readlines()
f.close()
year=[]
ENSO=[]
QBO=[]
for i in range(0,len(data)):
temp=data
year.append(temp.split()[0])
ENSO.append(float(temp.split()[1]))
QBO.append(float(temp.split()[2]))
x=ENSO
y=QBO
#colors=year
cb=plt.scatter(x,y,c='black')
plt.xlim(-3,3)
plt.ylim(-37,37)
#plt.colorbar(cb)
for i in range(0,len(data)):
plt.text(ENSO-0.15,QBO+1.2,year,fontsize=7)
plt.text(0.27,-39,'0.5STD',fontsize=7)
plt.text(-0.62,-39,'-0.5STD',fontsize=7)
plt.axvline(0.41926325,c='gray')
plt.axvline(-0.41926325,c='gray')
plt.axhline(5,c='gray')
plt.axhline(-5,c='gray')
plt.xlabel('ENSO')
plt.ylabel('QBO')
plt.show() |