Question: Your CEO has asked you to create a data graph for an upcoming Board of Directors meeting. The data is the price of gold, the

Your CEO has asked you to create a data graph for an upcoming Board of Directors meeting. The data is the price of gold, the Consumer Price Index, the national debt, and the house cost per year.
Your task is to create a line plot in Python (like we did in class) by loading the lab6_tab_2.txt file found in this module. You will need to copy and paste the data (as it is) into a file within trinket.io/python3 like we have done in the recordings and the other labs. Name the file the same as you use in the code below.
The x-axis is the Year and is the same for all 4 attributes. All four attributes are to be graphed on the same plot and need to have these:
title
x-axis label - use "Year"
y-axis label - use "Adjusted Dollars - $"
grid
each attribute must be a different color
legend at the top
Be creative and make it look really good as if you were handing this to the CEO of your company.
Hint:
#Python code to load multiple columns with a header line and tab delimited:
import numpy as np
import matplotlib.pyplot as plt
year,count,cpi,home,gold,debt = np.genfromtxt('lab6_tab_2.csv',skip_header=1,unpack=True,usecols=range(6))
plt.plot(year,cpi)
plt.plot(year,home)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!