Add scatter plot function
Update docstrings, code style, and fix duplication