plot.py: calc stats