Replies: 1 comment
-
This is not supported in I am sympathetic to the idea of wanting to mix numeric / categorical variables into one plot and to use different representations for them but I am skeptical of the value of a fully configurable "kind for each subplot" API. I'm not sure how you made the plot in your post but there are a variety of ways to leverage existing functionality to get more flexibility, e.g. def flexplot(x, y, **kwargs):
if "flipper_length_mm" in (x.name, y.name):
func = sns.kdeplot
else:
func = sns.scatterplot
func(x=x, y=y, **kwargs)
g = sns.PairGrid(penguins)
g.map_offdiag(flexplot)
g.map_diag(sns.histplot) My main objection to your proposal is that writing down that matrix of kinds is quite cumbersome, and if you're at the point where you're doing that with logic, it's only marginally harder to integrate the plotting into the logic itself. There's also a notion of scope creep; e.g. how do you generalize |
Beta Was this translation helpful? Give feedback.
-
I would like to have control over the kind of plotting function that gets called for the subplots in pairplot:
For some applications the data supplied to pairplot can be mixed continues, ordinal and/or nominal/discrete (think e.g. hyper-parameters). This means that plotting each individual variable pair would benefit from a separate choice between scatter/kde/hist, especially for the diagonal.
It seems this is currently not supported using the kind, diag_kind or {plot, diag, grid}_kws parameters.
For the example given in the pairplot api, this could look like this:
with the output:
I am not very familiar with the code base but this seems like it could be accomplished by calling the appropriate function for each subplot based on the kind/diag_kind keyword without major changes.
Edit: I did not check if this is already possible using the returned PairGrid.
Beta Was this translation helpful? Give feedback.
All reactions