plt.bar(x_indexes - width, dev_y, width = width, color = 'k', label = 'All Devs')
bor bar plot using first x and y then proper width then color then label we have linestyle and linewidth alpha
bor bar plot using first x and y then proper width then color then label we have linestyle and linewidth alpha
shadow = True, autopct= '%1.1f%%' for percentage explode= explode, startangle=90,
slices = [120, 80, 30, 20]
labels = ['Sixty', 'Fourty', 'Extral', 'Extra2']
colors = ['blue', 'red', 'yellow', 'green']
explode = [0 , 0 , 0.1, 0]
slices = [120, 80, 30, 20]
labels = ['Sixty', 'Fourty', 'Extral', 'Extra2']
colors = ['blue', 'red', 'yellow', 'green']
explode = [0 , 0 , 0.1, 0]
ages = [18,19,21,25,26,26,30,32,38,45,55]
bins = [10,20,30,40,50,60]
median_age = 29
color = '#fc4f30'
plt.hist(ages, bins=bins, edgecolor='black', log=True, alpha = 0.5, label = 'Age Median')
plt.grid(True)
# plt.axvline(median_age, color = color, label = 'Age Median')
plt.legend()
plt.title('Ages of Respondents')
plt.tight_layout()
bins = [10,20,30,40,50,60]
median_age = 29
color = '#fc4f30'
plt.hist(ages, bins=bins, edgecolor='black', log=True, alpha = 0.5, label = 'Age Median')
plt.grid(True)
# plt.axvline(median_age, color = color, label = 'Age Median')
plt.legend()
plt.title('Ages of Respondents')
plt.tight_layout()
plt.style.use('seaborn')
x = [5,7,8,5,6,7,9,2,3,4,4,4,2,6,3,6,8,6,4,1]
y = [7,4,3,9,1,3,2,5,2,4,8,7,1,6,4,9,7,7,5,1]
colors = [7,5,9,7,5,7,2,5,3,7,1,2,8,1,9,2,5,6,7,5]
sizes = [209,486,381,255,191,315,185,228,174,538,239,394,399,153,273,293,436,501,397,539]
plt.scatter(x, y, s=sizes, c=colors, cmap = 'Greens', marker = 'o', edgecolor= 'black', linewidth = 1, alpha = 0.75)
scatter plot
x = [5,7,8,5,6,7,9,2,3,4,4,4,2,6,3,6,8,6,4,1]
y = [7,4,3,9,1,3,2,5,2,4,8,7,1,6,4,9,7,7,5,1]
colors = [7,5,9,7,5,7,2,5,3,7,1,2,8,1,9,2,5,6,7,5]
sizes = [209,486,381,255,191,315,185,228,174,538,239,394,399,153,273,293,436,501,397,539]
plt.scatter(x, y, s=sizes, c=colors, cmap = 'Greens', marker = 'o', edgecolor= 'black', linewidth = 1, alpha = 0.75)
scatter plot
a = np.array([[1,2,3,4,5,6,7],[8,9,10,11,12,13,14]])
a[1, 5]
for finding with index
a[1, 5]
for finding with index
a[0, 1:6:2] means first row start from 1 end in 6 index stepping with 2
a[:, 2] = [1, 2]
which means from all row first and second argument should be 1 , 2
which means from all row first and second argument should be 1 , 2