Skip to content

Commit 8ad8d7c

Browse files
committed
Merge branch 'master' into grdimage/document_all_args
2 parents a0771e6 + 56ba083 commit 8ad8d7c

File tree

2 files changed

+45
-16
lines changed

2 files changed

+45
-16
lines changed

pygmt/base_plotting.py

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use
7070
U="timestamp",
7171
X="xshift",
7272
Y="yshift",
73+
p="perspective",
7374
t="transparency",
7475
)
75-
@kwargs_to_strings(R="sequence")
76+
@kwargs_to_strings(R="sequence", p="sequence")
7677
def coast(self, **kwargs):
7778
"""
7879
Plot continents, shorelines, rivers, and borders on maps
@@ -132,6 +133,7 @@ def coast(self, **kwargs):
132133
``'[level/]pen'``
133134
Draw shorelines [Default is no shorelines]. Append pen attributes.
134135
{XY}
136+
{p}
135137
{t}
136138
137139
"""
@@ -151,9 +153,10 @@ def coast(self, **kwargs):
151153
W="scale",
152154
X="xshift",
153155
Y="yshift",
156+
p="perspective",
154157
t="transparency",
155158
)
156-
@kwargs_to_strings(R="sequence", G="sequence")
159+
@kwargs_to_strings(R="sequence", G="sequence", p="sequence")
157160
def colorbar(self, **kwargs):
158161
"""
159162
Plot a gray or color scale-bar on maps.
@@ -214,6 +217,7 @@ def colorbar(self, **kwargs):
214217
Multiply all z-values in the CPT by the provided scale. By default
215218
the CPT is used as is.
216219
{XY}
220+
{p}
217221
{t}
218222
219223
"""
@@ -237,9 +241,10 @@ def colorbar(self, **kwargs):
237241
l="label",
238242
X="xshift",
239243
Y="yshift",
244+
p="perspective",
240245
t="transparency",
241246
)
242-
@kwargs_to_strings(R="sequence", L="sequence", A="sequence_plus")
247+
@kwargs_to_strings(R="sequence", L="sequence", A="sequence_plus", p="sequence")
243248
def grdcontour(self, grid, **kwargs):
244249
"""
245250
Convert grids or images to contours and plot them on maps
@@ -295,6 +300,7 @@ def grdcontour(self, grid, **kwargs):
295300
to be of the format [*annotcontlabel*][/*contlabel*]. If either
296301
label contains a slash (/) character then use ``|`` as the
297302
separator for the two labels instead.
303+
{p}
298304
{t}
299305
"""
300306
kwargs = self._preprocess(**kwargs)
@@ -329,10 +335,11 @@ def grdcontour(self, grid, **kwargs):
329335
X="xshift",
330336
Y="yshift",
331337
n="interpolation",
338+
p="perspective",
332339
t="transparency",
333340
x="cores",
334341
)
335-
@kwargs_to_strings(R="sequence")
342+
@kwargs_to_strings(R="sequence", p="sequence")
336343
def grdimage(self, grid, **kwargs):
337344
"""
338345
Project and plot grids or images.
@@ -448,6 +455,7 @@ def grdimage(self, grid, **kwargs):
448455
{V}
449456
{XY}
450457
{n}
458+
{p}
451459
{t}
452460
{x}
453461
@@ -479,10 +487,10 @@ def grdimage(self, grid, **kwargs):
479487
Wc="contourpen",
480488
Wm="meshpen",
481489
Wf="facadepen",
482-
p="perspective",
483490
I="shading",
484491
X="xshift",
485492
Y="yshift",
493+
p="perspective",
486494
t="transparency",
487495
)
488496
@kwargs_to_strings(R="sequence", p="sequence")
@@ -547,10 +555,6 @@ def grdview(self, grid, **kwargs):
547555
Sets the pen attributes used for the facade. You must also select
548556
-N for the facade outline to be drawn.
549557
550-
perspective : list or str
551-
``'[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0]'``.
552-
Select perspective view.
553-
554558
shading : str
555559
Provide the name of a grid file with intensities in the (-1,+1)
556560
range, or a constant intensity to apply everywhere (affects the
@@ -561,6 +565,7 @@ def grdview(self, grid, **kwargs):
561565
``+d`` to select the default arguments (``+a-45+nt1+m0``).
562566
563567
{XY}
568+
{p}
564569
{t}
565570
566571
"""
@@ -604,9 +609,10 @@ def grdview(self, grid, **kwargs):
604609
U="timestamp",
605610
X="xshift",
606611
Y="yshift",
612+
p="perspective",
607613
t="transparency",
608614
)
609-
@kwargs_to_strings(R="sequence", i="sequence_comma")
615+
@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence")
610616
def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
611617
"""
612618
Plot lines, polygons, and symbols on maps.
@@ -676,6 +682,7 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
676682
label : str
677683
Add a legend entry for the symbol or line being plotted.
678684
685+
{p}
679686
{t}
680687
"""
681688
kwargs = self._preprocess(**kwargs)
@@ -728,9 +735,10 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
728735
C="levels",
729736
X="xshift",
730737
Y="yshift",
738+
p="perspective",
731739
t="transparency",
732740
)
733-
@kwargs_to_strings(R="sequence", i="sequence_comma")
741+
@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence")
734742
def contour(self, x=None, y=None, z=None, data=None, **kwargs):
735743
"""
736744
Contour table data by direct triangulation.
@@ -787,6 +795,7 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
787795
label contains a slash (/) character then use ``|`` as the
788796
separator for the two labels instead.
789797
{XY}
798+
{p}
790799
{t}
791800
792801
"""
@@ -820,9 +829,10 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
820829
U="timestamp",
821830
X="xshift",
822831
Y="yshift",
832+
p="perspective",
823833
t="transparency",
824834
)
825-
@kwargs_to_strings(R="sequence")
835+
@kwargs_to_strings(R="sequence", p="sequence")
826836
def basemap(self, **kwargs):
827837
"""
828838
Produce a basemap for the figure.
@@ -855,6 +865,7 @@ def basemap(self, **kwargs):
855865
reference and anchor points
856866
{U}
857867
{XY}
868+
{p}
858869
{t}
859870
860871
"""
@@ -873,9 +884,10 @@ def basemap(self, **kwargs):
873884
F="box",
874885
X="xshift",
875886
Y="yshift",
887+
p="perspective",
876888
t="transparency",
877889
)
878-
@kwargs_to_strings(R="sequence")
890+
@kwargs_to_strings(R="sequence", p="sequence")
879891
def logo(self, **kwargs):
880892
"""
881893
Place the GMT graphics logo on a map.
@@ -901,6 +913,7 @@ def logo(self, **kwargs):
901913
GMT logo.
902914
{U}
903915
{XY}
916+
{p}
904917
{t}
905918
906919
"""
@@ -919,9 +932,10 @@ def logo(self, **kwargs):
919932
M="monochrome",
920933
X="xshift",
921934
Y="yshift",
935+
p="perspective",
922936
t="transparency",
923937
)
924-
@kwargs_to_strings(R="sequence")
938+
@kwargs_to_strings(R="sequence", p="sequence")
925939
def image(self, imagefile, **kwargs):
926940
"""
927941
Place images or EPS files on maps.
@@ -955,6 +969,7 @@ def image(self, imagefile, **kwargs):
955969
Convert color image to monochrome grayshades using the (television)
956970
YIQ-transformation.
957971
{XY}
972+
{p}
958973
{t}
959974
"""
960975
kwargs = self._preprocess(**kwargs)
@@ -970,9 +985,10 @@ def image(self, imagefile, **kwargs):
970985
F="box",
971986
X="xshift",
972987
Y="yshift",
988+
p="perspective",
973989
t="transparency",
974990
)
975-
@kwargs_to_strings(R="sequence")
991+
@kwargs_to_strings(R="sequence", p="sequence")
976992
def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwargs):
977993
"""
978994
Plot legends on maps.
@@ -1007,6 +1023,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
10071023
default, uses '+gwhite+p1p' which draws a box around the legend
10081024
using a 1 point black pen and adds a white background.
10091025
{XY}
1026+
{p}
10101027
{t}
10111028
"""
10121029
kwargs = self._preprocess(**kwargs)
@@ -1038,6 +1055,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
10381055
W="pen",
10391056
X="xshift",
10401057
Y="yshift",
1058+
p="perspective",
10411059
t="transparency",
10421060
)
10431061
@kwargs_to_strings(
@@ -1046,6 +1064,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
10461064
angle="sequence_comma",
10471065
font="sequence_comma",
10481066
justify="sequence_comma",
1067+
p="sequence",
10491068
)
10501069
def text(
10511070
self,
@@ -1145,6 +1164,7 @@ def text(
11451164
(see *clearance*) [Default is width = default, color = black,
11461165
style = solid].
11471166
{XY}
1167+
{p}
11481168
{t}
11491169
"""
11501170
kwargs = self._preprocess(**kwargs)
@@ -1202,9 +1222,10 @@ def text(
12021222
C="offset",
12031223
X="xshift",
12041224
Y="yshift",
1225+
p="perspective",
12051226
t="transparency",
12061227
)
1207-
@kwargs_to_strings(R="sequence")
1228+
@kwargs_to_strings(R="sequence", p="sequence")
12081229
def meca(
12091230
self,
12101231
spec,
@@ -1300,6 +1321,7 @@ def meca(
13001321
{R}
13011322
{B}
13021323
{XY}
1324+
{p}
13031325
{t}
13041326
"""
13051327

pygmt/helpers/decorators.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@
8686
- 'c' for bicubic [Default]
8787
- 'l' for bilinear
8888
- 'n' for nearest-neighbor""",
89+
"p": """\
90+
perspective : list or str
91+
``'[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0]'``.
92+
Select perspective view and set the azimuth and elevation angle of
93+
the viewpoint. Default is [180, 90]. Full documentation is at
94+
:gmt-docs:`gmt.html#perspective-full`.
95+
""",
8996
"registration": """\
9097
registration : str
9198
``[g|p]``

0 commit comments

Comments
 (0)