Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Cách thay đổi độ dày đường và kích thước marker riêng biệt trong factorplot Seaborn


Trong sns.factorplot() (nay là catplot), dùng tham số scale để thay đổi kích thước marker, linewidth trong plt.plot không ảnh hưởng trực tiếp. Ví dụ dùng dataset exercise.

Ví dụ minh họa

import seaborn as sns
from matplotlib import pyplot as plt

plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True

exercise = sns.load_dataset("exercise")
g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise, ci=95,
                   markers=['o', '*', 'd'],
                   scale=1, height=7.0)
plt.show()

Kết quả đầu ra

Cách thay đổi độ dày đường và kích thước marker riêng biệt trong factorplot Seaborn