make plotter.py more readable
fix referenced before init in plotter