Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Revise scatter_masked.py#24409
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Revise scatter_masked.py#24409
Conversation
- Expand introduction, including link to NumPy documentation- Simplify plot styling to avoid distraction and overlap- Add an example using a decision boundary style- Add references admonition at the end
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping@matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
Uh oh!
There was an error while loading.Please reload this page.
subplot_kw = { | ||
'aspect': 'equal', | ||
'xlim': (0, max(x)), | ||
'ylim': (0, max(y)) | ||
} |
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.
I didn't know we could do this 😄 and I would maybe not put the comment here 'cause I think it makes it seem like this line has something to do w/ the masking specifically
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.
It's a nice clean approach if you want to create two different plots with the same axes properties, rather than calling methods to set them 🙂
Fair point, what if I moved the comment like this:
subplot_kw= {'aspect':'equal','xlim': (0,max(x)),'ylim': (0,max(y))}fig,ax=plt.subplots(subplot_kw=subplot_kw)# Plot data points using masked arrayax.scatter(x,y,s=masked_size,marker='^',c="mediumseagreen")
Built doc page for |
############################################################################### | ||
# This technique can also be used to plot a decision boundary, rather than | ||
# masking certain data points so that they don't appear at all. This example | ||
# uses the same data points and boundary as the example above, this time in the | ||
# style of a decision boundary. | ||
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.
I would tend to just be specific about what you are doing, but use general language. If you want the technical term yo think people will search on, by all means include it. Maybe something like:
############################################################################### | |
# This technique can also be used to plot a decision boundary, rather than | |
# masking certain data points so that they don't appear at all. This example | |
# uses the same data points and boundary as the example above, this time in the | |
# style of a decision boundary. | |
############################################################################### | |
# This technique can be used to plot two groups of data separated by a boundary (sometimes | |
# termed a "decision boundary"). This example uses two sets of masks to color the data on either | |
# side of the boundary differently, and adds a shape to define the boundary. |
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.
Ok gotcha, you're saying to use more general language to describe what theplotting code is doing. Not to explain theML concept in more general language. That makes sense!
Hi@hoffm386 - let us know if we can help you with this PR, thanks! |
@hoffm386 just checking in if you have the bandwidth to finish this up (it looks pretty close to done for me) or if you're cool with it being taken over and finished out? |
PR Summary
Resolves#24357
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst