4.20-rasm - O'zgartirilgan chiziqli diagramma
Guruh chiziqli diagrammalar
Muayyan tarzda tayyorlangan ma'lumotlardan foydalanib, mumkin
Guruh diagrammalarini yaratish: cat_par = [f'P{i}' i diapazonidagi ( 5 )] g1 = [10, 21, 34, 12, 27] g2 = [17,
15, 25, 21, 26]
kengligi = 0,3
x = np.arange(len(kat_par))
fig, ax = plt.subplots() rects1
= ax.bar(x - width/2, g1, width, label='g1') rects2 = ax.bar(x + width/2, g2, width, label=' g2') ax.set_title(' Guruh jadvaliga misol') ax.set_xticks(x) ax.set_xticklabels(cat_par) ax.legend()
4.21-rasm — Guruh chiziqli diagrammasi
Xatolar paneli elementi bilan diagramma
Xatolar paneli elementi har biri uchun xato qiymatini belgilash imkonini beradi grafik element. Buning uchun xerr, yerr va parametrlaridan foydalaning ecolor, birinchi ikkitasi xato qiymatini, oxirgisi rangni aniqlaydi:
np.random.seed( 123 ) rnd = np.random.randint
cat_par = [f'P{i}' i diapazondagi (5)] g1 = [10, 21, 34, 12, 27] xato = np.
massiv([[rnd(2,7),rnd(2,7)] uchun _ diapazonda (len(kat_par))]).T
fig, axs = plt.subplots(1, 2, figsize=(10, 5)) axs[0].bar(cat_par, g1, yerr=5, ecolor='r', alfa=0,5, edgecolor='b' , chiziq kengligi=2)
axs[1].bar(cat_par, g1, yerr=xato, ecolor='r', alfa=0,5, edgecolor='b', linewidth=2)
4.22-rasm — Xatolar paneli elementi bilan ustunli diagramma
Dostları ilə paylaş: |