I am Building a GUI by Python and want to plot the the daily bonus of employees depends on the user plotting target:
Bob=[100,30,50,90]
Sammy=[10,60,90,200]
Tom=[70,90,90,90]
# input from GUI User is Tom
ploting_target='Tom'
if ploting_target=='Tom':`
plt.plot([0,1,2,3], Tom)
elif ploting_target=='Sammy':
plt.plot([0,1,2,3], Sammy)
plt.plot([0,1,2,3], Tom)
____________________________________________
#expecting
#find_target=list_of_employee.index(ploting_target)
#plt(plot([0,1,2,3], list_of_employee[find_target])



plotting_dict = dict(Bob=[100,30,50,90], Sammy=[10,60,90,200],Tom=[70,90,90,90])andplt.plot([0,1,2,3], plotting_dict[ploting_target])plt.plot(Bob, 'g', Sammy, 'r', Tom, 'b'). And the other duplicate has the pandas approach:pd.DataFrame([Bob, Sammy, Tom]).T.plot()