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. |
weiji14
left a comment
There was a problem hiding this comment.
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.
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 formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.