In [ ]:
import numpy as np
import pandas as pd
import re

%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt

In [ ]:
filepath = '/home/mjliu/Documents/Models/Naphthalene/acetylene/run7/n_a_run7.csv'
data = pd.read_csv(filepath)

In [ ]:
columns = []
labels = []
for column in data.columns[7:17]:
    columns.append(column)
    labels.append(re.sub('Mole_fraction_', '', column)[0:-3])

In [ ]:
labels

In [ ]:
newlabels = [
    'Tetralin',
    'Acetylene',
    'H2',
    'Ethene',
    'Methyl indene',
    'Toluene',
    'Indene',
    'Methane',
    'Naphthalene',
    'Benzofulvene',
]

In [ ]:
newlabels = [
    'Naphthalene',
    'Acetylene',
    'Benzene',
    'Acenaphthylene',
    'H2',
    'Ethene',
    'Benzofulvene',
    '2-Ethenyl naphthalene',
    '2-Ethynyl naphthalene',
    '7-Methylene norbornane'
]

In [ ]:
plt.style.use('seaborn-poster')
#plt.rcParams['axes.labelsize'] = 24
#plt.rcParams['xtick.labelsize'] = 20
#plt.rcParams['ytick.labelsize'] = 20

fig = plt.figure()

colormap = mpl.cm.tab10

for i, column in enumerate(columns):
    x = data['Time (sec)']
    y = data[column]
    y = [value if value > 1e-8 else np.nan for value in y]
    plt.plot(x, y, c=colormap(i), label=newlabels[i])

plt.xlabel('Time (s)')
plt.ylabel('Mole Fraction')
plt.legend(bbox_to_anchor=(1.02, 1), loc=2, borderaxespad=0.)

In [ ]: