python chart code example
Example 1: python line chart
import matplotlib.pyplot as plt
Year = [1920,1930,1940,1950,1960,1970,1980,1990,2000,2010]
Unemployment_Rate = [9.8,12,8,7.2,6.9,7,6.5,6.2,5.5,6.3]
plt.plot(Year, Unemployment_Rate)
plt.title('Unemployment Rate Vs Year')
plt.xlabel('Year')
plt.ylabel('Unemployment Rate')
plt.show()
Example 2: bar chart in python
import numpy as npimport matplotlib.pyplot as plt
Example 3: bar chart in python
import matplotlib.pyplot as plt; plt.rcdefaults()import numpy as npimport matplotlib.pyplot as pltobjects = ('Python', 'C++', 'Java', 'Perl', 'Scala', 'Lisp')y_pos = np.arange(len(objects))performance = [10,8,6,4,2,1]plt.bar(y_pos, performance, align='center', alpha=0.5)plt.xticks(y_pos, objects)plt.ylabel('Usage')plt.title('Programming language usage')plt.show()
Example 4: python graph
The Python Graph Gallery
Link : https://python-graph-gallery.com/all-charts/