Labels၊ Scales၊ Legends နှင့် Color
3.11.2
Chart ပေါ်က unit၊ series နဲ့ ကိန်းဂဏန်းအပိုင်းအခြားကို နားလည်လွယ်အောင် ပြင်ပါ။
ဒီစာမျက်နှာမှာ
Series တစ်ခုစီကို အမည်ပေးခြင်း
ဘာနှိုင်းယှဉ်လဲကို title မှာ၊ တိုင်းတာတဲ့အရာနဲ့ unit ကို axis label မှာ ထည့်ပါ။ Series တွေကို ဖတ်လွယ်တဲ့ label ပေးပြီး ဆွဲပြီးမှ legend ခေါ်ပါ။ အရောင်နဲ့ပဲ ခွဲရခက်ရင် marker သို့မဟုတ် line style ထည့်ပါ။
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([3, 5, 4], marker="o", label="Coffee")
ax.plot([2, 2, 4], marker="s", linestyle="--", label="Tea")
ax.set(title="Daily orders", xlabel="Day index", ylabel="Orders")
ax.legend()
plt.show()
ပုံဖိုင် ဒေါင်းလုဒ်လုပ်ရန်
Scale နှင့် Color Map ရွေးခြင်း
အချိုးက အရေးပါပြီး တန်ဖိုးတွေ အပေါင်းဖြစ်ရင် log scale သုံးနိုင်ပါတယ်။ သုညနဲ့ အနုတ်ကို ပုံမှန် log axis မှာ ပြလို့မရပါ။ အစဉ်ရှိတဲ့ intensity အတွက် sequential color၊ အရေးပါတဲ့ အလယ်တန်ဖိုးတစ်ခုရဲ့ ဘက်နှစ်ဘက်မှာ ကွာတာကို ပြဖို့ diverging color map သုံးပါ။