-
Notifications
You must be signed in to change notification settings - Fork 228
Wrap legend #333
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
Merged
Merged
Wrap legend #333
Changes from 10 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e708414
Add Figure.legend() wrapper
liamtoney 60f1b73
Implement handles/labels functionality for Figure.legend()
liamtoney 03fbff8
Merge branch 'master' of https://github.com/GenericMappingTools/gmt-p…
liamtoney 8a19632
Merge branch 'master' of https://github.com/GenericMappingTools/gmt-p…
liamtoney 826318e
Merge branch 'master' of https://github.com/GenericMappingTools/pygmt…
liamtoney ae6335b
Merge with pygmt master
liamtoney a6771a1
Use extlinks for legend docstring
liamtoney 69f327e
Merge branch 'master' of https://github.com/GenericMappingTools/pygmt…
liamtoney 95d170d
Hack to allow rc2
liamtoney cddf2cf
Add test for legend
liamtoney a57dec3
Revert "Hack to allow rc2"
liamtoney 2ddec23
Merge branch 'master' of https://github.com/GenericMappingTools/pygmt…
liamtoney da4569c
Use aliases for D and F args
liamtoney 1b07abb
Simplify data_kind() call
liamtoney 88addf7
Flesh out documentation
liamtoney 24330cd
Merge branch 'master' of https://github.com/GenericMappingTools/pygmt…
liamtoney 3a18c63
Alias label (l) for plot
weiji14 c628f27
Merge pull request #1 from weiji14/plot/alias_label
liamtoney 391e710
Merge branch 'master' into add-legend
liamtoney a514b59
Use GMT's auto-legend feature instead of regex
liamtoney 519e383
Remove unused GMTTempFile import
liamtoney 9130f47
Revise first legend test
liamtoney 52ae8ee
Add legend entries test
liamtoney 58dba31
Add legend specfile test
liamtoney f44e98e
Add failing test
liamtoney e737ca8
Add legend to index.rst
liamtoney 557149d
Remove unneeded decorator
liamtoney 850a96a
Merge branch 'master' into add-legend
weiji14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Tests for legend | ||
""" | ||
import pytest | ||
|
||
from .. import Figure | ||
|
||
|
||
@pytest.mark.mpl_image_compare | ||
def test_legend(): | ||
""" | ||
Create 3-entry legend. | ||
""" | ||
fig = Figure() | ||
|
||
h1 = fig.plot( | ||
x=[-5], | ||
y=[5], | ||
region=[-10, 10, -5, 10], | ||
projection="X3i/0", | ||
frame="a", | ||
style="a15p", | ||
pen="1.5p,purple", | ||
) | ||
|
||
h2 = fig.plot(x=[0], y=[5], style="t10p", color="cyan") | ||
|
||
h3 = fig.plot(x=[5], y=[5], style="d5p", color="yellow", pen=True) | ||
|
||
fig.legend( | ||
[[h1, h2, h3], ["I am a star!", "I am a triangle!", "I am a diamond!"]], | ||
F=True, | ||
D="g0/0+w2i+jCM", | ||
) | ||
|
||
return fig | ||
weiji14 marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Uh oh!
There was an error while loading. Please reload this page.