如何在FacetGrid和g.map()下将趋势线添加到每个色调

时间:2020-06-30 11:02:01

标签: python matplotlib seaborn facet-grid

我正在使用的代码:

import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
g = sns.FacetGrid(df, col="vertical", hue='channel', col_wrap=2, height=5)
plt.xscale('log')
plt.yscale('log')
g = (g.map(plt.scatter, "x", "y", edgecolor="w", alpha=0.8))

如何在所有面板中为每个通道添加趋势线?

我也可以使用其他绘图机制,只要我可以(1)为每个垂直方向设置面板(2)将x和y更改为对数比例(3)为每个色调都具有趋势线:通道

Panels chart (for each vertical) between x and y further broken down by channels (different colored dots)

0 个答案:

没有答案