-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow color to also be an iterable #25
Comments
Interesting idea. I don't think I've ever had to make each point in a plot a different color (without also needing labels for each, at which point you need to make each point a separate plotting call anyway). What's your use case? |
This is not my actual use case, but it's a simplified one: I am plotting the hourly weather temperature. If it's getting hotter, I want to use red. If it's getting colder, I want to use blue. For now I would be okay with the label functionality remaining unchanged as |
Another use case is: I am plotting the hourly weather temperature. If however it's getting more humid, I use red. If it's getting less humid, I use green. If the humidity is the same, I use yellow. To restate, I am however plotting the temperature values. |
That sounds pretty unique. If more people express interest in such a convenience feature, I will look into it. For now, you should be able to make what you want by plotting each color as a separate call with something like this:
Doing it for a line plot is similar: define the color for each line segment (two subsequent temperature values) and plot each segment separately in a for loop. |
Currently,
color
has to beOptional[str]
. I request that an iterable also be allowed for it, with the same length asx
andy
. This is intended to conveniently allow piecewise coloring. For example, I may want to sometimes specifycolor=['green', 'green', 'red', 'yellow']
, etc.The text was updated successfully, but these errors were encountered: