Skip to content

Commit e230308

Browse files
seismanweiji14
andauthored
Improve documentation of Figure.logo() (#651)
* Improve documentation of Figure.logo() - Fix a broken link to gmtlogo documentation - Add option **-V** - Remove option **-p** (not listed in the documentation) - Add option **-S** (new in GMT 6.0) - Option **-D** is no longer required (tested with GMT>=6.1.1) - Remove the test for **-D** Co-authored-by: Wei Ji <[email protected]>
1 parent 0eab91f commit e230308

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

pygmt/base_plotting.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -887,25 +887,26 @@ def basemap(self, **kwargs):
887887
@use_alias(
888888
R="region",
889889
J="projection",
890-
U="timestamp",
891890
D="position",
892891
F="box",
892+
S="style",
893+
U="timestamp",
894+
V="verbose",
893895
X="xshift",
894896
Y="yshift",
895-
p="perspective",
896897
t="transparency",
897898
)
898899
@kwargs_to_strings(R="sequence", p="sequence")
899900
def logo(self, **kwargs):
900901
"""
901-
Place the GMT graphics logo on a map.
902+
Plot the GMT logo.
902903
903904
By default, the GMT logo is 2 inches wide and 1 inch high and
904905
will be positioned relative to the current plot origin.
905906
Use various options to change this and to place a transparent or
906907
opaque rectangular map panel behind the GMT logo.
907908
908-
Full option list at :gmt-docs:`logo.html`
909+
Full option list at :gmt-docs:`gmtlogo.html`.
909910
910911
{aliases}
911912
@@ -919,15 +920,21 @@ def logo(self, **kwargs):
919920
box : bool or str
920921
Without further options, draws a rectangular border around the
921922
GMT logo.
923+
style : str
924+
``l|n|u``.
925+
Control what is written beneath the map portion of the logo.
926+
927+
- **l** to plot the text label "The Generic Mapping Tools"
928+
[Default]
929+
- **n** to skip the label placement
930+
- **u** to place the URL to the GMT site
922931
{U}
932+
{V}
923933
{XY}
924-
{p}
925934
{t}
926935
927936
"""
928937
kwargs = self._preprocess(**kwargs)
929-
if "D" not in kwargs:
930-
raise GMTInvalidInput("Option D must be specified.")
931938
with Session() as lib:
932939
lib.call_module("logo", build_arg_string(kwargs))
933940

pygmt/tests/test_logo.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
"""
22
Tests for fig.logo
33
"""
4-
import pytest
5-
64
from .. import Figure
7-
from ..exceptions import GMTInvalidInput
85
from ..helpers.testing import check_figures_equal
96

107

@@ -31,11 +28,3 @@ def test_logo_on_a_map():
3128
)
3229
fig_test.logo(position="jTR+o0.1i/0.1i+w3i", box=True)
3330
return fig_ref, fig_test
34-
35-
36-
def test_logo_fails():
37-
"Make sure logo raises an exception when D is not given"
38-
fig = Figure()
39-
with pytest.raises(GMTInvalidInput):
40-
fig.logo()
41-
return fig

0 commit comments

Comments
 (0)