import matplotlib.pyplot as plt # Sample data: (x, y) x = [1, 2, 3, 4, 5] y = [1, 4, 9, 16, 25] # Plot the data using pyplot. plt.plot(x, y, marker='x') # 'o' for markers # Add labels and title plt.xlabel("Number") plt.ylabel("Number squared") plt.title("Square (Pyplot verson)") # Display the plot plt.show() # Create a figure and axes objects explicitly fig, ax = plt.subplots() # Plot data using the ax.plot() method ax.plot(x, y, marker='o') # Set labels and title using axes methods ax.set_xlabel("Number") ax.set_ylabel("Number squared") ax.set_title("Square (OO version)") # Display the plot plt.show()