-
Notifications
You must be signed in to change notification settings - Fork 213
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 Figure.hlines for plotting horizontal lines #923
Draft
michaelgrund
wants to merge
33
commits into
main
Choose a base branch
from
hlines-module
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7ed3b49
Add new modules to plot horizontal and vertical lines
michaelgrund 096b9de
added further content
michaelgrund 92fa9c0
added some first tests
michaelgrund 975b305
some formatting
michaelgrund f25a89c
corrected typo
michaelgrund 3cee081
Merge branch 'master' into hlines-module
michaelgrund a0c29fc
Merge branch 'master' into hlines-module
michaelgrund 51dcb6a
Merge branch 'master' into hlines-module
michaelgrund 4fdc984
Merge branch 'master' into hlines-module
michaelgrund 154d05e
Merge branch 'master' into hlines-module
michaelgrund ddd04b4
Merge branch 'master' into hlines-module
michaelgrund d0bc35c
moved gallery example to new subfolder /lines
michaelgrund 450d8de
Merge branch 'master' into hlines-module
michaelgrund f75fbe1
disable pylint warnings
michaelgrund a375a77
replace hyphen by underscore in gallery example file name
michaelgrund 71113dd
disable pylint warnings
michaelgrund 1438d43
formatting
michaelgrund e3a564e
Merge branch 'master' into hlines-module
michaelgrund d6a8fa5
Merge branch 'master' into hlines-module
michaelgrund ff13180
Merge branch 'master' into hlines-module
michaelgrund 1881e95
Merge branch 'master' into hlines-module
michaelgrund 7222e9b
Merge branch 'main' into hlines-module
michaelgrund 65eb85d
update hlines module
michaelgrund 2353587
Merge branch 'hlines-module' of https://github.com/GenericMappingTool…
michaelgrund 49008ed
formatting
michaelgrund 457bf72
adjust docstring
michaelgrund f2c84a7
adjust priliminary tests
michaelgrund 50dccf9
Merge branch 'main' into hlines-module
michaelgrund e7726c0
update
michaelgrund 60d6e55
Merge branch 'hlines-module' of https://github.com/GenericMappingTool…
michaelgrund 46f8702
formatting
michaelgrund 5648778
Merge branch 'main' into hlines-module
michaelgrund d553e28
Merge branch 'main' into hlines-module
michaelgrund 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
added further content
- Loading branch information
commit 096b9de601c68bb17d3ac3e2e9796e881679b600
There are no files selected for viewing
This file contains 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 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,29 @@ | ||
""" | ||
Plot horizontal lines | ||
--------------------- | ||
|
||
The :meth:`pygmt.Figure.hlines` method can plot horizontal lines based on | ||
a given y value. Optionally, the lower and upper limits of the lines can be | ||
defined, otherwise the current map boundaries are taken. | ||
|
||
""" | ||
|
||
import pygmt | ||
|
||
fig = pygmt.Figure() | ||
fig.basemap(region=[0, 10, 0, 11], projection="X10c/10c", frame=True) | ||
|
||
fig.hlines(1, label="line1") | ||
fig.hlines([2, 3], pen="2p,dodgerblue4", label="line2") | ||
fig.hlines([4, 5], xmin=2, xmax=8, pen="2p,red3", label="line3") | ||
fig.hlines([6, 7], xmin=[1, 3], xmax=[8, 7], pen="3p,seagreen", label="line4") | ||
fig.hlines( | ||
[8, 9, 10], | ||
xmin=[1.3, 3, 2], | ||
xmax=[6.5, 7, 5], | ||
pen=["4p,darkmagenta", "2p,gold,--", "3.5p,blue,."], | ||
label=["line5", "line6", "line7"], | ||
) | ||
|
||
fig.legend() | ||
fig.show() |
This file contains 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 |
---|---|---|
|
@@ -383,6 +383,7 @@ def _repr_html_(self): | |
grdcontour, | ||
grdimage, | ||
grdview, | ||
hlines, | ||
image, | ||
inset, | ||
legend, | ||
|
This file contains 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 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
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.
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.