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 labtabtxt file found in this module. You will need to copy and paste the data as it is into a file within trinket.iopython like we have done in the recordings and the other labs. Name the file the same as you use in the code below.
The xaxis is the Year and is the same for all attributes. All four attributes are to be graphed on the same plot and need to have these:
title
xaxis label use "Year"
yaxis 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 npgenfromtxtlabtabcsvskipheaderunpackTrue,usecolsrange
pltplotyearcpi
pltplotyearhome
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
