Line Chart using matplotlib
Visualization help us to understand data in better way. This is specially important when we have lot of data say million or billions of records. Just looking at data we might not get the relationship or inside trend of data.
Today, we are going to learn about line chart using matplotlib library.
from matplotlib import pyplot as plt
years = [2009, 2011, 2012, 2012.5, 2013, 2013.5, 2014, 2014.5, 2015, 2015.5, 2016]
scores = [76.6, 80, 88, 88, 87, 88, 87, 87, 85, 87, 86]
plt.plot(years, scores, color='blue', marker='X', linestyle='dashdot')
plt.title("Performance")
plt.ylabel("Score %")
plt.show()
- Trends : If we wanted to show trend like search engine preferred by people over time or stock time change over time.
Comments
Post a Comment