Seaborn မြေကွက်များတွင် လော့ဂရစ်သမ်စကေးကို အသုံးပြုနည်း
အဏ္ဏဝါကွက်တစ်ခုတွင် x-axis နှင့် y-axis အတွက် လော့ဂရစ်သမ်စကေးကို အသုံးပြုရန် plt.xscale() နှင့် plt.yscale() လုပ်ဆောင်ချက်များကို သင်အသုံးပြုနိုင်သည်-
import matplotlib. pyplot as plt import seaborn as sns #create scatterplot with log scale on both axes sns. scatterplot (data=df, x=' x ', y=' y ') plt. xscale ('log') plt. yscale ('log')
အောက်ဖော်ပြပါ ဥပမာသည် ဤလုပ်ဆောင်ချက်များကို လက်တွေ့အသုံးချနည်းကို ပြသထားသည်။
ဥပမာ- Seaborn ကွက်တွင် လော့ဂရစ်သမ်စကေးကို အသုံးပြုခြင်း။
ကျွန်ုပ်တို့တွင် အောက်ပါ ပန်ဒါ DataFrame ရှိသည် ဆိုပါစို့။
import pandas as pd
#createDataFrame
df = pd. DataFrame ({' x ': [2, 5, 6, 7, 9, 13, 14, 16, 18],
' y ': [200, 1700, 2300, 2500, 2800, 2900, 3400, 3900, 11000]})
#view DataFrame
print (df)
xy
0 2 200
1 5 1700
2 6 2300
3 7 2500
4 9 2800
5 13 2900
6 14 3400
7 16 3900
8 18 11000
ကျွန်ုပ်တို့သည် x-axis နှင့် y-axis နှစ်ခုလုံးတွင် linear scale ကိုအသုံးပြုသည့် scatterplot ကိုဖန်တီးရန် seaborn ရှိ scatterplot() function ကိုသုံးနိုင်သည်။
import seaborn as sns #create scatterplot with default axis scales sns. scatterplot (data=df, x=' x ', y=' y ')
y-ဝင်ရိုးအတွက် လော့ဂရစ်သမ်စကေးကို အသုံးပြုရန်၊ ကျွန်ုပ်တို့သည် အောက်ပါ syntax ကို အသုံးပြုနိုင်ပါသည်။
import matplotlib. pyplot as plt import seaborn as sns #create scatterplot with log scale on y-axis sns. scatterplot (data=df, x=' x ', y=' y ') plt. yscale ('log')
ယခု Y ဝင်ရိုးသည် လော့ဂရစ်သမ်စကေးကို အသုံးပြုနေကြောင်း သတိပြုပါ။
လိုချင်လျှင် x-axis ပေါ်တွင် logarithmic scale ကိုသုံးနိုင်သည်။
import matplotlib. pyplot as plt import seaborn as sns #create scatterplot with log scale on both axes sns. scatterplot (data=df, x=' x ', y=' y ') plt. yscale (' log ') plt. xscale (' log ')
ယခု axes နှစ်ခုလုံးသည် လော့ဂရစ်သမ်စကေးကို အသုံးပြုကြောင်း သတိပြုပါ။
သက်ဆိုင်ရာ- ဇယားကွက်များတွင် လော့ဂရစ်သမ်စကေးကို မည်သည့်အချိန်တွင် အသုံးပြုသင့်သနည်း။
ထပ်လောင်းအရင်းအမြစ်များ
အောက်ဖော်ပြပါ သင်ခန်းစာများသည် Seaborn တွင် အခြားဘုံအလုပ်များကို မည်သို့လုပ်ဆောင်ရမည်ကို ရှင်းပြသည်-
Seaborn Plots တွင် ခေါင်းစဉ်တစ်ခုထည့်နည်း
Seaborn မြေကွက်များတွင် ဝင်ရိုးတံဆိပ်များကို လှည့်နည်း
Seaborn ကွက်တွင် ဝင်ရိုးအညွှန်းများကို မည်သို့ပြောင်းရမည်နည်း။