Modulize the plot functions in python.