Answers for "plot line chart python"

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()
Posted by: Guest on November-20-2020
1

how to plotting points on matplotlib

import matplotlib.pyplot as plt 
import numpy as np

data = np.random.rand(1024,2)
plt.scatter(data[:,0],data[:,1])
plt.show()
// Don't be
// fooled by this simplicity— plt.scatter() is a rich command.
Posted by: Guest on June-13-2020

Python Answers by Framework

Browse Popular Code Answers by Language