You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep track of -X -Y for clip paths in modern mode #6406
Currently, users must specify any x-shifts and y-shifts applied to their plots when ending clip paths using coast -Q, clip -C, or mask -C. I am wondering if it would be feasible to keep track of these settings automatically in modern mode in a similar manner to how the -R -J history is tracked in insets, subplots, figures, etc?
For background, one motivation for this question is to simplify the use of these features in the wrappers by controlling the closure of clip paths automatically (e.g., GenericMappingTools/pygmt#1779). In addition to helping PyGMT, this would also simplify usage through the CLI.
Hm, not sure I understand actually. Can you illustrate this with a modern mode CLI script that shows what the trouble is? I am sure we could do something under the hood in modern mode as long as it can be backwards compatible with not doing it.
Perhaps I am not correctly interpreting this sentence from the clip -C docs: "Remember to supply -X and -Y settings if you have moved since the clip started.".
Here is a CLI example with -X used while the clip path is set (I am not sure why the second plot command does not affect the figure):
cat << EOF > path1.txt
1 1
1 2
2 2
2 1
EOF
gmt begin clip_example png
gmt basemap -R0/6/0/6 -JX3c -B
gmt clip path1.txt -N -W
gmt plot @tut_data.txt -Gred -Sc0.2c
gmt plot @tut_data.txt -Ggreen -Sc0.2c -X4c # Why is this not plotted?
gmt clip -C
gmt end
The map is 3c wide and you move 4c so all green are outside the map clip area. Try -X2c
Thanks - I missed this important section in the overview describing -N ("by plotting a clipping path along the map boundary").
Can you explain what the sentence "Remember to supply -X and -Y settings if you have moved since the clip started" is warning against? The example below seems to work fine without supplying -X settings despite having moved since the clip path started.
Activity
PaulWessel commentedon Mar 5, 2022
Hm, not sure I understand actually. Can you illustrate this with a modern mode CLI script that shows what the trouble is? I am sure we could do something under the hood in modern mode as long as it can be backwards compatible with not doing it.
maxrjones commentedon Mar 7, 2022
Perhaps I am not correctly interpreting this sentence from the clip -C docs: "Remember to supply -X and -Y settings if you have moved since the clip started.".
Here is a CLI example with -X used while the clip path is set (I am not sure why the second plot command does not affect the figure):
PaulWessel commentedon Mar 7, 2022
The map is 3c wide and you move 4c so all green are outside the map clip area. Try -X2c
maxrjones commentedon Mar 7, 2022
Thanks - I missed this important section in the overview describing -N ("by plotting a clipping path along the map boundary").
Can you explain what the sentence "Remember to supply -X and -Y settings if you have moved since the clip started" is warning against? The example below seems to work fine without supplying -X settings despite having moved since the clip path started.
PaulWessel commentedon Mar 7, 2022
No, I cannot make sense of it either. I am sure it made sense to me at the time...