tweaked analysis_graph.py