import pandas as pd import matplotlib.pyplot as plt from matplotlib import interactive # ------------------------------------------------- # CSCI 127, Lab 13 | # April 18, 2019 | # Your Name | # ------------------------------------------------- def main(file_name): graph_title = file_name[:-4] # read the file_name into a pandas dataframe dataframe = pd.read_csv(file_name) x_axis = dataframe.columns[0] y_axis = dataframe.columns[1] # plot the dataframe using arguments "title", "legend", "x", "y", "kind" and "color" dataframe.plot(title=graph_title, x=x_axis, y=y_axis, kind="bar", \ color=["blue", "gold"] * dataframe.size, legend=False) # The only four statements that may use the matplotlib library appear next. # Do not modify them. plt.xlabel(x_axis) # Note: x-axis should be determined above plt.ylabel(y_axis) # Note: y-axis should be determined above interactive(True) # This allows multiple figures to be displayed simultaneously plt.show() # ------------------------------------------------- main("MSU College Enrollments.csv") main("CS Faculty.csv")