Meaning of 'hue" in seaborn barplot Seaborn barplot has three parameters.


  x, y, hue : names of variables in data or vector data, optional


Question

What is hue? It seems the attribute to plot but why it is called "hue" because when I googled, the result is about color?

Google

Hue - Wikipedia


  Hue is one of the main properties (called color appearance parameters) of a color, defined technically (in the CIECAM02 model)
In seaborn, the hue parameter determines which column in the data frame should be used for colour encoding. Using the official document for lmplotprovided an example for this.

import seaborn as sns; sns.set(color_codes=True)
tips = sns.load_dataset("tips")
g = sns.lmplot(x="total_bill", y="tip", data=tips)




Adding `hue="smoker" tells seaborn you want to colour the data points for smoker and non-smoker differently.

&gt;&gt;&gt; g = sns.lmplot(x="total_bill", y="tip", hue="smoker", data=tips)