""" Felix Muzny DS 2000 Lecture 4 September 16, 2024 A program to visualize someone's croissant habits (from a file!) """ import matplotlib.pyplot as plt FILENAME = "croissant_ratings_felix.txt" def main(): print("lec 4 - croissants w/ input") # step 1 - gather data with open(FILENAME, "r") as croissant_file: # readline always returns a string! rating1 = float(croissant_file.readline()) time1 = float(croissant_file.readline()) rating2 = float(croissant_file.readline()) time2 = float(croissant_file.readline()) rating3 = float(croissant_file.readline()) time3 = float(croissant_file.readline()) # let's also ask the user what color the points should be! user_color = input("what color should the points be? ") # step 2 - any computations? # none! :) # step 3 - communication - give the user information! plt.plot(rating1, time1, "o", color=user_color) plt.plot(rating2, time2, "h", color=user_color) plt.plot(rating3, time3, "*", color=user_color) plt.title("Croissant goodness vs. time willing to wait") plt.xlabel("Goodness (scale of 1 - 10)") plt.ylabel("Time (minutes)") plt.show() main()