seaborn
seaborn copied to clipboard
suggestion: color parameter for sns.pairplot
(tested with dev version)
sns.pairplot
when no hue
is present, now ignores the palette=
parameter and doesn't accept color=
(nor similar).
Example:
import seaborn as sns
iris = sns.load_dataset('iris')
sns.pairplot(iris, palette='Reds')
This uses matplotlib's default color cycle (default starting with blue) to color everything.
sns.pairplot(iris, color='green')
gives an error: TypeError: pairplot() got an unexpected keyword argument 'color'
.
It could be handy to accept such color and use it for the pairplot. Changing the matplotlib color cycle is not straightforward for casual users, and will also influence subsequent plots.
You can pass color
to the plot_kws
and diag_kws
parameter dictionaries.
sns.pairplot
when no hue is present, now ignores thepalette=
parameter
When you say "now ignores" do you mean that it did not do this in the past?
When you say "now ignores" do you mean that it did not do this in the past?
Oops. I suppose I meant "compared to using hue". It very probably never worked with color=
.
plot_kws
and diag_kws
are indeed good alternatives. Although it looks useful to also add color=
to the pairplot, it also will add an extra layer of complexity to the code, with the accompanying risks of something breaking in the future. Even adding it to the online documentation can lead to more confusion. Feel free to close the issue.
I am open to the idea on the basis that jointplot
does have a top-level color=
kwarg that gets passed to both the joint and marginal subplots. So I would likely accept a pull request adding it.