Seaborn histogram ၏အရောင်ကိုဘယ်လိုပြောင်းမလဲ။


ဘားများ၏ ဖြည့်စွက် အရောင်နှင့် အစွန်းအရောင်ကို ဟီစတိုဂရမ်တစ်ခုတွင် အသီးသီးပြောင်းလဲရန် seaborn ရှိ အရောင် နှင့် edgecolor အကြောင်းပြချက်များကို သင်အသုံးပြုနိုင်သည်-

 sns. histplot (data=df, x=' some_variable ', color=' orange ', edgecolor=' red ')

အောက်ဖော်ပြပါ ဥပမာသည် ဤငြင်းခုံချက်များကို လက်တွေ့တွင် မည်သို့အသုံးပြုရမည်ကို ပြသထားသည်။

ဥပမာ- Seaborn Histogram အရောင်များကို ပြောင်းပါ။

ကျွန်ုပ်တို့တွင် မတူညီသော ဘတ်စကတ်ဘောကစားသမား 200 မှ ရမှတ်များအကြောင်း အချက်အလက်ပါရှိသော အောက်ပါပန်ဒါ DataFrame ရှိသည်ဆိုပါစို့။

 import pandas as pd
import numpy as np

#make this example reproducible
n.p. random . seeds (1)

#createDataFrame
df = pd. DataFrame ({' team ': np. repeat (['A', 'B'], 100),
                   ' points ': np. random . normal (size=200, loc=15, scale=4)})

#view head of DataFrame
print ( df.head ())

  team points
0 A 21.497381
1 A 12.552974
2 A 12.887313
3 A 10.708126
4 A 18.461631

အမှတ်များ ကော်လံရှိ တန်ဖိုးများ ဖြန့်ဖြူးမှုကို မြင်သာစေရန် Seaborn တွင် ဟီစတိုဂရမ်တစ်ခု ဖန်တီးရန် အောက်ပါကုဒ်ကို အသုံးပြုနိုင်သည်။

 import seaborn as sns

#create histogram to visualize distribution of points
sns. histplot (data=df, x=' points ')

မူရင်းအားဖြင့်၊ Seaborn သည် အပြာရောင်ကို ဖြည့်စွက်အရောင်အဖြစ် နှင့် အနက်ရောင်ကို histogram ဘားများအတွက် ကောက်ကြောင်းအရောင်အဖြစ် အသုံးပြုသည်။

သို့သော်၊ အရောင်များ နှင့် edgecolor အကြောင်းပြချက်များကို အသုံးပြု၍ ဤအရောင်များကို ကျွန်ုပ်တို့ စိတ်ကြိုက်ပြင်ဆင်နိုင်သည်-

 import seaborn as sns

#create histogram to visualize distribution of points
sns. histplot (data=df, x=' points ', color=' orange ', edgecolor=' red ') 

စိတ်ကြိုက် marine histogram အရောင်များ

ယခုအခါ ဟစ်စတိုဂရမ်တွင် လိမ္ မော်ရောင် ဖြည့်စွက်အရောင်နှင့် အနီရောင် ကောက်ကြောင်းအရောင် ပါရှိသည်ကို သတိပြုပါ။

ပိုမိုစိတ်ကြိုက်ပြင်ဆင်ရန်အတွက် သင်သည် ဆဋ္ဌမဂဏန်းအရောင်ကုဒ်များကို အသုံးပြုနိုင်ကြောင်းကိုလည်း သတိပြုပါ။

 import seaborn as sns

#create histogram to visualize distribution of points
sns. histplot (data=df, x=' points ', color=' #DAF7A6 ', edgecolor=' #BB8FCE ') 

မှတ်ချက် – seaborn histplot() လုပ်ဆောင်ချက်အတွက် စာရွက်စာတမ်းအပြည့်အစုံကိုဤနေရာတွင် ရှာဖွေနိုင်ပါသည်။

ထပ်လောင်းအရင်းအမြစ်များ

အောက်ဖော်ပြပါ သင်ခန်းစာများသည် ပင်လယ်မွေးတွင် အခြားဘုံလုပ်ဆောင်ချက်များကို မည်သို့လုပ်ဆောင်ရမည်ကို ရှင်းပြသည်-

Seaborn barplot တွင်ဘားများ၏အရောင်သတ်မှတ်နည်း
Seaborn တွင် အုပ်စုဖွဲ့ barplot တစ်ခုကို ဖန်တီးနည်း
ပုံတစ်ပုံတည်းတွင် များစွာသော Seaborn Plots ဖန်တီးနည်း

မှတ်ချက်တစ်ခုထည့်ပါ။

သင့် email လိပ်စာကို ဖော်ပြမည် မဟုတ်ပါ။ လိုအပ်သော ကွက်လပ်များကို * ဖြင့်မှတ်သားထားသည်