-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate color keyword argument in scatter #4675
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
Conversation
👍 |
Also removed uses of the color keyword argument in examples, replacing it with c. |
Can you add a note in api_changes? |
Done. |
Where the |
@tacaswell Then perhaps just change the warning to a different type and inform the user that it is discouraged? |
Hopefully this is something that traitlets will help identify and clean up. |
The Maybe we are looking at this the wrong way? |
If possible, I'd like to ask that you please not remove |
Does anyone want to resurrect this? I suspect its still a problem. Note that the deprecation should use our deprecation function.... |
I guess I’d repeat my request that matplotlib not act to make the API less consistent. |
I think the issue is that |
I don't believe that's the issue here. The |
Let me rephrase. The fundamental issue is that |
|
So would it be possible to make |
The behavior you describe already exists: plt.scatter([0, 1], [0, 1], c="red", color="blue") ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-31-7bf4d623a32e> in <module>()
----> 1 plt.scatter([0, 1], [0, 1], c="red", color="blue")
~/anaconda/lib/python3.6/site-packages/matplotlib/pyplot.py in scatter(x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, hold, data, **kwargs)
3468 vmin=vmin, vmax=vmax, alpha=alpha,
3469 linewidths=linewidths, verts=verts,
-> 3470 edgecolors=edgecolors, data=data, **kwargs)
3471 finally:
3472 ax._hold = washold
~/anaconda/lib/python3.6/site-packages/matplotlib/__init__.py in inner(ax, *args, **kwargs)
1853 "the Matplotlib list!)" % (label_namer, func.__name__),
1854 RuntimeWarning, stacklevel=2)
-> 1855 return func(ax, *args, **kwargs)
1856
1857 inner.__doc__ = _add_data_doc(inner.__doc__,
~/anaconda/lib/python3.6/site-packages/matplotlib/axes/_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs)
4213 facecolors = co
4214 if c is not None:
-> 4215 raise ValueError("Supply a 'c' kwarg or a 'color' kwarg"
4216 " but not both; they differ but"
4217 " their functionalities overlap.")
ValueError: Supply a 'c' kwarg or a 'color' kwarg but not both; they differ but their functionalities overlap. Although that message could probably be a bit more specific... |
Exactly. "they differ but their functionalities overlap". |
Feel free to pursue that; I will disengage from the conversation. I think that it's nice to be able to pass an RGB tuple to My only aim here has been to strongly encourage matplotlib not to remove the ability to pass a normal color specification to |
As a rule I think api changes and deprecation are not good first issues. |
OK I'm closing this because it doesn't really seem to be an urgent issue, and maybe we need to figure out library wide how to handle |
There is a comment in
Axes.scatter
stating "'color' should be deprecated in scatter, or clearly defined; since it isn't, I am giving it low priority.". It is neither defined in the documentation nor deprecated, so this adds a deprecated warning to be more explicit about it.