python script to plot (di)graphs