"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

April 06, 2017

Day #62 - Line Graph Example - Python

#Plot two line graphs
import matplotlib.pyplot as plt
x = [5,10,15,20,25,30]
samy1 = [5221.72,5296.28,5110.63,5560.02,4996.37,6552.03]
damy2 = [5169.35,5114.42,5081.98,5158.42,5107.2,5162.72]
#Range for X Axis
plt.xlim(0.5,40)
#Range for Y Axis
plt.ylim(4500,7500)
#Plot Line 1
plt.plot(x,samy1, color='red',label='SAM Execution Time', linewidth=2)
#Plot Line 2
plt.plot(x,damy2, color='black',label='DAM Execution Time', linewidth=2)
#Background Colot change
plt.rcParams['axes.facecolor'] = 'lightslategray'
plt.legend(loc='best')
#Labels
plt.xlabel('M Threads', fontsize=24)
plt.ylabel('Time Seconds', fontsize=24)
#Title
plt.title('Time vs Number of Threads', fontsize=24)
plt.show()
view raw PlotExample.py hosted with ❤ by GitHub
Happy Learning!!!

No comments: