# Make the matplotlib and matplotlib.pyplot modules available1import matplotlib2matplotlib.use("Agg")3import matplotlib.pyplot as plt45# Initialize x_values and y_values to be empty lists6x_values = list()7y_values = list()89done = False10# Read input from the user until they enter an empty string11while not done:12line = input('Enter an x,y pair: ')1314# Test to see if the user entered the empty string. If not15if line != '':16# Break up the current line of input at the “,” location17parts = line.split(',')18# Add the part to the left of the comma to x values19# Add the part to the right of the comma y values20x_values.append(int(parts[0]))21y_values.append(int(parts[1]))22else:23done = True2425print (x_values)26print (y_values)272829# Create a plot from the two lists of values30plt.plot(x_values, y_values, 'ro')3132# Save the plot to a file for later viewing33plt.savefig('scatter.png')3435