Anyone can help me? I want to show the value of my charts, but the value is float. This is my code now
import numpy as np
import matplotlib.pyplot as plt
avg_male = 5.659574
avg_female = 6.305389
data_dict = {'Laki-Laki':avg_male, 'Perempuan':avg_female}
courses = list(data_dict.keys())
values = list(data_dict.values())
fig = plt.figure(figsize = (5,5))
# Bar plot
plt.bar(courses, values, color ='#D3B651', width = 0.5)
plt.xlabel("Jenis Kelamin")
plt.ylabel("Waktu Online (jam)")
plt.title("Waktu Rata-rata Online Berdasarkan Jenis Kelamin")
plt.show()
Now, the output just like this
The output that i want like this