Skip to content

Commit 68c600f

Browse files
seismanmichaelgrundyvonnefroehlich
authored
Figure.ternary: Add the 'no_clip' parameter for plotting symbols outside the ternary diagram (#4707)
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
1 parent 4d521fc commit 68c600f

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

pygmt/src/ternary.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,17 @@ def _ternary_frame(frame):
108108

109109

110110
@fmt_docstring
111-
@use_alias(C="cmap", G="fill", JX="width", S="style", W="pen")
111+
@use_alias(C="cmap", S="style")
112112
def ternary( # noqa: PLR0913
113113
self,
114114
data: PathLike | TableLike,
115+
fill: str | None = None,
116+
width: float | str | None = None,
117+
pen: str | None = None,
115118
alabel: str | None = None,
116119
blabel: str | None = None,
117120
clabel: str | None = None,
121+
no_clip: bool = False,
118122
region: Sequence[float | str] | str | None = None,
119123
frame: Frame | Axis | Literal["none"] | str | Sequence[str] | bool = False,
120124
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -139,9 +143,13 @@ def ternary( # noqa: PLR0913
139143
140144
$aliases
141145
- B = frame
146+
- G = fill
147+
- JX = width
142148
- L = alabel/blabel/clabel
149+
- N = no_clip
143150
- R = region
144151
- V = verbose
152+
- W = pen
145153
- c = panel
146154
- p = perspective
147155
- t = transparency
@@ -151,12 +159,10 @@ def ternary( # noqa: PLR0913
151159
data
152160
Pass in either a file name to an ASCII data table, a Python list, a 2-D
153161
$table_classes.
154-
width : str
155-
Set the width of the figure by passing a number, followed by
156-
a unit (**i** for inches, **c** for centimeters). Use a negative width
157-
to indicate that positive axes directions be clock-wise
158-
[Default lets the a, b, c axes be positive in a
159-
counter-clockwise direction].
162+
width
163+
Width of the ternary diagram. Use a negative width to indicate that positive
164+
axes directions be clock-wise [Default lets the **a**, **b**, **c** axes be
165+
positive in a counter-clockwise direction].
160166
region : str or list
161167
[*amin*, *amax*, *bmin*, *bmax*, *cmin*, *cmax*].
162168
Give the min and max limits for each of the three axes **a**, **b**,
@@ -165,7 +171,6 @@ def ternary( # noqa: PLR0913
165171
For ternary diagrams, use :class:`pygmt.params.Frame` ``xaxis``, ``yaxis``, and
166172
``zaxis`` attributes to set the **a**, **b**, and **c** axes, respectively.
167173
$cmap
168-
$fill
169174
alabel
170175
Set the label for the *a* vertex where the component is 100%. The label is
171176
placed at a distance of three times the :gmt-term:`MAP_LABEL_OFFSET` setting
@@ -177,7 +182,13 @@ def ternary( # noqa: PLR0913
177182
style : str
178183
*symbol*\[\ *size*].
179184
Plot individual symbols in a ternary diagram.
180-
$pen
185+
pen
186+
Set pen attributes for the outlines of symbols or lines.
187+
fill
188+
Set color or pattern for filling of symbols [Default is no fill].
189+
no_clip
190+
Do not clip symbols to the ternary diagram [Default plots points whose
191+
coordinates are strictly inside the map border].
181192
$verbose
182193
$panel
183194
$perspective
@@ -189,7 +200,11 @@ def ternary( # noqa: PLR0913
189200
labels = _labels if any(v != "-" for v in _labels) else None
190201

191202
aliasdict = AliasSystem(
203+
G=Alias(fill, name="fill"),
204+
JX=Alias(width, name="width"),
192205
L=Alias(labels, name="alabel/blabel/clabel", sep="/", size=3),
206+
N=Alias(no_clip, name="no_clip"),
207+
W=Alias(pen, name="pen"),
193208
).add_common(
194209
B=_ternary_frame(frame),
195210
R=region,

0 commit comments

Comments
 (0)