barplot แสดงความสัมพันธ์ categorical vs continuous point plot คล้าย bar plot แต่แสดงจุดประมาณค่า categorical data visualize ด้วย categorical scatter plots หรือ factorplot factorplot วาด categorical plot บน FacetGrid ด้วย parameter 'kind'
FacetGrid คือเมทริกซ์ของแผ่นพล็อต แบ่งตามตัวแปร ทำให้กราฟเดียวดูเหมือนหลายกราฟ ใช้วิเคราะห์ combination ของสอง discrete variables
ตัวอย่าง
import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
my_df = sb.load_dataset('exercise')
sb.factorplot(x="time", y="pulse", hue="kind", kind='violin', col="diet", data=my_df)
plt.show()
ผลลัพธ์

คำอธิบาย
- นำเข้าแพ็กเกจ
- โหลดข้อมูล 'exercise' จาก seaborn
- เก็บใน DataFrame
- ใช้ 'factorplot' kind='violin' บน FacetGrid
- ระบุ hue, col, x, y, data
- แสดงผล
FacetGrid แยกกราฟตาม col="diet" แสดงการกระจาย pulse ตาม time และ kind