from matplotlib import pyplot def simple_plot(): """plotting of a line""" x = [1, 2, 3, 4, 5] y = [2, 4, 6, 8, 10] pyplot.plot(x, y) pyplot.show() def multiple_plot(): """plotting of multiple lines""" x = [1, 2, 3, 4, 5] y1 = [1, 2, 3, 4, 5] y2 = [2, 4, 6, 8, 10] pyplot.plot(x, y1, x, y2) # could also have been written: # pyplot.plot(x, y1) # pyplot.plot(x, y2) pyplot.show() def fancy_multiple_plot(): """plotting of multiple lines with different attributes""" x = [1, 2, 3, 4, 5] y1 = [1, 2, 3, 4, 5] y2 = [2, 4, 6, 8, 10] pyplot.plot(x, y1, "ro") pyplot.plot(x, y2, "b+-") # could also have been written: # pyplot.plot(x, y1, "ro", x, y2, "b+-") pyplot.show()