I have code working exactly as I want: it plots two colored datasets, TypeA and TypeB, on three plots separated by the value Divison with a logarithmic axis for Y only.
pal = dict(TypeA="seagreen", TypeB="gray")
g = sns.FacetGrid(df, hue="Source", col='Division', palette=pal, size=5)
g.map(plt.scatter, "X_Data", "Y_LogData")
g.add_legend();
g.set(yscale="log")

How can I get a linear regression line to plot?
Matplotlib's plt.scatter does not calculate a regression line. Pass sns.regplot to g.map() instead, which calculates a regression line by default.
You can see some examples here where different plotting functions are used with FacetGrid.map() (which is g.map() in your code).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With