Learn practical skills, build real-world projects, and advance your career
import matplotlib.pyplot as plt
import seaborn as sns
years=range(2015,2021)
yields_apples=[0.895,0.91,0.919,0.926,0.929,0.931]
yields_mango=[0.9,0.89,0.83,0.80,0.74,0.677]
plt.plot(years, yields_apples,marker='2')
plt.plot(years,yields_mango,marker='*')
plt.xlabel("year")
plt.ylabel("tons per hactare")
plt.title('crop yields in kenya')
plt.legend(['apples','oranges']);
Notebook Image
plt.figure(figsize=(12,6))
<Figure size 72x432 with 0 Axes>
<Figure size 72x432 with 0 Axes>
plt.plot(years, yields_apples,"o--r")
plt.plot(years,yields_mango,'*-r')
plt.xlabel("years")
plt.ylabel('yields in tonnes')
plt.title('yield in kanto')
plt.legend(['apples', 'mango'])
<matplotlib.legend.Legend at 0x20e2c437df0>
Notebook Image