## This file is used to generate 2 plots of the word index vs the occurences and requires 'occ.csv' to be generated
## occ.csv can be generated by executing getwordocc.py.

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

df = pd.read_csv('occ.csv')
df = df[::-1].reset_index()

df.columns = ["index", "word", "occ"]
df["index"] = df["index"].values[::-1]
plt.scatter(df["index"], df["occ"], s=2)
plt.yscale("log")
plt.axvline(3000, color='r', linestyle='dotted', linewidth=3)
plt.axvline(26000, color='green', linestyle='dotted', linewidth=3)
plt.ylabel("amount of occurrences")
plt.xlabel("word index")
plt.savefig("wordindex.png")
plt.show()

plt.scatter(df["index"], df["occ"], s=2)

plt.ylabel("amount of occurrences")
plt.xlabel("word index")
plt.xlim([3000,10000])
plt.ylim([0,300])
plt.axvline(4000, color='r', linestyle='dotted', linewidth=3)
plt.axvline(6000, color='r', linestyle='dotted', linewidth=3)
plt.axvline(5400, color='green', linestyle='dotted', linewidth=3)
plt.savefig("wordindexLimited.png")
plt.show()