Update graph.py

changed a line because it would have generated bugs, uses a variable that is not in the function