You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gallery example "Legend": Update regarding input data and multi-column legends - #2762
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 of Figure.plot, and not via a parameter of the Figure.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 🙂.
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.
I agree. Maybe we can simply create some simple sine/cosine curves instead.
yvonnefroehlich
changed the title
Gallery example "Legend": Correct docs and add code regarding multi-column legends
WIP: Gallery example "Legend": Correct docs and add code regarding multi-column legends
Oct 23, 2023
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.
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?
yvonnefroehlich
changed the title
WIP: Gallery example "Legend": Correct docs and add code regarding multi-column legends
WIP: Gallery example "Legend": Update regarding used data and multi-column legends
Oct 25, 2023
yvonnefroehlich
changed the title
WIP: Gallery example "Legend": Update regarding used data and multi-column legends
WIP: Gallery example "Legend": Update regarding input data and multi-column legends
Oct 25, 2023
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.
yvonnefroehlich
changed the title
WIP: Gallery example "Legend": Update regarding input data and multi-column legends
Gallery example "Legend": Update regarding input data and multi-column legends
Oct 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
documentationImprovements or additions to documentation
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
labelparameter ofFigure.plot, and not via a parameter of theFigure.legendmethod. 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 formatandmake checkto 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