Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- import matplotlib.mlab as mlab
- import math
- import pandas as pd
- from pylab import *
- import csv
- def N(y):
- BF = np.zeros(len(y))
- i=0
- q=0
- while i < len(y):
- BF[i] = math.exp((-y[i])/(k*t))*n
- q = q + BF[i]/n
- i = i+1
- return BF/q, q
- def BF(i):
- i=0
- while i< len(y0+1):
- i=i+1
- print BF[i]
- def make_plot(y_list):
- fig = plt.figure()
- for i in range(0,3):
- for j in range(0,3):
- y = y_list[j*3+i]
- BF,q = N(y)
- ax = fig.add_subplot(3,3,j*3+i+1)
- Phi = np.arange(-180,+166, 15)
- ax.plot(Phi, y, 'o-r', lw=2)
- ax.set_xlim([-180,166])
- #ax.set_xlabel('\'Torsion angle')
- # Make the y-axis label and tick labels match the line color.
- #ax.set_ylabel('Energy kcal/mol', color='r')
- for tl in ax.get_yticklabels():
- tl.set_color('r')
- ax0b = ax.twinx()
- ax0b.plot(Phi, BF, 'sb-')
- plt.fill_between(Phi,BF,0,alpha='0.25')
- ax0b.set_xlim([-180,166])
- #ax0b.set_ylabel('Pop%', color='b')
- for tl in ax0b.get_yticklabels():
- tl.set_color('b')
- plt.show()
- #Variables and Boltzmann Constant:
- k=0.00199
- t=298.15
- n=100.0
- #************************************--------------****************************
- #.............................((((Creating Figures)))).........................
- #************************************--------------****************************
- afile = open('~/Desktop/GSK_Rel_Energ.csv', 'r+')
- y=[]
- for line in afile:
- Temp= line.strip().split(",")
- numbers = []
- for num in Temp:
- num = num.replace("[", "").replace("]", "")
- numbers.append(float(num))
- y.append(numbers)
- ilist = range(0,9)
- figure(1, figsize=(3, 3))
- title('Figures(0-8)', bbox={'facecolor': '0.8', 'pad': 5})
- make_plot([y[i] for i in ilist])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement