matplotlib / matplotlib/mpl-altair
Categorical scatter plot
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
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:

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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the Python reproduction first to confirm that categorical color encoding raises NotImplementedError. Then inspect mplaltair._marks._handle_line() and the conversion path for point marks, using the expected scatter plot as the completion criterion; verify that categorical color, stroke, shape, and size encodings no longer fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100