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

Categorical scatter plot #31

Open
kdorr opened this issue Aug 16, 2018 · 0 comments
Open

Categorical scatter plot #31

kdorr opened this issue Aug 16, 2018 · 0 comments

Comments

@kdorr
Copy link
Collaborator

kdorr commented Aug 16, 2018

mpl-altair currently doesn't convert Altair charts that have categorical color, stroke, shape, or size encodings.

Code for reproduction

df = pd.DataFrame({
    'a': [1, 2, 3, 4], 'b': [7, 6, 5, 4], 'c': ['a', 'b', 'b', 'c']
})

chart = alt.Chart(df).mark_point().encode(
    alt.X('a'), alt.Y('b'), alt.Color('c:N')
)
mplaltair.convert(chart)

Actual outcome

A NotImplementedError is raised.

Expected outcome

Something that looks kind of like this:

scatter_altair

Possible solutions

  • Fix this on the Matplotlib side of things
  • Incorporate a workaround similar to how mplaltair._marks._handle_line() deals with colors in line plots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant