Skip to content

Commit 8ce0755

Browse files
committed
Merge branch 'main' into uv/resolution-lowest
2 parents 834be64 + 178c73d commit 8ce0755

File tree

10 files changed

+39
-38
lines changed

10 files changed

+39
-38
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Install Micromamba with conda-forge dependencies
5050
- name: Setup Micromamba
51-
uses: mamba-org/setup-micromamba@v2.0.4
51+
uses: mamba-org/setup-micromamba@v2.0.5
5252
with:
5353
environment-name: pygmt
5454
cache-environment: true

.github/workflows/cache_data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Install Micromamba with conda-forge dependencies
4848
- name: Setup Micromamba
49-
uses: mamba-org/setup-micromamba@v2.0.4
49+
uses: mamba-org/setup-micromamba@v2.0.5
5050
with:
5151
environment-name: pygmt
5252
create-args: >-

.github/workflows/ci_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
# Install Micromamba with conda-forge dependencies
8585
- name: Setup Micromamba
86-
uses: mamba-org/setup-micromamba@v2.0.4
86+
uses: mamba-org/setup-micromamba@v2.0.5
8787
with:
8888
environment-name: pygmt
8989
cache-environment: true

.github/workflows/ci_doctests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
# Install Micromamba with conda-forge dependencies
4747
- name: Setup Micromamba
48-
uses: mamba-org/setup-micromamba@v2.0.4
48+
uses: mamba-org/setup-micromamba@v2.0.5
4949
with:
5050
environment-name: pygmt
5151
create-args: >-

.github/workflows/ci_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray netCDF4 sphinx-gallery'
7979
# Python 3.13 + core packages (latest versions) + optional packages
8080
- python-version: '3.13'
81-
numpy-version: '2.2'
81+
numpy-version: '2.3'
8282
pandas-version: ''
8383
xarray-version: ''
8484
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray netCDF4 sphinx-gallery'
@@ -116,7 +116,7 @@ jobs:
116116

117117
# Install Micromamba with conda-forge dependencies
118118
- name: Setup Micromamba
119-
uses: mamba-org/setup-micromamba@v2.0.4
119+
uses: mamba-org/setup-micromamba@v2.0.5
120120
with:
121121
environment-name: pygmt
122122
cache-environment: true

.github/workflows/ci_tests_dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
# Install Micromamba with conda-forge dependencies
6262
- name: Setup Micromamba
63-
uses: mamba-org/setup-micromamba@v2.0.4
63+
uses: mamba-org/setup-micromamba@v2.0.5
6464
with:
6565
environment-name: pygmt
6666
cache-environment: true

.github/workflows/ci_tests_legacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
# Install Micromamba with conda-forge dependencies
5656
- name: Setup Micromamba
57-
uses: mamba-org/setup-micromamba@v2.0.4
57+
uses: mamba-org/setup-micromamba@v2.0.5
5858
with:
5959
environment-name: pygmt
6060
create-args: >-

AUTHORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following people have contributed code and/or documentation to the project
2626
| [Wei Ji Leong](https://github.com/weiji14) | [0000-0003-2354-1988](https://orcid.org/0000-0003-2354-1988) | Development Seed, USA |
2727
| [William Schlitzer](https://github.com/willschlitzer) | [0000-0002-5843-2282](https://orcid.org/0000-0002-5843-2282) | Unaffiliated |
2828
| [Yohai Magen](https://github.com/yohaimagen) | [0000-0002-4892-4013](https://orcid.org/0000-0002-4892-4013) | Tel Aviv University, Israel |
29-
| [Yvonne Fröhlich](https://github.com/yvonnefroehlich) | [0000-0002-8566-0619](https://orcid.org/0000-0002-8566-0619) | Karlsruhe Institute of Technology, Germany |
29+
| [Yvonne Fröhlich](https://github.com/yvonnefroehlich) | [0000-0002-8566-0619](https://orcid.org/0000-0002-8566-0619) | Unaffiliated |
3030

3131
Individuals who have made significant contributions to PyGMT are recognized on the
3232
[PyGMT Team](https://www.pygmt.org/dev/team.html) page.

examples/gallery/images/cross_section.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
# lon_min, lon_max, lat_min, lat_max in degrees East and North
2020
region_map = [122, 149, 30, 49]
2121

22+
# Chose a survey line with start point A and end point B
23+
lonA, latA, lonB, latB = 126, 42, 146, 40 # noqa: N816
24+
2225
# Create a new pygmt.Figure instance
2326
fig = pygmt.Figure()
2427

@@ -39,30 +42,25 @@
3942
fig.colorbar(
4043
# Place the colorbar inside the plot (lowercase "j") in the Bottom Right (BR)
4144
# corner with an offset ("+o") of 0.7 centimeters and 0.3 centimeters in x- or y-
42-
# directions, respectively; move the x label above the horizontal colorbar ("+ml")
45+
# directions, respectively; move the x-label above the horizontal colorbar ("+ml")
4346
position="jBR+o0.7c/0.8c+h+w5c/0.3c+ml",
4447
# Add a box around the colobar with a fill ("+g") in "white" color and a
4548
# transparency ("@") of 30 % and with a 0.8-points thick, black, outline ("+p")
4649
box="+gwhite@30+p0.8p,black",
47-
# Add x and y labels ("+l")
50+
# Add x- and y-labels ("+l")
4851
frame=["x+lElevation", "y+lm"],
4952
)
5053

51-
# Choose a survey line
52-
fig.plot(
53-
x=[126, 146], # Longitude in degrees East
54-
y=[42, 40], # Latitude in degrees North
55-
# Draw a 2-points thick, red, dashed line for the survey line
56-
pen="2p,red,dashed",
57-
)
54+
# Plot the survey line
55+
fig.plot(x=[lonA, lonB], y=[latA, latB], pen="1p,red,solid")
5856

5957
# Add labels "A" and "B" for the start and end points of the survey line
6058
fig.text(
61-
x=[126, 146],
62-
y=[42, 40],
59+
x=[lonA, lonB],
60+
y=[latA, latB],
6361
text=["A", "B"],
64-
offset="0c/0.2c", # Move text 0.2 centimeters up (y-direction)
65-
font="15p", # Use a font size of 15 points
62+
offset="0c/0.3c", # Move text 0.2 centimeters up (y-direction)
63+
font="15p,red", # Use a red font with a size of 15 points
6664
)
6765

6866
# ----------------------------------------------------------------------------
@@ -75,9 +73,7 @@
7573
region=[0, 15, -8000, 6000], # x_min, x_max, y_min, y_max
7674
# Cartesian projection with a width of 12 centimeters and a height of 3 centimeters
7775
projection="X12c/3c",
78-
# Add annotations ("a") and ticks ("f") as well as labels ("+l") at the west or
79-
# left and south or bottom sides ("WSrt")
80-
frame=["WSrt", "xa2f1+lDistance+u°", "ya4000+lElevation / m"],
76+
frame=0,
8177
)
8278

8379
# Add labels "A" and "B" for the start and end points of the survey line
@@ -86,14 +82,14 @@
8682
y=[7000, 7000],
8783
text=["A", "B"],
8884
no_clip=True, # Do not clip text that fall outside the plot bounds
89-
font="10p", # Use a font size of 10 points
85+
font="10p,red",
9086
)
9187

9288
# Generate points along a great circle corresponding to the survey line and store them
9389
# in a pandas.DataFrame
9490
track_df = pygmt.project(
95-
center=[126, 42], # Start point of survey line (longitude, latitude)
96-
endpoint=[146, 40], # End point of survey line (longitude, latitude)
91+
center=[lonA, latA], # Start point of survey line (longitude, latitude)
92+
endpoint=[lonB, latB], # End point of survey line (longitude, latitude)
9793
generate=0.1, # Output data in steps of 0.1 degrees
9894
)
9995

@@ -106,19 +102,22 @@
106102
x=[0, 15],
107103
y=[0, 0],
108104
fill="lightblue", # Fill the polygon in "lightblue"
109-
# Draw a 0.25-points thick, black, solid outline
110-
pen="0.25p,black,solid",
105+
pen="0.25p,black,solid", # Draw a 0.25-points thick, black, solid outline
111106
close="+y-8000", # Force closed polygon
112107
)
113108

114109
# Plot elevation along the survey line
115110
fig.plot(
116111
x=track_df.p,
117112
y=track_df.elevation,
118-
fill="gray", # Fill the polygon in "gray"
119-
# Draw a 1-point thick, black, solid outline
120-
pen="1p,black,solid",
121-
close="+y-8000", # Force closed polygon
113+
fill="gray",
114+
pen="1p,red,solid",
115+
close="+y-8000",
122116
)
123117

118+
# Add map frame
119+
# Add annotations ("a") and ticks ("f") as well as labels ("+l") at the west or left
120+
# and south or bottom sides ("WSrt")
121+
fig.basemap(frame=["WSrt", "xa2f1+lDistance+u°", "ya4000+lElevation / m"])
122+
124123
fig.show()

pygmt/src/makecpt.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ def makecpt(**kwargs):
121121
level :func:`pygmt.makecpt` is called.
122122
reverse : str
123123
Set this to ``True`` or **c** [Default] to reverse the sense of color
124-
progression in the master CPT. Set this to **z** to reverse the sign
125-
of z-values in the color table. Note that this change of z-direction
126-
happens before ``truncate`` and ``series`` values are used so the
127-
latter must be compatible with the changed z-range. See also
124+
progression in the master CPT. Also the foreground and background colors
125+
are exchanged, including those specified by :gmt-term:`COLOR_BACKGROUND` and
126+
:gmt-term:`COLOR_FOREGROUND`. Set this to **z** to reverse the sign of z-values
127+
in the color table. Note that this change of the z-direction happens before
128+
the ``truncate`` and ``series`` values are used, so the latter must be
129+
compatible with the changed z-range. See also
128130
:gmt-docs:`reference/features.html#manipulating-cpts`.
129131
overrule_bg : str
130132
Overrule background, foreground, and NaN colors specified in the master

0 commit comments

Comments
 (0)