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.
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 tutorial for pygmt.config #482
Add tutorial for pygmt.config #482
Changes from 4 commits
f1d2ab0
585ed8c
c0da05e
968f551
6ec06c1
c709bbe
b84e4a2
b9d5c10
c225f19
175c2b4
dce7ad8
154a719
f0cc82c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
In GMT 6.1.0, each session can have a global gmt.conf file, and each figure can also have its own gmt.conf (see https://docs.generic-mapping-tools.org/6.1/cookbook/features.html#gmt-modern-mode-hierarchical-levels).
Now these two lines no longer works as we expected. They actually change the defaults of the figure above. To change the defaults of the current figure, we need to move these two lines after
fig=pygmt.Figure()
.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.
So hierarchically one must do something like:
That makes sense, I'll fix this up (and finish the two PRs I've opened!)
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.
How would one trigger the further levels mentioned in the GMT 6.1.0 documentation (
subplot
,panel
,inset
)?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.
Currently,
subplot
andinset
are not implemented in PyGMT yet, but see #412 and #427.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.
Just opened up an issue for
inset
at #663, we can discuss over there. Thesubplot
implementation at #427 is also ready for review 😄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.
I just read it! I'll have a look at it, thanks.
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.
As explained above, no need to use the
with
statement to limit the scope of changes to a single figure, but it's still useful if we want to limit the changes to one or a few calls.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.
I still like the syntax of using a context manager. For me, it's far more intuitive/easy to see the scope of the changes being made than tracking the level based on
Figure
calls.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.
Yes, it works the same as the figure level configurations, just needs one more indentation. I'm OK with the example, but the main idea of the context manager is to mimic the command line parameter
gmt basemap --PARAMETER=value
, which only affect one single command. So perhaps we can keep this example, and add one more example.