我在對角線位置使用帶有密度圖的pairplot,但不同組的線型是相同的。有沒有辦法為不同的組使用不同的線型?
任何幫助表示贊賞!
import seaborn as sns
import matplotlib.pyplot as plt
iris = sns.load_dataset("iris")
g = sns.pairplot(iris, kind="scatter",
hue = 'species',
diag_kind='auto',
diag_kws={'bw_adjust':.03, 'linestyle':['solid','dotted', 'dashed', 'dashdot']},
# this does not work with error: Unrecognized linestyle: ['solid', 'dotted', 'dashed', 'dashdot'], same for: {'solid','dotted', 'dashed', 'dashdot'}
#diag_kws={'bw':.03, 'linestyle':'dotted'} # this works but has identical line style for species.
)
plt.show()
- 用于更新linestyles用于色調組中的溶液中提供
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/367168.html標籤:Python matplotlib 阴谋 海生
下一篇:UnhandledPromiseRejectionWarning:ReferenceError:TextEncoder未在NextJS12中定義
