I have a dataframe and I'm using seaborn pairplot
to plot one target column vs the rest of the columns.
Code is below,
import seaborn as sns
import matplotlib.pyplot as plt
tgt_var = 'AB'
var_lst = ['A','GH','DL','GT','MS']
pp = sns.pairplot(data=df,
y_vars=[tgt_var],
x_vars=var_lst)
pp.fig.set_figheight(6)
pp.fig.set_figwidth(20)
The var_lst
is not a static list, I just provided an example.
What I need is to plot tgt_var
on Y axis and each var_lst
on x axis.
I'm able to do this with above code, but I also want to use log scale on X axis only if the var_lst
item is 'GH' or 'MS', for the rest normal scale. Is there any way to achieve this?