-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add an example for scatter plots with auto legends #607
Conversation
88ea640
to
f9143ee
Compare
f9143ee
to
acd5806
Compare
It's a good example for me. It's modified from the matplotlib example, so users can have a direct comparison between pygmt and matplotlib.
Yes to me. I expect we would have many examples for symbols (different symbol styles, sizes, colors et al.). It's better to group the "symbols" examples together. |
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.
Is it a good example?
It's a good example for me. It's modified from the matplotlib example, so users can have a direct comparison between pygmt and matplotlib.
Fair enough. I think our problem now is that there are too few examples, so the more we have the better! Showcasing the transparency in this example is also good!
Should we have a separate directory/category for "symbols"?
Yes to me. I expect we would have many examples for symbols (different symbol styles, sizes, colors et al.). It's better to group the "symbols" examples together.
Maybe we could place it under the user guide, similar to what is being done for projections at https://www.pygmt.org/v0.2.0/projections/index.html? But that can be discussed in another issue/PR.
transparency=70, # set transparency level for all symbols | ||
) | ||
|
||
fig.legend(transparency=30) # set transparency level for legends |
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.
Ah, this is cool, I hadn't thought of using transparent legend boxes before!
Description of proposed changes
Preview: https://pygmt-git-gallery-scatter.gmt.vercel.app/gallery/plot/scatter.html
Add a new example, modified from https://matplotlib.org/gallery/lines_bars_and_markers/scatter_with_legend.html.
To be discussed:
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.