Skip to content

Commit e176a96

Browse files
authored
Update modern mode script given -H option to makecpt/grd2cpt (#827)
* Let makecpt and grd2cpt get -H under modern mode See #823 for context. * Using -H * Update psevents.c Forgot about pssvents. * Update modern scripts
1 parent 749f1d9 commit e176a96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+219
-145
lines changed

doc/examples/anim02/anim_02.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ else # Make animated GIF
1414
fi
1515
# 1. Create files needed in the loop
1616
cat << EOF > pre.sh
17+
gmt begin
1718
gmt math -T0/360/10 T 180 ADD = angles.txt
18-
gmt makecpt -Crainbow -T500/4500 > main.cpt
19+
gmt makecpt -Crainbow -T500/4500 -H > main.cpt
20+
gmt end
1921
EOF
2022
# 2. Set up the main frame script
2123
cat << EOF > main.sh

doc/examples/anim03/anim_03.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ else # Make animated GIF, infinitely looping
1414
fi
1515
# 1. Create files needed in the loop
1616
cat << EOF > pre.sh
17+
gmt begin
1718
gmt math -T0/355/5 -o1 T = angles.txt
18-
gmt makecpt -Crelief -T-2000/2000/20 > iceland.cpt
19+
gmt makecpt -Crelief -T-2000/2000/20 -H > iceland.cpt
1920
gmt grdclip -Sb0/-1 -Gabove.nc @Iceland.nc
21+
gmt end
2022
EOF
2123
# 2. Set up the main frame script
2224
cat << EOF > main.sh

doc/examples/anim04/anim_04.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ fi
1515
# 1. Create files needed in the loop
1616
cat << EOF > pre.sh
1717
# Set up flight path
18-
gmt project -C-73.8333/40.75 -E-80.133/25.75 -G10 -Q > flight_path.txt
19-
gmt grdgradient @USEast_Coast.nc -A90 -Nt1 -Gint_US.nc
20-
gmt makecpt -Cglobe > globe_US.cpt
18+
gmt begin
19+
gmt project -C-73.8333/40.75 -E-80.133/25.75 -G10 -Q > flight_path.txt
20+
gmt grdgradient @USEast_Coast.nc -A90 -Nt1 -Gint_US.nc
21+
gmt makecpt -Cglobe -H > globe_US.cpt
22+
gmt end
2123
EOF
2224
# 2. Set up the main frame script
2325
cat << EOF > main.sh

doc/examples/anim05/anim_05.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ else # Make animated GIF, infinitely looping
1414
fi
1515
# 1. Create files needed in the loop
1616
cat << EOF > pre.sh
17-
gmt makecpt -Cpolar -T-25/25 > t.cpt
17+
gmt begin
18+
gmt makecpt -Cpolar -T-25/25 -H > t.cpt
19+
gmt end
1820
EOF
1921
# 2. Set up the main frame script
2022
cat << EOF > main.sh

doc/examples/anim07/anim_07.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ else # Make movie in MP4 format and a thumbnail animated GIF using every 10th fr
1414
fi
1515
# 1. Create background plot and data files needed in the loop
1616
cat << EOF > pre.sh
17-
# Set view and sun longitudes
18-
gmt math -T0/360/5 -I T 5 SUB = longitudes.txt
19-
# Extract a topography CPT
20-
gmt makecpt -Cdem2 -T0/6000 > movie_dem.cpt
21-
# Get gradients of the relief from N45E
22-
gmt grdgradient @earth_relief_20m -Nt1.25 -A45 -Gintens.nc
17+
gmt begin
18+
# Set view and sun longitudes
19+
gmt math -T0/360/5 -I T 5 SUB = longitudes.txt
20+
# Extract a topography CPT
21+
gmt makecpt -Cdem2 -T0/6000 -H > t.cpt
22+
# Get gradients of the relief from N45E
23+
gmt grdgradient @earth_relief_20m -Nt1.25 -A45 -Gintens.nc
24+
gmt end
2325
EOF
2426
# 2. Set up main script
2527
cat << EOF > main.sh
@@ -33,7 +35,7 @@ gmt begin
3335
# Clip to expose land areas only
3436
gmt coast -Gc
3537
# Overlay relief over land only using dem cpt
36-
gmt grdimage @earth_relief_20m -Is.nc -Cmovie_dem.cpt
38+
gmt grdimage @earth_relief_20m -Is.nc -Ct.cpt
3739
# Undo clipping and overlay gridlines
3840
gmt coast -Q -B30g30
3941
gmt end

doc/examples/anim08/anim_08.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@ TIME="starttime=2018-01-01%2000:00:00&endtime=2018-12-31%2000:00:00"
2121
MAG="minmagnitude=5"
2222
ORDER="orderby=time-asc"
2323
URL="\${SITE}?\${TIME}&\${MAG}&\${ORDER}"
24-
gmt convert \$URL -i2,1,3,4+s50,0 -hi1 > q.txt
25-
gmt makecpt -Cred,green,blue -T0,70,300,10000 > q.cpt
26-
gmt math -T2018-01-01T/2018-12-31T/2 --TIME_UNIT=d TNORM 40 MUL 200 ADD = times.txt
24+
gmt begin
25+
gmt convert \$URL -i2,1,3,4+s50,0 -hi1 > q.txt
26+
gmt makecpt -Cred,green,blue -T0,70,300,10000 -H > movie_dem.cpt
27+
gmt math -T2018-01-01T/2018-12-31T/2 --TIME_UNIT=d TNORM 40 MUL 200 ADD = times.txt
28+
gmt end
2729
EOF
2830
# 2. Set up main script
2931
cat << EOF > main.sh
3032
gmt begin
3133
gmt coast -Rg -JG\${MOVIE_COL1}/5/6i -G128 -S32 -X0 -Y0 -A500
3234
gmt plot @ridge.txt -W0.5p,darkyellow
33-
gmt events q.txt -SE- -Cq.cpt --TIME_UNIT=d -T\${MOVIE_COL0} -Es+r2+d6 -Ms5+c0.5 -Mi1+c-0.6 -Mt+c0
35+
gmt events q.txt -SE- -Cmovie_dem.cpt --TIME_UNIT=d -T\${MOVIE_COL0} -Es+r2+d6 -Ms5+c0.5 -Mi1+c-0.6 -Mt+c0
3436
gmt end
3537
EOF
3638
# 3. Run the movie

doc/rst/source/grd2cpt.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ Synopsis
1717
[ |-C|\ *cpt* ] [ |-D|\ [**i**] ]
1818
[ |-E|\ [*nlevels*] ]
1919
[ |-F|\ [**R**\ \|\ **r**\ \|\ **h**\ \|\ **c**\ ][**+c**\ ]]
20-
[ |-G|\ *zlo*\ /\ *zhi* ] [ |-I|\ [**c**][**z**] ]
20+
[ |-G|\ *zlo*\ /\ *zhi* ]
21+
[ |-H| ]
22+
[ |-I|\ [**c**][**z**] ]
2123
[ |-L|\ *minlimit/maxlimit* ]
22-
[ |-M| ] [ |-N| ]
24+
[ |-M| ]
25+
[ |-N| ]
2326
[ |-Q|\ [**i**\ \|\ **o**] ]
2427
[ |SYN_OPT-R| ]
2528
[ |-S|\ **h**\ \|\ **l**\ \|\ **m**\ \|\ **u** ]
@@ -35,7 +38,9 @@ Description
3538
-----------
3639

3740
**grd2cpt** reads one or more grid files and writes a static color palette
38-
(CPT) file to standard output. The CPT is based on an existing dynamic
41+
(CPT) file. In classic mode we write the CMT to standard output, while under
42+
modern mode we simply save the CPT as the current session CPT (but see **-H**).
43+
The CPT is based on an existing dynamic
3944
master CPT of your choice, and the mapping from data value to
4045
colors is through the data's cumulative distribution function (CDF), so
4146
that the colors are histogram equalized. Thus if the grid(s) and the
@@ -129,6 +134,12 @@ Optional Arguments
129134
we leave that end of the CPT alone. The truncation takes place
130135
before any resampling. See also :ref:`manipulating_CPTs`
131136

137+
.. _-H:
138+
139+
**-H**\
140+
Modern mode only: Write the CPT to standard output as well [Default saves
141+
the CPT as the session current CPT].
142+
132143
.. _-I:
133144

134145
**-I**\ [**c**][**z**]

doc/rst/source/makecpt.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ Synopsis
1919
[ |-E|\ [*nlevels*] ]
2020
[ |-F|\ [**R**\ \|\ **r**\ \|\ **h**\ \|\ **c**\ ][**+c**\ ]]
2121
[ |-G|\ *zlo*\ /\ *zhi* ]
22-
[ |-I|\ [**c**][**z**] ] [ |-M| ]
23-
[ |-N| ] [ |-Q| ]
22+
[ |-H| ]
23+
[ |-I|\ [**c**][**z**] ]
24+
[ |-M| ]
25+
[ |-N| ]
26+
[ |-Q| ]
2427
[ |-S|\ *mode* ]
2528
[ |-T|\ [*min*/*max*/*inc*\ [**+n**\ ]\|\ *file*\ \|\ *list*\ ] ]
2629
[ |-V|\ [*level*\ ] ]
@@ -37,7 +40,9 @@ Description
3740
-----------
3841

3942
**makecpt** is a module that will help you make static color palette tables
40-
(CPTs). You define an equidistant set of contour intervals or pass
43+
(CPTs). In classic mode we write the CMT to standard output, while under
44+
modern mode we simply save the CPT as the current session CPT (but see **-H**).
45+
You define an equidistant set of contour intervals or pass
4146
your own z-table or list, and create a new CPT based on an existing master (dynamic)
4247
CPT. The resulting CPT can be reversed relative to the master
4348
cpt, and can be made continuous or discrete. For color tables beyond the
@@ -126,6 +131,12 @@ Optional Arguments
126131
we leave that end of the CPT alone. The truncation takes place
127132
before any resampling. See also :ref:`manipulating_CPTs`
128133

134+
.. _-H:
135+
136+
**-H**\
137+
Modern mode only: Write the CPT to standard output as well [Default saves
138+
the CPT as the session current CPT].
139+
129140
.. _-I:
130141

131142
**-I**\ [**c**][**z**]

doc/scripts/GMT_App_M_1a.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ do
4949
j=`expr $i + 1`
5050
left=`sed -n ${j}p tt.lis`
5151
right=`sed -n ${i}p tt.lis`
52-
gmt makecpt -C$left > tt.left.cpt
53-
gmt makecpt -C$left -T-1/1/0.25 > tt.left2.cpt
54-
gmt makecpt -C$right > tt.right.cpt
55-
gmt makecpt -C$right -T-1/1/0.25 > tt.right2.cpt
52+
gmt makecpt -H -C$left > tt.left.cpt
53+
gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
54+
gmt makecpt -H -C$right > tt.right.cpt
55+
gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
5656
gmt colorbar -D1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
5757
gmt colorbar -D4.50i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
5858
gmt colorbar -D1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25

doc/scripts/GMT_App_M_1b.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ do
4848
j=`expr $i + 1`
4949
left=`sed -n ${j}p tt.lis`
5050
right=`sed -n ${i}p tt.lis`
51-
gmt makecpt -C$left > tt.left.cpt
52-
gmt makecpt -C$left -T-1/1/0.25 > tt.left2.cpt
53-
gmt makecpt -C$right > tt.right.cpt
54-
gmt makecpt -C$right -T-1/1/0.25 > tt.right2.cpt
51+
gmt makecpt -H -C$left > tt.left.cpt
52+
gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
53+
gmt makecpt -H -C$right > tt.right.cpt
54+
gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
5555
gmt colorbar -D1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
5656
gmt colorbar -D4.50i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
5757
gmt colorbar -D1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25

doc/scripts/GMT_App_M_1c.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ do
4646
j=`expr $i + 1`
4747
left=`sed -n ${j}p tt.lis`
4848
right=`sed -n ${i}p tt.lis`
49-
gmt makecpt -C$left > tt.left.cpt
50-
gmt makecpt -C$left -T-1/1/0.25 > tt.left2.cpt
51-
gmt makecpt -C$right > tt.right.cpt
52-
gmt makecpt -C$right -T-1/1/0.25 > tt.right2.cpt
49+
gmt makecpt -H -C$left > tt.left.cpt
50+
gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
51+
gmt makecpt -H -C$right > tt.right.cpt
52+
gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
5353
gmt colorbar -D1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
5454
gmt colorbar -D4.50i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
5555
gmt colorbar -D1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25

doc/scripts/GMT_App_O_9.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ gmt set FORMAT_GEO_MAP ddd:mm:ssF FONT_ANNOT_PRIMARY +9p FONT_TITLE 22p
99
gmt project -E-74/41 -C-17/28 -G10 -Q > great_NY_Canaries.txt
1010
gmt project -E-74/41 -C2.33/48.87 -G100 -Q > great_NY_Paris.txt
1111
km=`echo -17 28 | gmt mapproject -G-74/41+uk -fg --FORMAT_FLOAT_OUT=%.0f -o2`
12-
gmt makecpt -Clightred,lightyellow,lightgreen -T0,3,6,100 -N > ttt.cpt
13-
gmt grdimage @App_O_ttt.nc -Itopo5_int.nc -Cttt.cpt $R -JM5.3i -nc+t1
12+
gmt makecpt -Clightred,lightyellow,lightgreen -T0,3,6,100 -N
13+
gmt grdimage @App_O_ttt.nc -Itopo5_int.nc -C $R -JM5.3i -nc+t1
1414
gmt grdcontour @App_O_ttt.nc -C0.5 -A1+u" hour"+v+f8p,Bookman-Demi \
1515
-GL80W/31N/17W/26N,17W/28N/17W/50N -S2
1616
gmt plot -Wfatter,white great_NY_Canaries.txt

doc/scripts/GMT_CPTscale.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ gmt plot -R0/6/0/6 -Jx1i -W0.25p << EOF
2121
5 0.785
2222
EOF
2323
gmt colorbar -Cglobe -Baf -Dx3i/1.5i+w2.8i/0.15i+jCM -W0.001
24-
gmt makecpt -Cglobe -T-500/3000 > t.cpt
25-
gmt colorbar -Ct.cpt -Baf -Dx5i/1.5i+w2.0i/0.15i+jLM -W0.001
26-
gmt makecpt -Cglobe -G-3000/5000 -T-500/3000 > t.cpt
27-
gmt colorbar -Ct.cpt -Baf -Dx1i/1.5i+w2.0i/0.15i+jRM+ma -W0.001
24+
gmt makecpt -Cglobe -T-500/3000
25+
gmt colorbar -C -Baf -Dx5i/1.5i+w2.0i/0.15i+jLM -W0.001
26+
gmt makecpt -Cglobe -G-3000/5000 -T-500/3000
27+
gmt colorbar -C -Baf -Dx1i/1.5i+w2.0i/0.15i+jRM+ma -W0.001
2828
gmt text -N -F+f14p+j << EOF
2929
0 0 LB Scale a subset (via @%1%-G@%%)
3030
6 0 RB Scale entire range

doc/scripts/GMT_color_interpolate.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ gmt begin GMT_color_interpolate ps
33
gmt basemap -Jx1i -R0/6.8/0/2.0 -B0
44

55
# Plot polar color map in the left; right (top) and wrong (bottom)
6-
gmt makecpt -Cpolar -T-1/1 > tmp.cpt
7-
gmt colorbar -D1.7/1.6+w3i/0.3i+h+jTC -Ctmp.cpt -B0.5f0.1
8-
gmt colorbar -D1.7/0.7+w3i/0.3i+h+jTC -Ctmp.cpt -B0.5f0.1 --COLOR_MODEL=hsv
6+
gmt makecpt -Cpolar -T-1/1
7+
gmt colorbar -D1.7/1.6+w3i/0.3i+h+jTC -C -B0.5f0.1
8+
gmt colorbar -D1.7/0.7+w3i/0.3i+h+jTC -C -B0.5f0.1 --COLOR_MODEL=hsv
99

1010
# Plot rainbow color map in the left; right (top) and wrong (bottom)
11-
gmt makecpt -Crainbow -T-1/1 > tmp.cpt
12-
gmt colorbar -D5.1/1.6+w3i/0.3i+h+jTC -Ctmp.cpt -B0.5f0.1
13-
gmt colorbar -D5.1/0.7+w3i/0.3i+h+jTC -Ctmp.cpt -B0.5f0.1 --COLOR_MODEL=rgb
11+
gmt makecpt -Crainbow -T-1/1
12+
gmt colorbar -D5.1/1.6+w3i/0.3i+h+jTC -C -B0.5f0.1
13+
gmt colorbar -D5.1/0.7+w3i/0.3i+h+jTC -C -B0.5f0.1 --COLOR_MODEL=rgb
1414

1515
gmt plot -Sd0.1i -Wblack -Gwhite << END
1616
0.2 1.6

doc/scripts/GMT_colorbar.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_colorbar ps
3-
gmt makecpt -T-15/15 -Cpolar > t.cpt
4-
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
5-
gmt colorbar -Ct.cpt -Baf -Bx+u"\\232" -By+l@~D@~T -DJBC+e
3+
gmt makecpt -T-15/15 -Cpolar
4+
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
5+
gmt colorbar -C -Baf -Bx+u"\\232" -By+l@~D@~T -DJBC+e
66
gmt end

doc/scripts/GMT_cyclic.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_cyclic ps
3-
gmt makecpt -T0/100 -Cjet -Ww > t.cpt
4-
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
5-
gmt colorbar -Ct.cpt -Baf -DJBC
3+
gmt makecpt -T0/100 -Cjet -Ww
4+
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
5+
gmt colorbar -C -Baf -DJBC
66
gmt end

doc/scripts/GMT_hinge.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_hinge ps
3-
gmt makecpt -Cglobe -T-8000/3000 > t.cpt
4-
gmt colorbar -Ct.cpt -Baf -Dx0/0+w4.5i/0.1i+h -W0.001
5-
gmt colorbar -Cglobe -Baf -Dx0/0+w4.5i/0.1i+h -W0.001 -Y0.5i
6-
echo 2.25 0.1 90 0.2i | gmt plot -R0/4.5/0/1 -Jx1i -Sv0.1i+a80+b -W1p -Gblack
7-
gmt text -F+f12p+jCB << EOF
8-
2.25 0.35 HINGE
9-
EOF
3+
gmt makecpt -Cglobe -T-8000/3000
4+
gmt colorbar -C -Baf -Dx0/0+w4.5i/0.1i+h -W0.001
5+
gmt colorbar -Cglobe -Baf -Dx0/0+w4.5i/0.1i+h -W0.001 -Y0.5i
6+
echo 2.25 0.1 90 0.2i | gmt plot -R0/4.5/0/1 -Jx1i -Sv0.1i+a80+b -W1p -Gblack
7+
gmt text -F+f12p+jCB <<- EOF
8+
2.25 0.35 HINGE
9+
EOF
1010
gmt end

doc/scripts/GMT_tut_14.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_tut_14 ps
3-
gmt makecpt -Crainbow -T-20/60/10 > disc.cpt
4-
gmt makecpt -Crainbow -T-20/60 > cont.cpt
5-
gmt basemap -R0/6/0/9 -Jx1i -B0 -Xc
6-
gmt colorbar -Dx1i/1i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete
7-
gmt colorbar -Dx1i/3i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous
8-
gmt colorbar -Dx1i/5i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete -I0.5
9-
gmt colorbar -Dx1i/7i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous -I0.5
3+
gmt makecpt -H -Crainbow -T-20/60/10 > disc.cpt
4+
gmt makecpt -H -Crainbow -T-20/60 > cont.cpt
5+
gmt basemap -R0/6/0/9 -Jx1i -B0 -Xc
6+
gmt colorbar -Dx1i/1i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete
7+
gmt colorbar -Dx1i/3i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous
8+
gmt colorbar -Dx1i/5i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete -I0.5
9+
gmt colorbar -Dx1i/7i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous -I0.5
1010
gmt end

doc/scripts/GMT_tut_15.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_tut_15 ps
3-
gmt makecpt -Crainbow -T1000/5000 > topo.cpt
4-
gmt grdimage @tut_relief.nc -JM6i -Ba -BWSnE -Ctopo.cpt
5-
gmt colorbar -DJTC -Rtut_relief.nc -Ctopo.cpt -I0.4 -Bxa -By+lm
3+
gmt makecpt -Crainbow -T1000/5000
4+
gmt grdimage @tut_relief.nc -JM6i -Ba -BWSnE -C
5+
gmt colorbar -DJTC -Rtut_relief.nc -C -I0.4 -Bxa -By+lm
66
gmt end

doc/scripts/GMT_tut_16.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_tut_16 ps
3-
gmt makecpt -Crainbow -T1000/5000 > topo.cpt
4-
gmt grdgradient @tut_relief.nc -Ne0.8 -A100 -fg -Gus_i.nc
5-
gmt grdimage tut_relief.nc -Ius_i.nc -JM6i -Ba -BWSnE -Ctopo.cpt
6-
gmt colorbar -DJTC -Rtut_relief.nc -Ctopo.cpt -I0.4 -Bxa -By+lm
3+
gmt makecpt -Crainbow -T1000/5000
4+
gmt grdgradient @tut_relief.nc -Ne0.8 -A100 -fg -Gus_i.nc
5+
gmt grdimage tut_relief.nc -Ius_i.nc -JM6i -Ba -BWSnE -C
6+
gmt colorbar -DJTC -Rtut_relief.nc -C -I0.4 -Bxa -By+lm
77
gmt end

doc/scripts/GMT_tut_19.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_tut_19 ps
3-
gmt makecpt -Ctopo -T1000/5000 > t.cpt
3+
gmt makecpt -Ctopo -T1000/5000
44
gmt grdgradient @tut_relief.nc -Ne0.8 -A100 -fg -Gus_i.nc
5-
gmt grdview tut_relief.nc -JM4i -p135/35 -Qi50 -Ius_i.nc -Ct.cpt -Ba -JZ0.5i
5+
gmt grdview tut_relief.nc -JM4i -p135/35 -Qi50 -Ius_i.nc -C -Ba -JZ0.5i
66
gmt end
77

doc/scripts/GMT_tut_9.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
gmt begin GMT_tut_9 ps
3-
gmt makecpt -Cred,green,blue -T0,100,300,10000 > quakes.cpt
4-
gmt coast -R130/150/35/50 -JM6i -B5 -Ggray
5-
gmt plot @tut_quakes.ngdc -Wfaint -i4,3,5,6+s0.1 -h3 -Scc -Cquakes.cpt
3+
gmt makecpt -Cred,green,blue -T0,100,300,10000
4+
gmt coast -R130/150/35/50 -JM6i -B5 -Ggray
5+
gmt plot @tut_quakes.ngdc -Wfaint -i4,3,5,6+s0.1 -h3 -Scc -C -Vl
66
gmt end

src/gmt_support.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ bool gmt_consider_current_cpt (struct GMTAPI_CTRL *API, bool *active, char **arg
13381338
gmt_M_str_free (*arg);
13391339
*arg = strdup (string); /* Pass back the name of the current CPT with modifers */
13401340
}
1341-
else if ((*arg)[0] == '\0') { /* Noting given */
1341+
else if (*arg == NULL) { /* Noting given */
13421342
if ((cpt = gmt_get_current_cpt (API->GMT)) == NULL) return false; /* No current CPT */
13431343
*arg = strdup (cpt); /* Pass back the name of the current CPT */
13441344
}

0 commit comments

Comments
 (0)