Matplotlib ရှိ ကွက်များသို့ ခေါင်းစဉ်များထည့်နည်း
Matplotlib ရှိ ကွက်ကွက်တစ်ခုသို့ ခေါင်းစဉ်တစ်ခုထည့်ရန် အောက်ပါအထားအသိုကိုသုံးနိုင်သည်။
plt. title (' MyTitle ')
အောက်ဖော်ပြပါ ဥပမာများသည် ဤ syntax ကို လက်တွေ့တွင် မည်သို့အသုံးပြုရမည်ကို ပြသထားသည်။
ဥပမာ 1- ဇာတ်ကွက်တွင် ခေါင်းစဉ်တစ်ခုထည့်ပါ။
အောက်ပါကုဒ်သည် Matplotlib ရှိ ကွက်ကွက်တစ်ခုသို့ ခေါင်းစဉ်တစ်ခုထည့်နည်းကို ပြသသည်-
import matplotlib. pyplot as plt #define x and y x = [1, 4, 10] y = [5, 11, 27] #create plot of x and y plt. plot (x, y) #add title plt. title (' MyTitle ')
ခေါင်းစဉ်၏ ဖောင့်အရွယ်အစားနှင့် တည်နေရာကို သတ်မှတ်ရန် fontsize နှင့် loc arguments တို့ကိုလည်း အသုံးပြုနိုင်ကြောင်း သတိပြုပါ-
plt. title (' My Title ', fontsize= 30 , loc=' left ')
ဥပမာ 2- ခေါင်းစဉ်ခွဲများထဲသို့ ခေါင်းစဉ်တစ်ခုထည့်ခြင်း။
Matplotlib တွင် တစ်ခုချင်းစီ အပိုင်းခွဲခေါင်းစဉ်များကို သတ်မှတ်ရန် set_title( ) လုပ်ဆောင်ချက်ကို အသုံးပြုနည်းကို အောက်ပါကုဒ်က ပြသသည် ။
import matplotlib. pyplot as plt #define subplots fig, ax = plt. subplots (2, 2) fig. tight_layout () #define subplot titles ax[0, 0]. set_title (' First Subplot ') ax[0, 1]. set_title (' Second Subplot ') ax[1, 0]. set_title (' Third Subplot ') ax[1, 1]. set_title (' Fourth Subplot ')
ထပ်လောင်းအရင်းအမြစ်များ
Matplotlib တွင် ကွက်ကွက်အရွယ်အစားကို မည်သို့တိုးမည်နည်း။
Matplotlib တွင် ခေါင်းစဉ်အနေအထားကို ချိန်ညှိနည်း
Matplotlib ကွက်များသို့ စာသားထည့်နည်း
Matplotlib တွင် ဝင်ရိုးအပိုင်းအခြားများ သတ်မှတ်နည်း