Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Categorical scatter plot #31

Open
Open
@kdorr

Description

@kdorr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions