-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Add 'color' and 'size' to arguments #44856
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
Changes from 20 commits
2f54813
3feaabc
68f2551
390fc86
865b7ac
1f30d45
543c64e
d1fd7bc
eda1fbc
1caf4dc
021aadd
5e94951
05a26c8
f7b833c
f99424e
abf377e
33c1ca5
f131fe4
e6ac538
c9d6043
757f292
53503ce
73e3fb1
e17db52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1615,6 +1615,11 @@ def scatter(self, x, y, s=None, c=None, **kwargs): | |
|
||
.. versionchanged:: 1.1.0 | ||
|
||
size : str, int or array-like, optional | ||
The color of each point. Alias for `s`. | ||
`s` and `size` aren't allowed at the same time. | ||
.. versionadded:: 1.4.1 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @attack68 thoughts on how this should be documented? In the original issue ( #44670 (comment) ) I'd suggested to just silently accept Don't know what's best though, I think aliases are quite rare in pandas There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would maybe just add a one-liner to the already documented " I don't think two parameter entries are sensible becuase this is really one parameter, it just happens to be coordinated under two differnet names. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah sounds good There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add this to my changes. |
||
c : str, int or array-like, optional | ||
The color of each point. Possible values are: | ||
|
||
|
@@ -1629,6 +1634,11 @@ def scatter(self, x, y, s=None, c=None, **kwargs): | |
- A column name or position whose values will be used to color the | ||
marker points according to a colormap. | ||
|
||
color : str, int or array-like, optional | ||
The color of each point. Alias for `c`. | ||
`c` and `color` aren't allowed at the same time. | ||
.. versionadded:: 1.4.1 | ||
|
||
**kwargs | ||
Keyword arguments to pass on to :meth:`DataFrame.plot`. | ||
|
||
|
@@ -1666,7 +1676,19 @@ def scatter(self, x, y, s=None, c=None, **kwargs): | |
... c='species', | ||
... colormap='viridis') | ||
""" | ||
return self(kind="scatter", x=x, y=y, s=s, c=c, **kwargs) | ||
size = kwargs.pop("size", None) | ||
if s is not None and size is not None: | ||
raise TypeError("Specify exactly one of `s` and `size`") | ||
MarcoGorelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
elif s is not None or size is not None: | ||
kwargs["s"] = s if s is not None else size | ||
|
||
color = kwargs.pop("color", None) | ||
if c is not None and color is not None: | ||
raise TypeError("Specify exactly one of `c` and `color`") | ||
elif c is not None or color is not None: | ||
kwargs["c"] = c if c is not None else color | ||
|
||
return self(kind="scatter", x=x, y=y, **kwargs) | ||
|
||
def hexbin(self, x, y, C=None, reduce_C_function=None, gridsize=None, **kwargs): | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.5.0