Fixed nonetype issue in __init__ for loop, and plotted the graph the relationship

Signed-off-by: Wu Long <wulong@comp.nus.edu.sg>