Skip to content

[Feature Request] Support different markers in same scatter plot #18040

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

Closed
jolespin opened this issue Jul 23, 2020 · 2 comments
Closed

[Feature Request] Support different markers in same scatter plot #18040

jolespin opened this issue Jul 23, 2020 · 2 comments
Labels

Comments

@jolespin
Copy link

Bug report

Bug summary

Please allow support for multiple markers in the same scatter plot

Code for reproduction

https://stackoverflow.com/questions/43528300/python-matplotlib-scatter-different-markers-in-one-scatter

# Wrapper around scikit-learn PCA
pca_degs = sy.ordination.PrincipalComponentAnalysis(df_clr.loc[:,idx_deg])
# Array of markers
markers = df_meta["temperature"].map(lambda x: {"26C":"o", "30C":"^"}[x])[pca_degs.data.index]
# Wrapper around matplotlib `scatter`
pca_degs.plot(marker=markers.tolist())

Actual outcome

ValueError: Unrecognized marker style ['^', '^', 'o', '^', '^', 'o', '^', '^', 'o', 'o', 'o', 'o', 'o', 'o', 'o', nan, 'o', 'o', '^', '^', 'o']

Expected outcome

Plot multiple markers instead of running a for-loop and creating one per marker style

Matplotlib version

  • Operating system: OSX

  • Matplotlib version: 3.2.1

  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline

  • Python version: 3.8.2

  • Jupyter version (if applicable):

  • Other libraries:

@timhoffm
Copy link
Member

timhoffm commented Jul 23, 2020

Thanks for the proposal The use case feels a bit unusual, but at first sight it doesn't look completely off.

From a practical point of view, there are some things to consider:

Overall, I'm -0.5 on adding this feature because the integration will have rough edge cases.

@jklymak
Copy link
Member

jklymak commented Jul 23, 2020

I believe this is a duplicate of #11155, so perhaps transpose the discussion there? I'll close this one, but feel free to reopen if I've misunderstood...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants