Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: UTF-8 -*-
- import numpy as np
- import matplotlib as mpl
- import matplotlib.pyplot as plt
- from numpy import *
- import sys
- from scipy.interpolate import spline
- plt.clf()
- #I1
- ffile = sys.argv[1]
- data = genfromtxt(ffile, unpack=True)
- frequency = data[0][:]
- i1 = data[1][:]
- #D
- ffile = sys.argv[2]
- data = genfromtxt(ffile, unpack=True)
- D = data[1][:]
- X = frequency
- Y_01 = i1
- Y_02 = D
- mpl.rcParams['figure.figsize'] = (8.0, 6.0)
- line_i1, = plt.plot(X, Y_01, 'r-', label ='Arctic Oscillation')
- #line_D = plt.plot(X, Y_02, 'b-', label = 'Indicator of rotation (D)')
- plt.title(u'Spectral density of Arctic Oscillation (1950-2012)')
- plt.legend(loc = 'best')
- ax_01 = plt.axes()
- ax_01.grid(color = 'black')
- ax_01.set_xlabel(r'$\omega$', size=25)
- ax_01.set_ylabel(u'')
- if max(D)>max(i1):
- maxY = max(D)
- else:
- maxY = max(i1)
- if min(D)<min(i1):
- minY = min(D)
- else:
- minY = min(i1)
- plt.axis((min(X)-0.003, max(X), minY, maxY))
- plt.annotate('~30 years', xy=(3.142221E-04,20.665250), xytext=(0.015,18),
- arrowprops=dict(facecolor='black', shrink=0.05))
- plt.savefig('I1_mod.png', dpi=300, format = 'png')
- #print 'Correlation (magnitude,i1): %2.1f' % (corrcoef(mod, i1)[0,1])
Advertisement
Add Comment
Please, Sign In to add comment