Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relplot does not handle numpy-types for dimensional variables #2624

Closed
mwaskom opened this issue Jul 27, 2021 · 0 comments · Fixed by #2846
Closed

relplot does not handle numpy-types for dimensional variables #2624

mwaskom opened this issue Jul 27, 2021 · 0 comments · Fixed by #2846

Comments

@mwaskom
Copy link
Owner

mwaskom commented Jul 27, 2021

Test case:

sns.relplot(
    data=tips,
    x="total_bill",
    y=tips["tip"].to_numpy(),
    col=tips["time"].to_numpy(),
)

image

Note how it handles y= fine*, but does not create two columns (or error/warn in any useful way).

displot handles this better:

sns.displot(
    data=tips,
    x="total_bill",
    y=tips["tip"].to_numpy(),
    col=tips["time"].to_numpy(),
)

image

displot and replot solve the problem of initializing a FacetGrid from vector data differently. I do not remember if this ever worked in relplot and is a regression (quite possibly not) and, if not, whether that was a failure of implementation or the result of a decision to punt on a particularly tricky issue. If the latter, it should at least give feedback about why it is not working. It looks like this never worked.

  • the internal name used for y here, _y, shows up in the y label, which I'm also not sure that we want. Note that there is no y axis label for the displot, although the internal name for the column variable is used because FacetGrid titles include that in their title template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant