Graphical Represantation of Data
Graphical Represantation of Data
plt.xlabel('Number of Votes')
plt.ylabel('Programming Language')
plt.savefig('favorite_languages_horizontal_bar.png')
plt.show()
QUESTION 2
ANS –
plt.xlabel('Quarter')
plt.legend()
plt.savefig('departmental_expenses_stacked_bar.png')
plt.show()
QUESTION 3
ANS –
city_a = [22, 23, 24, 21, 20, 25, 24, 23, 22, 21]
city_b = [18, 19, 20, 21, 22, 23, 24, 23, 22, 21]
city_c = [28, 27, 26, 25, 24, 23, 22, 21, 20, 19]
plt.figure(figsize=(10, 6))
plt.xlabel('Day')
plt.ylabel('Temperature (°C)')
plt.legend()
plt.savefig('temperature_trends_multi_line.png')
plt.show()
QUESTION 4
ANS –
expenses = [1200, 1500, 1100, 1300, 1600, 1400, 1700, 1800, 1600, 1500,
1700, 1900]
plt.figure(figsize=(10, 6))
plt.ylabel('Frequency')
plt.savefig('monthly_expenses_histogram.png')
plt.show()
OUTPUT –
1. output –
2. output –
3. output –
4. output-