Make markerfacecolor work for 3d scatterplots #10693
Conversation
|
One thing I noticed is that, the edge_color will never equal to "face" in 3D, this fix also introduces a workaround for it, I am not sure whether this is desired behaviour . |
| self.stale = True | ||
|
|
||
| def set_facecolor(self, colors): | ||
| # override setter for facecolor so that 3dfacecolor |
There was a problem hiding this comment.
Please use triple-quote docstrings instead of comments for documenting functions. This is the standard pep8 style we're aiming for (even if historically there are other styles in the code base).
| # In providing consitentcy in 2dcolor and 3dcolor setter. | ||
| # Note: will also update edgecolor if it follows facecolor | ||
|
|
||
| PathCollection.set_facecolor(self, colors) |
There was a problem hiding this comment.
Since this will by py3 only, use super().
| self._edgecolor3d = PathCollection.get_edgecolor(self) | ||
| set_edgecolors = set_edgecolor | ||
|
|
||
| def _set_facecolors_on_project(self, colors): |
There was a problem hiding this comment.
what is project? Should this rather be _set_facecolors_on_projection or _set_facecolors_on_2d_projection?
| set_edgecolors = set_edgecolor | ||
|
|
||
| def _set_facecolors_on_project(self, colors): | ||
| # A sepearted method that changes edgecolor in drawing |
| self._facecolor3d) | ||
| fcs = mcolors.to_rgba_array(fcs, self._alpha) | ||
| self.set_facecolors(fcs) | ||
| # now uses setter on project |
There was a problem hiding this comment.
The comment does not add information and thus can be left out.
|
Milestoning 3.0 because this isn't fixing a regression. |
|
Thanks a lot for your contribution. However, this conflicts with an existing PR: #10489 I'm going to close this PR to reduce confusion. If you want to help, you can make comments on #10489. (Also if you want to see if someone else has made a PR based on an issue, its usually cross-linked at the bottom of the issue.) |
PR Summary
This pull request is a fix for issue 9725 color issue on 3D scatter plots. Invoking the set color method after the initial creation of a scatter 3D plot would not change the color; these changes fix this issue.
PR Checklist