Skip to content

Commit 72e5c52

Browse files
DOC: Update docs to use consistently x-* and y-* (with hyphen) - 02 (#3966)
1 parent aa7c658 commit 72e5c52

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

examples/gallery/basemaps/double_y_axes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ class can control which axes should be plotted and optionally show annotations,
2121
import numpy as np
2222
import pygmt
2323

24-
# Generate two sample Y data from one common X data
24+
# Generate two sample Y-data from one common X-data
2525
x = np.linspace(1.0, 9.0, num=9)
2626
y1 = x
2727
y2 = x**2 + 110
2828

2929
fig = pygmt.Figure()
3030

31-
# Plot the common X axes
31+
# Plot the common X-axes
3232
# The bottom axis (S) is plotted with annotations and tick marks
3333
# The top axis (t) is plotted without annotations and tick marks
3434
# The left and right axes are not drawn
3535
fig.basemap(region=[0, 10, 0, 10], projection="X15c/15c", frame=["St", "xaf+lx"])
3636

37-
# Plot the Y axis for y1 data
37+
# Plot the Y-axis for y1-data
3838
# The left axis (W) is plotted with blue annotations, ticks, and label
3939
with pygmt.config(
4040
MAP_FRAME_PEN="blue",
@@ -44,12 +44,12 @@ class can control which axes should be plotted and optionally show annotations,
4444
):
4545
fig.basemap(frame=["W", "yaf+ly1"])
4646

47-
# Plot the line for y1 data
47+
# Plot the line for y1-data
4848
fig.plot(x=x, y=y1, pen="1p,blue")
49-
# Plot points for y1 data
49+
# Plot points for y1-data
5050
fig.plot(x=x, y=y1, style="c0.2c", fill="blue", label="y1")
5151

52-
# Plot the Y axis for y2 data
52+
# Plot the Y-axis for y2-data
5353
# The right axis (E) is plotted with red annotations, ticks, and label
5454
with pygmt.config(
5555
MAP_FRAME_PEN="red",
@@ -58,9 +58,9 @@ class can control which axes should be plotted and optionally show annotations,
5858
FONT_LABEL="red",
5959
):
6060
fig.basemap(region=[0, 10, 100, 200], frame=["E", "yaf+ly2"])
61-
# Plot the line for y2 data
61+
# Plot the line for y2-data
6262
fig.plot(x=x, y=y2, pen="1p,red")
63-
# Plot points for y2 data
63+
# Plot points for y2-data
6464
fig.plot(x=x, y=y2, style="s0.28c", fill="red", label="y2")
6565

6666
# Create a legend in the Top Left (TL) corner of the plot with an

examples/gallery/histograms/scatter_and_histograms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import numpy as np
1313
import pygmt
1414

15-
# Generate random x, y coordinates from a standard normal distribution.
16-
# x values are centered on 0 with a standard deviation of 1, and y values are centered
15+
# Generate random x-, y-coordinates from a standard normal distribution.
16+
# x-values are centered on 0 with a standard deviation of 1, and y-values are centered
1717
# on 30 with a standard deviation of 2.
1818
rng = np.random.default_rng()
1919
x = rng.normal(loc=0, scale=1, size=1000)

examples/gallery/images/contours.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
tabular format.
1414
1515
The parameters ``levels`` and ``annotation`` set the intervals of the contours
16-
and the annotation on the contours respectively.
16+
and the annotations on the contours, respectively.
1717
18-
In this example we supply the data as 1-D :class:`numpy.ndarray` with the
19-
``x``, ``y``, and ``z`` parameters and draw the contours using a 0.5p pen with
20-
contours every 10 ``z`` values and annotations every 20 ``z`` values.
18+
In this example we supply the data as 1-D :class:`numpy.ndarray` with the ``x``,
19+
``y``, and ``z`` parameters and draw the contours using a 0.5-points pen with
20+
contours every 10 z-values and annotations every 20 z-values.
2121
"""
2222

2323
# %%
2424
import numpy as np
2525
import pygmt
2626

27-
# build the contours underlying data with the function z = x^2 + y^2
27+
# Build the contours underlying data with the function z = x^2 + y^2
2828
X, Y = np.meshgrid(np.linspace(-10, 10, 50), np.linspace(-10, 10, 50))
2929
Z = X**2 + Y**2
3030
x, y, z = X.flatten(), Y.flatten(), Z.flatten()
@@ -36,13 +36,13 @@
3636
projection="X10c/10c",
3737
frame="ag",
3838
pen="0.5p",
39-
# pass the data as 3 1-D data columns
39+
# Pass the data as 3 1-D data columns
4040
x=x,
4141
y=y,
4242
z=z,
43-
# set the contours z values intervals to 10
43+
# Set the interval of the contours to 10
4444
levels=10,
45-
# set the contours annotation intervals to 20
45+
# Set the interval of the annotations to 20
4646
annotation=20,
4747
)
4848
fig.show()

examples/gallery/lines/vector_styles.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525

2626
# Left: plot 12 Cartesian vectors with different lengths
27-
x = np.linspace(-116, -116, 12) # x vector coordinates
28-
y = np.linspace(33.5, 42.5, 12) # y vector coordinates
27+
x = np.linspace(-116, -116, 12) # x-vector coordinates
28+
y = np.linspace(33.5, 42.5, 12) # y-vector coordinates
2929
direction = np.zeros(x.shape) # direction of vectors
3030
length = np.linspace(0.5, 2.4, 12) # length of vectors
3131
# Cartesian vectors (v) with red fill and pen (+g, +p), vector head at the end (+e), and
@@ -37,8 +37,8 @@
3737

3838
# Middle: plot 7 math angle arcs with different radii
3939
num = 7
40-
x = np.full(num, -95) # x coordinates of the center
41-
y = np.full(num, 37) # y coordinates of the center
40+
x = np.full(num, -95) # x-coordinates of the center
41+
y = np.full(num, 37) # y-coordinates of the center
4242
radius = 1.8 - 0.2 * np.arange(0, num) # radius
4343
startdir = np.full(num, 90) # start direction in degrees
4444
stopdir = 180 + 40 * np.arange(0, num) # stop direction in degrees

examples/tutorials/advanced/vectors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# %%
4747
# In this example, we apply the same concept shown previously to plot multiple
4848
# vectors. Notice that instead of passing int/float to ``x`` and ``y``, a list
49-
# of all x and y coordinates will be passed. Similarly, the length of direction
49+
# of all x- and y-coordinates will be passed. Similarly, the length of direction
5050
# list will increase accordingly.
5151
#
5252
# Additionally, we change the style of the vector to include a red
@@ -157,8 +157,8 @@
157157

158158
# %%
159159
# In this example, Cartesian vectors are plotted over a Mercator
160-
# projection of the continental US. The x values represent the
161-
# longitude and y values represent the latitude where the vector starts.
160+
# projection of the continental US. The x-values represent the
161+
# longitude and y-values represent the latitude where the vector starts.
162162
#
163163
# This example also shows some of the styles a vector supports.
164164
# The beginning point of the vector (**+b**)
@@ -213,8 +213,8 @@
213213
# Transverse Mercator projection is used. Additionally, :func:`numpy.linspace`
214214
# is used to create 5 vectors with equal stops.
215215

216-
x = np.linspace(36, 42, 5) # x values = [36. 37.5 39. 40.5 42. ]
217-
y = np.linspace(39, 39, 5) # y values = [39. 39. 39. 39.]
216+
x = np.linspace(36, 42, 5) # x-values = [36. 37.5 39. 40.5 42.]
217+
y = np.linspace(39, 39, 5) # y-values = [39. 39. 39. 39.]
218218
direction = np.linspace(-90, -90, 5) # direction values = [-90. -90. -90. -90.]
219219
length = np.linspace(1.5, 1.5, 5) # length values = [1.5 1.5 1.5 1.5]
220220

examples/tutorials/basics/polygons.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
This tutorial focuses on input data given as NumPy arrays. Besides NumPy arrays,
88
array-like objects are supported. Here, a polygon is a closed shape defined by a series
9-
of data points with x and y coordinates, connected by line segments, with the start and
9+
of data points with x- and y-coordinates, connected by line segments, with the start and
1010
end points being identical. For plotting a :class:`geopandas.GeoDataFrame` object with
1111
polygon geometries, e.g., to create a choropleth map, see the gallery example
1212
:doc:`Choropleth map </gallery/maps/choropleth_map>`.
@@ -20,7 +20,7 @@
2020
# Plot polygons
2121
# -------------
2222
#
23-
# Set up sample data points as NumPy arrays for the x and y values.
23+
# Set up sample data points as NumPy arrays for the x- and y-values.
2424

2525
x = np.array([-2, 1, 3, 0, -4, -2])
2626
y = np.array([-3, -1, 1, 3, 2, -3])
@@ -65,8 +65,8 @@
6565
# Close polygons
6666
# --------------
6767
#
68-
# Set up sample data points as NumPy arrays for the x and y values. Now, the data points
69-
# do not form a polygon.
68+
# Set up sample data points as NumPy arrays for the x- and y-values. Now, the data
69+
# points do not form a polygon.
7070

7171
x = np.array([-2, 1, 3, 0, -4])
7272
y = np.array([-3, -1, 1, 3, 2])

0 commit comments

Comments
 (0)