-
Notifications
You must be signed in to change notification settings - Fork 229
Figure.grdcontour: Adjust processing of arguments passed to the "annotation" and "interval" parameters, deprecate "sequence_plus" #3116
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
Changes from 2 commits
a3fa214
ee143e6
e59f077
05b5abb
99dc353
731d014
c8b805b
584956e
4a7a143
13360d4
57837fb
4f06fe4
311015e
560622d
4ae5073
6925eca
bbeb83c
078553c
1e114cf
c67fcf8
0cd2f0b
ccd6b01
581eef4
a86305c
4c52daa
c646b51
6a6df2c
7c3f012
f2805bb
d442adf
11b2dac
4708483
56afbe8
c8772bf
9a9ae49
ad5c33e
32c4f90
d9c734b
9f394f7
557af15
e964dda
4501bab
5fa02fb
988d77e
7ade301
cb6871b
a4c9216
e25e9ed
7fee937
be21572
a05ec74
fedf60d
6c53454
574c4a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -58,11 +58,11 @@ def grdcontour(self, grid, **kwargs): | |||||||
contours specified in ``interval``. | ||||||||
|
||||||||
- Specify a fixed annotation interval *annot_int* or a | ||||||||
single annotation level +\ *annot_int*. | ||||||||
single annotation level **+**\ *annot_int*. | ||||||||
- Disable all annotation with **-**. | ||||||||
- Optional label modifiers can be specified as a single string | ||||||||
``"[annot_int]+e"`` or with a list of arguments | ||||||||
``([annot_int], "e", "f10p", "gred")``. | ||||||||
``"annot_int+e+f10p+gred"`` or with a list of arguments | ||||||||
``[annot_int, "e", "f10p", "gred"]``. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am wondering whether here the squared brackets are used to indicate that The rounded brackets should be replaced by squared brackets as we write "list of arguments". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the description is correct. In the PyGMT world, a list of arguments means the option is repeatable. For example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm. I tried the following code to understand the input expected by # orientated on https://www.pygmt.org/dev/api/generated/pygmt.Figure.grdcontour.html
# last access: 2024/03/18
import pygmt
region = [-92.5, -82.5, -3, 7]
grid = pygmt.datasets.load_earth_relief(resolution="15m", region=region)
fig = pygmt.Figure()
fig.grdcontour(
projection="M10c",
region=region,
grid=grid,
# annotation="500+f10p+gred", # string -> WORKS
# annotation=([500], "f10p", "gred"), # -> FAILS
# annotation=(500, "f10p", "gred"), # -> WORKS
annotation=[500, "f10p", "gred"], # list -> WORKS
frame=True,
)
fig.show()
# fig.savefig(fname="grdcontour_A_string.png")
# fig.savefig(fname="grdcontour_A_list.png") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 30 to 32 in 6fd4a00
I see. It's because Actually, this is the only parameter that sets to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should disallow the syntax like
So, I think we should remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was actually also a bit wondering if we need this possibility, as such a list does not improve the readability significantly compared to the corresponding string. So, I think I am fine with removing |
||||||||
limit : str or list of 2 ints | ||||||||
*low*/*high*. | ||||||||
Do no draw contours below `low` or above `high`, specify as string | ||||||||
|
Uh oh!
There was an error while loading. Please reload this page.