-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
plot
and scatter
should allow marker
to be a list
#11155
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
Comments
I suppose that's possible. A simplified and usable version could look like this
Use it as
|
Now two options:
|
As for the options, 1. would be ok. I wouldn't want to go with 2i. Having two arguments essentially doing the same with a single object or a list of objects is not pythonic. We have dynamic typing to handle that (see 2ii). If writing from scratch, I'd have a signature |
@BenyamWorku I suppose the problem lies in the definition of
and that works as expected. |
If this feature is still on the table I worked with some teammates and we think we've implemented a good solution. The only problem is using multiple marker styles breaks the pre-existing functionality with regards to edgecolors and linewidths on unfilled markers. Since you can have both unfilled and filled markers on the same graph we can't use the face value to ignore the edgecolor and linewidth parameters. Our solution was to just use edgecolor and linewidths on unfilled markers if there are multiple marker styles and let the user specify what they should be - they can just make the edgecolor = color and linewidth = 1 for unfilled markers if they want. Any guidance on if this is the best way to handle this? |
https://chem-workflows.com/articles/2019/10/21/ramachandran-plots-on-jupyter-notebook-gerdospyrama/ |
Note: I am using |
@DanielGoldfarb given that you've implemented this formally, would it be difficult to work it into the main library? |
When working on this, I'd like to see a discussion of my concerns at #18040 (comment). |
I don't know where this stands- but supplying a list for marker style is very useful. The code above with mscatter does appear to work...though it is a black box at my level. |
@jklymak Jody, regarding #11155 (comment) ... I've learned a lot in the past 6 months, so maybe now this is something I can do. Will take a look soon and see if I can integrate it directly into matplotlib. --Daniel |
Hello, |
@zackles |
@DanielGoldfarb Thank you. So it is an expected behavior and I have to generate legend. |
@zackles
I suspect that it will vary, from plot to plot, which of the above two choices is simpler. |
Hi, |
Someone needs to propose a PR and argue (strongly) that it is actually an improvement and not going to lead to an undue maintenance burden. |
Any updates regarding this issue? this is a pretty useful feature! |
I am unaware of any updates on this.
I eventually utilized the workaround indicated on the thread (which satisfied me for the time being).
-adam
… On March 31, 2022 9:33 AM Mohamed Naas ***@***.***> wrote:
Any updates regarding this issue? this is a pretty useful feature!
—
Reply to this email directly, view it on GitHub #11155 (comment) , or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJOA7JMCN6JZWCDCCAFCTLVCXHWZANCNFSM4E54ZKDA .
You are receiving this because you were mentioned.Message ID: ***@***.***>
------------------------------------------------------------
Adam Block
***@***.*** ***@***.***
http://AdamBlockStudios.com (NEW!)
Image Galleries at : http://AdamBlockPhotos.com
Caelum videre iussit, et erectos ad sidera tollere vultus.
He bid them look at the sky and lift their faces to the stars.
--Ovid, Metamorphoses 1. 85-8
------------------------------------------------------------
|
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
This issue is currently the most "+1ed" issue of any issue ever in matplotlib. I've recently encountered a use case for our library for which this would be really beneficial, so I'm curious if we could reopen this issue and discuss how we can move this issue forward. |
Thanks for reopening the issue @rcomer! Is there anyone here that might want to work on this? Edit: I think unfilled/filled marker color handling (edge color vs fill color) and automatic legend generation are the things we need to come to a reasonable approach for first, right? |
@EwoutH I think the fundamental issue here is that scatter's two main features are mapping color and size. Both of these are continuous variables, and would be difficult for a user to replicate. Marker style, on the other hand, is limited to finite discrete marker styles. It is easy to write a for-loop to loop over the desired styles in any given visualization. Conversely, it is hard to come up with a general way of representing those markers in a legend and as @timhoffm comment says #18040 (comment), there are a lot of rough edge cases. |
Instead of a list, could we allow bins? That seems fitting for categorial variable that markers like to represent. Edit: Or just groups of points, like a dict with Edit 2: Heck, even |
@EwoutH it's not clear what you are referring to here. How would this look inside a call to scatter? |
Just throwing in my tiny comment- that for the less-than-brilliant coder- a list really is very understandable and somewhat expected given other existing methods. |
I was about to say more-or-less the same thing. I am not aware of any other places in matplotlib that accept buckets instead of a list. (Let me know if there are any). I think I understand the bucket idea, but I'm inclined to be consistent with the behavior other, similar parameters within matplotlib. If the list is too short it should be cycled. |
We could probably provide an example that constructs the list given this mapping? And I think a model for handling this in legend, is add |
IIRC, the point is that PathCollection stores the marker as a single Path and the individual representations are on-the-fly scaled and translated variants of that Path. PathCollection is not designed to support multiple markers and I suspect it will be difficult to change that. |
Feature Request
It would be great if the
plot
andscatter
functions would allow themarker
kwarg to be a list.When using
scatter
, I can set the color of individual pixels using thec
kwarg.c
can be a list/array. It would be convenient if I could also set the marker style of the individual points using a list of styles.I'm using matplotlib 2.2.2 on Python 3.6
The text was updated successfully, but these errors were encountered: