I am trying to use both style
and hue
in my points to visualise my data using seaborn. See the below example.
import matplotlib.pyplot as plt
import seaborn as sns
df = sns.load_dataset('tips')
grid = sns.FacetGrid(data=df, row='smoker', col='day', hue='time', sharex=False, sharey=False)
grid.map_dataframe(sns.scatterplot, x='total_bill', y='tip', style='sex')
grid.add_legend()
The output is as below. I want to also be able to see the differentiation by sex in the legend. How can I achieve this? For example Blue x - male lunch, Blue * - Female lunch, Orange x - Male dinner, Orange * - Female dinner. If I can even do the same using sns.catplot
or any other method that is also fine.