-
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
Gallery example "Legend": Update regarding input data and multi-column legends #2762
Conversation
I agree. Maybe we can simply create some simple sine/cosine curves instead. |
I made some changes regarding the used data (now sine and cosine curves) and the shown legend (now vertical and horizontal legends). I combined this within one figure, a bit similar to the gallery example we have for colorbars. @GenericMappingTools/pygmt-maintainers, what do you think? |
Co-authored-by: Michael Grund <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
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 this PR still WIP? It looks good to me so approve.
The PR should be finished from my side - updated the title. Just reduced some double blank lines. @seisman I am sorry for accidentally writing in your comment 🙁 - I reverted this change. |
Description of proposed changes
In contrast to the change in PR #2606, it is actually possible to create a multi-column legend for a automatically created legend. This PR corrects the introduction text of the gallery example "Legend".
I feel it would be good to show how to create a horizontal legend, as this is done via the
label
parameter ofFigure.plot
, and not via a parameter of theFigure.legend
method. For more complicated adjustments of a legend a tutorial seem to make sense. Currently, the same plot is created twice, first with a vertical legend (default) and then with a horizontal legend. However, I am not 100 % happy with this example. I do not like that we plot the same data twice above each other, just with different symbols. And maybe it is not optimal to simply repeat the same plot. Suggestions are welcome 🙂.Related:
Preveiw: https://pygmt-dev--2762.org.readthedocs.build/en/2762/gallery/embellishments/legend.html
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version