Plot function

Wrote a script for the plotting function.