-
Notifications
You must be signed in to change notification settings - Fork 245
Wrap histogram #1072
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 histogram #1072
Changes from 2 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
c042b0a
Add histogram.py
willschlitzer 4409760
remove outfile name
willschlitzer fe086b3
Update pygmt/src/histogram.py
willschlitzer da2539f
wrap additional arguments
willschlitzer f1cbad2
run make format
willschlitzer c2ec478
Merge branch 'master' into wrap-histogram
willschlitzer ac99e08
Merge branch 'wrap-histogram' of github.com:GenericMappingTools/pygmt…
willschlitzer 1e0e9aa
add into of docstring for histogram.py
willschlitzer 6ec0a66
add histogram to index.rst
willschlitzer fb2b4ce
add histogram aliases to docstring
willschlitzer 8899a48
remove uncommon parameters
willschlitzer d66de75
Merge branch 'master' into wrap-histogram
willschlitzer d30037c
update docstring for histogram
willschlitzer b8040ab
add interval
willschlitzer 2439d6a
Add test_histogram.py
willschlitzer 05c005f
add test_histogram.png.dvc
willschlitzer 34af05f
run make format
willschlitzer 1cfac35
add line breaks
willschlitzer 72c022c
add docstrings to test_histogram.py
willschlitzer 14aa960
Merge branch 'master' into wrap-histogram
willschlitzer c84b008
Merge branch 'master' into wrap-histogram
willschlitzer b5cf339
Apply suggestions from code review
willschlitzer 780b820
Merge branch 'master' into wrap-histogram
willschlitzer d9b8e39
remove GMTTempFile
willschlitzer 151d90b
Merge branch 'master' into wrap-histogram
willschlitzer 5ab0e5d
Merge branch 'master' into wrap-histogram
willschlitzer 1bc9300
Merge branch 'master' into wrap-histogram
willschlitzer 6bc7fa2
Merge branch 'master' into wrap-histogram
willschlitzer 69f5d4d
Update pygmt/src/histogram.py
willschlitzer 55c3fbc
update interval parameter to series in test_histogram() in test_histo…
willschlitzer 1d86dc7
update test_histogram.png.dvc
willschlitzer c914954
run make format
willschlitzer cb9e25e
Update pygmt/src/histogram.py
willschlitzer 30e2004
Merge branch 'master' into wrap-histogram
willschlitzer 85201e5
add region argument in test_histogram() in test_histogram.py
willschlitzer 9980315
update test_histogram.png.dvc
willschlitzer f1575f9
Merge remote-tracking branch 'origin/wrap-histogram' into wrap-histogram
willschlitzer 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -383,6 +383,7 @@ def _repr_html_(self): | |
| grdcontour, | ||
| grdimage, | ||
| grdview, | ||
| histogram, | ||
| image, | ||
| inset, | ||
| legend, | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| """ | ||
| Histogram - Create a histogram | ||
| """ | ||
| from pygmt.clib import Session | ||
| from pygmt.helpers import ( | ||
| GMTTempFile, | ||
| build_arg_string, | ||
| fmt_docstring, | ||
| kwargs_to_strings, | ||
| use_alias, | ||
| ) | ||
|
|
||
|
|
||
| @fmt_docstring | ||
| @use_alias( | ||
| J="projection", | ||
| G="color", | ||
| R="region", | ||
| ) | ||
| @kwargs_to_strings(R="sequence") | ||
| def histogram(table, **kwargs): | ||
| r""" | ||
| Histogram | ||
| """ | ||
|
willschlitzer marked this conversation as resolved.
|
||
| with GMTTempFile() as outfile: | ||
| with Session() as lib: | ||
| file_context = lib.virtualfile_from_data(data=table) | ||
|
willschlitzer marked this conversation as resolved.
Outdated
|
||
| with file_context as infile: | ||
| arg_str = " ".join( | ||
| [infile, build_arg_string(kwargs)] | ||
| ) | ||
| lib.call_module("histogram", arg_str) | ||
| result = outfile.read() | ||
| return result | ||
|
willschlitzer marked this conversation as resolved.
Outdated
|
||
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.