Matplotlib တွင် မျဉ်းအထူကို ချိန်ညှိနည်း


အောက်ပါအထားအသိုကိုအသုံးပြုသည့် linewidth argument လုပ်ဆောင်ချက်ကို အသုံးပြု၍ Matplotlib ကွက်များရှိ မျဉ်းများ၏အထူကို အလွယ်တကူ ချိန်ညှိနိုင်သည်-

matplotlib.pyplot.plot(x၊ y၊ linewidth=1.5)

ပုံမှန်အားဖြင့်၊ လိုင်းအကျယ်သည် 1.5 ဖြစ်သော်လည်း ၎င်းကို 0 ထက်ကြီးသော မည်သည့်တန်ဖိုးသို့မဆို ချိန်ညှိနိုင်သည်။

ဤသင်ခန်းစာသည် ဤလုပ်ဆောင်ချက်ကို လက်တွေ့အသုံးပြုခြင်း၏ ဥပမာများစွာကို ပေးပါသည်။

ဥပမာ 1- လိုင်းတစ်ခု၏အထူကို ချိန်ညှိပါ။

အောက်ဖော်ပြပါ ကုဒ်သည် ရိုးရှင်းသော လိုင်းကားချပ်ကို ဖန်တီးနည်းကို ပြသပြီး လိုင်းအကျယ်ကို 3 ဟု သတ်မှတ်သည်-

 import matplotlib. pyplot as plt
import numpy as np

#define x and y values
x = np. linspace (0, 10, 100)
y1 = np. sin (x)*np. exp (-x/3)

#create line plot with line width set to 3
plt. plot (x, y1, linewidth= 3 )

#displayplot
plt. show ()

matplotlib တွင် မျဉ်းအကျယ်ကို ချိန်ညှိပါ။

ဥပမာ 2- လိုင်းများစွာ၏ အထူကို ချိန်ညှိပါ။

အောက်ပါကုဒ်သည် မျဉ်းများစွာ၏ အထူကို တစ်ကြိမ်တည်း ချိန်ညှိနည်းကို ပြသည်-

 import matplotlib. pyplot as plt
import numpy as np

#define x and y values
x = np. linspace (0, 10, 100)
y1 = np. sin (x)*np. exp (-x/3)
y2 = np. cos (x)*np. exp (-x/5)

#create line plot with multiple lines
plt. plot (x, y1, linewidth= 3 )
plt. plot (x, y2, linewidth= 1 )

#displayplot
plt. show () 

Python ရှိ matplotlib တွင် မျဉ်းအလေးများစွာကို ချိန်ညှိပါ။

ဥပမာ 3- စာတန်းများတွင် စာတန်းများ၏ အထူကို ချိန်ညှိပါ။

အောက်ပါ ကုဒ်သည် မတူညီသော အထူများဖြင့် မျဉ်းများစွာကို ဖန်တီးနည်းကို ပြသပြီး လိုင်းတစ်ခုစီ၏ အထူကို ဖော်ပြသည့် ဒဏ္ဍာရီတစ်ခုကို ဖန်တီးသည်-

 import matplotlib. pyplot as plt
import numpy as np

#define x and y values
x = np. linspace (0, 10, 100)
y1 = np. sin (x)*np. exp (-x/3)
y2 = np. cos (x)*np. exp (-x/5)

#create line plot with multiple lines
plt. plot (x,y1,linewidth=3,label=' y1 ')
plt. plot (x, y2, linewidth=1, label=' y2 ')

#add legend
plt. legend ()

#displayplot
plt. show () 

matplotlib ဒဏ္ဍာရီတွင် မျဉ်းအကျယ်ကို ချိန်ညှိပါ။

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

Matplotlib ရှိ မျဉ်းကြောင်းများကြား ဧရိယာများ ဖြည့်နည်း
Matplotlib ကွက်များမှ tick များကိုမည်သို့ဖယ်ရှားနည်း
Matplotlib ဇာတ်ကွက်၏ အပြင်ဘက်တွင် ဒဏ္ဍာရီကို မည်သို့ထားမည်နည်း။

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

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