I am writing a function to display a graph with multiple lines. Each line represents a column in my numpy array. My x-axis is the variable year and my y-axis is my np.array. I am struggling to find the right place to insert the nested list coorectly in the code to show the line of each field on the graph depending of the year
year = [2000,2001,2002,2003]
notes = [[10,11,11,14],[11,14,15,16],[15,14,12,11],[14,11,10,14]]
legend = {'maths':1, 'philosophy': 2, 'english': 3, 'biology': 4}
def PlotData (data,legend):
for i in data:
plt.plot(i,color = 'red' , marker = '.',
markersize = 10, linestyle = 'solid')
plt.legend(legend,loc ='upper left')
plt.title('Final Examination')
plt.xlabel('Year')
plt.ylabel('Marks')
plt.show()
PlotData((year,notes), legend)
