Skip to content

Update modern mode script given -H option to makecpt/grd2cpt #827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/examples/anim02/anim_02.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ else # Make animated GIF
fi
# 1. Create files needed in the loop
cat << EOF > pre.sh
gmt begin
gmt math -T0/360/10 T 180 ADD = angles.txt
gmt makecpt -Crainbow -T500/4500 > main.cpt
gmt makecpt -Crainbow -T500/4500 -H > main.cpt
gmt end
EOF
# 2. Set up the main frame script
cat << EOF > main.sh
Expand Down
4 changes: 3 additions & 1 deletion doc/examples/anim03/anim_03.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ else # Make animated GIF, infinitely looping
fi
# 1. Create files needed in the loop
cat << EOF > pre.sh
gmt begin
gmt math -T0/355/5 -o1 T = angles.txt
gmt makecpt -Crelief -T-2000/2000/20 > iceland.cpt
gmt makecpt -Crelief -T-2000/2000/20 -H > iceland.cpt
gmt grdclip -Sb0/-1 -Gabove.nc @Iceland.nc
gmt end
EOF
# 2. Set up the main frame script
cat << EOF > main.sh
Expand Down
8 changes: 5 additions & 3 deletions doc/examples/anim04/anim_04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ fi
# 1. Create files needed in the loop
cat << EOF > pre.sh
# Set up flight path
gmt project -C-73.8333/40.75 -E-80.133/25.75 -G10 -Q > flight_path.txt
gmt grdgradient @USEast_Coast.nc -A90 -Nt1 -Gint_US.nc
gmt makecpt -Cglobe > globe_US.cpt
gmt begin
gmt project -C-73.8333/40.75 -E-80.133/25.75 -G10 -Q > flight_path.txt
gmt grdgradient @USEast_Coast.nc -A90 -Nt1 -Gint_US.nc
gmt makecpt -Cglobe -H > globe_US.cpt
gmt end
EOF
# 2. Set up the main frame script
cat << EOF > main.sh
Expand Down
4 changes: 3 additions & 1 deletion doc/examples/anim05/anim_05.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ else # Make animated GIF, infinitely looping
fi
# 1. Create files needed in the loop
cat << EOF > pre.sh
gmt makecpt -Cpolar -T-25/25 > t.cpt
gmt begin
gmt makecpt -Cpolar -T-25/25 -H > t.cpt
gmt end
EOF
# 2. Set up the main frame script
cat << EOF > main.sh
Expand Down
16 changes: 9 additions & 7 deletions doc/examples/anim07/anim_07.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ else # Make movie in MP4 format and a thumbnail animated GIF using every 10th fr
fi
# 1. Create background plot and data files needed in the loop
cat << EOF > pre.sh
# Set view and sun longitudes
gmt math -T0/360/5 -I T 5 SUB = longitudes.txt
# Extract a topography CPT
gmt makecpt -Cdem2 -T0/6000 > movie_dem.cpt
# Get gradients of the relief from N45E
gmt grdgradient @earth_relief_20m -Nt1.25 -A45 -Gintens.nc
gmt begin
# Set view and sun longitudes
gmt math -T0/360/5 -I T 5 SUB = longitudes.txt
# Extract a topography CPT
gmt makecpt -Cdem2 -T0/6000 -H > t.cpt
# Get gradients of the relief from N45E
gmt grdgradient @earth_relief_20m -Nt1.25 -A45 -Gintens.nc
gmt end
EOF
# 2. Set up main script
cat << EOF > main.sh
Expand All @@ -33,7 +35,7 @@ gmt begin
# Clip to expose land areas only
gmt coast -Gc
# Overlay relief over land only using dem cpt
gmt grdimage @earth_relief_20m -Is.nc -Cmovie_dem.cpt
gmt grdimage @earth_relief_20m -Is.nc -Ct.cpt
# Undo clipping and overlay gridlines
gmt coast -Q -B30g30
gmt end
Expand Down
10 changes: 6 additions & 4 deletions doc/examples/anim08/anim_08.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@ TIME="starttime=2018-01-01%2000:00:00&endtime=2018-12-31%2000:00:00"
MAG="minmagnitude=5"
ORDER="orderby=time-asc"
URL="\${SITE}?\${TIME}&\${MAG}&\${ORDER}"
gmt convert \$URL -i2,1,3,4+s50,0 -hi1 > q.txt
gmt makecpt -Cred,green,blue -T0,70,300,10000 > q.cpt
gmt math -T2018-01-01T/2018-12-31T/2 --TIME_UNIT=d TNORM 40 MUL 200 ADD = times.txt
gmt begin
gmt convert \$URL -i2,1,3,4+s50,0 -hi1 > q.txt
gmt makecpt -Cred,green,blue -T0,70,300,10000 -H > movie_dem.cpt
gmt math -T2018-01-01T/2018-12-31T/2 --TIME_UNIT=d TNORM 40 MUL 200 ADD = times.txt
gmt end
EOF
# 2. Set up main script
cat << EOF > main.sh
gmt begin
gmt coast -Rg -JG\${MOVIE_COL1}/5/6i -G128 -S32 -X0 -Y0 -A500
gmt plot @ridge.txt -W0.5p,darkyellow
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
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
gmt end
EOF
# 3. Run the movie
Expand Down
17 changes: 14 additions & 3 deletions doc/rst/source/grd2cpt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ Synopsis
[ |-C|\ *cpt* ] [ |-D|\ [**i**] ]
[ |-E|\ [*nlevels*] ]
[ |-F|\ [**R**\ \|\ **r**\ \|\ **h**\ \|\ **c**\ ][**+c**\ ]]
[ |-G|\ *zlo*\ /\ *zhi* ] [ |-I|\ [**c**][**z**] ]
[ |-G|\ *zlo*\ /\ *zhi* ]
[ |-H| ]
[ |-I|\ [**c**][**z**] ]
[ |-L|\ *minlimit/maxlimit* ]
[ |-M| ] [ |-N| ]
[ |-M| ]
[ |-N| ]
[ |-Q|\ [**i**\ \|\ **o**] ]
[ |SYN_OPT-R| ]
[ |-S|\ **h**\ \|\ **l**\ \|\ **m**\ \|\ **u** ]
Expand All @@ -35,7 +38,9 @@ Description
-----------

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

.. _-H:

**-H**\
Modern mode only: Write the CPT to standard output as well [Default saves
the CPT as the session current CPT].

.. _-I:

**-I**\ [**c**][**z**]
Expand Down
17 changes: 14 additions & 3 deletions doc/rst/source/makecpt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ Synopsis
[ |-E|\ [*nlevels*] ]
[ |-F|\ [**R**\ \|\ **r**\ \|\ **h**\ \|\ **c**\ ][**+c**\ ]]
[ |-G|\ *zlo*\ /\ *zhi* ]
[ |-I|\ [**c**][**z**] ] [ |-M| ]
[ |-N| ] [ |-Q| ]
[ |-H| ]
[ |-I|\ [**c**][**z**] ]
[ |-M| ]
[ |-N| ]
[ |-Q| ]
[ |-S|\ *mode* ]
[ |-T|\ [*min*/*max*/*inc*\ [**+n**\ ]\|\ *file*\ \|\ *list*\ ] ]
[ |-V|\ [*level*\ ] ]
Expand All @@ -37,7 +40,9 @@ Description
-----------

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

.. _-H:

**-H**\
Modern mode only: Write the CPT to standard output as well [Default saves
the CPT as the session current CPT].

.. _-I:

**-I**\ [**c**][**z**]
Expand Down
8 changes: 4 additions & 4 deletions doc/scripts/GMT_App_M_1a.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ do
j=`expr $i + 1`
left=`sed -n ${j}p tt.lis`
right=`sed -n ${i}p tt.lis`
gmt makecpt -C$left > tt.left.cpt
gmt makecpt -C$left -T-1/1/0.25 > tt.left2.cpt
gmt makecpt -C$right > tt.right.cpt
gmt makecpt -C$right -T-1/1/0.25 > tt.right2.cpt
gmt makecpt -H -C$left > tt.left.cpt
gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
gmt makecpt -H -C$right > tt.right.cpt
gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
gmt colorbar -D1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
gmt colorbar -D4.50i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
gmt colorbar -D1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25
Expand Down
8 changes: 4 additions & 4 deletions doc/scripts/GMT_App_M_1b.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ do
j=`expr $i + 1`
left=`sed -n ${j}p tt.lis`
right=`sed -n ${i}p tt.lis`
gmt makecpt -C$left > tt.left.cpt
gmt makecpt -C$left -T-1/1/0.25 > tt.left2.cpt
gmt makecpt -C$right > tt.right.cpt
gmt makecpt -C$right -T-1/1/0.25 > tt.right2.cpt
gmt makecpt -H -C$left > tt.left.cpt
gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
gmt makecpt -H -C$right > tt.right.cpt
gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
gmt colorbar -D1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
gmt colorbar -D4.50i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
gmt colorbar -D1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25
Expand Down
8 changes: 4 additions & 4 deletions doc/scripts/GMT_App_M_1c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ do
j=`expr $i + 1`
left=`sed -n ${j}p tt.lis`
right=`sed -n ${i}p tt.lis`
gmt makecpt -C$left > tt.left.cpt
gmt makecpt -C$left -T-1/1/0.25 > tt.left2.cpt
gmt makecpt -C$right > tt.right.cpt
gmt makecpt -C$right -T-1/1/0.25 > tt.right2.cpt
gmt makecpt -H -C$left > tt.left.cpt
gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
gmt makecpt -H -C$right > tt.right.cpt
gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
gmt colorbar -D1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
gmt colorbar -D4.50i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
gmt colorbar -D1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25
Expand Down
4 changes: 2 additions & 2 deletions doc/scripts/GMT_App_O_9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ gmt set FORMAT_GEO_MAP ddd:mm:ssF FONT_ANNOT_PRIMARY +9p FONT_TITLE 22p
gmt project -E-74/41 -C-17/28 -G10 -Q > great_NY_Canaries.txt
gmt project -E-74/41 -C2.33/48.87 -G100 -Q > great_NY_Paris.txt
km=`echo -17 28 | gmt mapproject -G-74/41+uk -fg --FORMAT_FLOAT_OUT=%.0f -o2`
gmt makecpt -Clightred,lightyellow,lightgreen -T0,3,6,100 -N > ttt.cpt
gmt grdimage @App_O_ttt.nc -Itopo5_int.nc -Cttt.cpt $R -JM5.3i -nc+t1
gmt makecpt -Clightred,lightyellow,lightgreen -T0,3,6,100 -N
gmt grdimage @App_O_ttt.nc -Itopo5_int.nc -C $R -JM5.3i -nc+t1
gmt grdcontour @App_O_ttt.nc -C0.5 -A1+u" hour"+v+f8p,Bookman-Demi \
-GL80W/31N/17W/26N,17W/28N/17W/50N -S2
gmt plot -Wfatter,white great_NY_Canaries.txt
Expand Down
8 changes: 4 additions & 4 deletions doc/scripts/GMT_CPTscale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ gmt plot -R0/6/0/6 -Jx1i -W0.25p << EOF
5 0.785
EOF
gmt colorbar -Cglobe -Baf -Dx3i/1.5i+w2.8i/0.15i+jCM -W0.001
gmt makecpt -Cglobe -T-500/3000 > t.cpt
gmt colorbar -Ct.cpt -Baf -Dx5i/1.5i+w2.0i/0.15i+jLM -W0.001
gmt makecpt -Cglobe -G-3000/5000 -T-500/3000 > t.cpt
gmt colorbar -Ct.cpt -Baf -Dx1i/1.5i+w2.0i/0.15i+jRM+ma -W0.001
gmt makecpt -Cglobe -T-500/3000
gmt colorbar -C -Baf -Dx5i/1.5i+w2.0i/0.15i+jLM -W0.001
gmt makecpt -Cglobe -G-3000/5000 -T-500/3000
gmt colorbar -C -Baf -Dx1i/1.5i+w2.0i/0.15i+jRM+ma -W0.001
gmt text -N -F+f14p+j << EOF
0 0 LB Scale a subset (via @%1%-G@%%)
6 0 RB Scale entire range
Expand Down
12 changes: 6 additions & 6 deletions doc/scripts/GMT_color_interpolate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ gmt begin GMT_color_interpolate ps
gmt basemap -Jx1i -R0/6.8/0/2.0 -B0

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

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

gmt plot -Sd0.1i -Wblack -Gwhite << END
0.2 1.6
Expand Down
6 changes: 3 additions & 3 deletions doc/scripts/GMT_colorbar.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
gmt begin GMT_colorbar ps
gmt makecpt -T-15/15 -Cpolar > t.cpt
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
gmt colorbar -Ct.cpt -Baf -Bx+u"\\232" -By+l@~D@~T -DJBC+e
gmt makecpt -T-15/15 -Cpolar
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
gmt colorbar -C -Baf -Bx+u"\\232" -By+l@~D@~T -DJBC+e
gmt end
6 changes: 3 additions & 3 deletions doc/scripts/GMT_cyclic.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
gmt begin GMT_cyclic ps
gmt makecpt -T0/100 -Cjet -Ww > t.cpt
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
gmt colorbar -Ct.cpt -Baf -DJBC
gmt makecpt -T0/100 -Cjet -Ww
gmt basemap -R0/20/0/1 -JM5i -BWse -Baf
gmt colorbar -C -Baf -DJBC
gmt end
14 changes: 7 additions & 7 deletions doc/scripts/GMT_hinge.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
gmt begin GMT_hinge ps
gmt makecpt -Cglobe -T-8000/3000 > t.cpt
gmt colorbar -Ct.cpt -Baf -Dx0/0+w4.5i/0.1i+h -W0.001
gmt colorbar -Cglobe -Baf -Dx0/0+w4.5i/0.1i+h -W0.001 -Y0.5i
echo 2.25 0.1 90 0.2i | gmt plot -R0/4.5/0/1 -Jx1i -Sv0.1i+a80+b -W1p -Gblack
gmt text -F+f12p+jCB << EOF
2.25 0.35 HINGE
EOF
gmt makecpt -Cglobe -T-8000/3000
gmt colorbar -C -Baf -Dx0/0+w4.5i/0.1i+h -W0.001
gmt colorbar -Cglobe -Baf -Dx0/0+w4.5i/0.1i+h -W0.001 -Y0.5i
echo 2.25 0.1 90 0.2i | gmt plot -R0/4.5/0/1 -Jx1i -Sv0.1i+a80+b -W1p -Gblack
gmt text -F+f12p+jCB <<- EOF
2.25 0.35 HINGE
EOF
gmt end
14 changes: 7 additions & 7 deletions doc/scripts/GMT_tut_14.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
gmt begin GMT_tut_14 ps
gmt makecpt -Crainbow -T-20/60/10 > disc.cpt
gmt makecpt -Crainbow -T-20/60 > cont.cpt
gmt basemap -R0/6/0/9 -Jx1i -B0 -Xc
gmt colorbar -Dx1i/1i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete
gmt colorbar -Dx1i/3i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous
gmt colorbar -Dx1i/5i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete -I0.5
gmt colorbar -Dx1i/7i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous -I0.5
gmt makecpt -H -Crainbow -T-20/60/10 > disc.cpt
gmt makecpt -H -Crainbow -T-20/60 > cont.cpt
gmt basemap -R0/6/0/9 -Jx1i -B0 -Xc
gmt colorbar -Dx1i/1i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete
gmt colorbar -Dx1i/3i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous
gmt colorbar -Dx1i/5i+w4i/0.5i+h -Cdisc.cpt -Ba -B+tdiscrete -I0.5
gmt colorbar -Dx1i/7i+w4i/0.5i+h -Ccont.cpt -Ba -B+tcontinuous -I0.5
gmt end
6 changes: 3 additions & 3 deletions doc/scripts/GMT_tut_15.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
gmt begin GMT_tut_15 ps
gmt makecpt -Crainbow -T1000/5000 > topo.cpt
gmt grdimage @tut_relief.nc -JM6i -Ba -BWSnE -Ctopo.cpt
gmt colorbar -DJTC -Rtut_relief.nc -Ctopo.cpt -I0.4 -Bxa -By+lm
gmt makecpt -Crainbow -T1000/5000
gmt grdimage @tut_relief.nc -JM6i -Ba -BWSnE -C
gmt colorbar -DJTC -Rtut_relief.nc -C -I0.4 -Bxa -By+lm
gmt end
8 changes: 4 additions & 4 deletions doc/scripts/GMT_tut_16.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
gmt begin GMT_tut_16 ps
gmt makecpt -Crainbow -T1000/5000 > topo.cpt
gmt grdgradient @tut_relief.nc -Ne0.8 -A100 -fg -Gus_i.nc
gmt grdimage tut_relief.nc -Ius_i.nc -JM6i -Ba -BWSnE -Ctopo.cpt
gmt colorbar -DJTC -Rtut_relief.nc -Ctopo.cpt -I0.4 -Bxa -By+lm
gmt makecpt -Crainbow -T1000/5000
gmt grdgradient @tut_relief.nc -Ne0.8 -A100 -fg -Gus_i.nc
gmt grdimage tut_relief.nc -Ius_i.nc -JM6i -Ba -BWSnE -C
gmt colorbar -DJTC -Rtut_relief.nc -C -I0.4 -Bxa -By+lm
gmt end
4 changes: 2 additions & 2 deletions doc/scripts/GMT_tut_19.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
gmt begin GMT_tut_19 ps
gmt makecpt -Ctopo -T1000/5000 > t.cpt
gmt makecpt -Ctopo -T1000/5000
gmt grdgradient @tut_relief.nc -Ne0.8 -A100 -fg -Gus_i.nc
gmt grdview tut_relief.nc -JM4i -p135/35 -Qi50 -Ius_i.nc -Ct.cpt -Ba -JZ0.5i
gmt grdview tut_relief.nc -JM4i -p135/35 -Qi50 -Ius_i.nc -C -Ba -JZ0.5i
gmt end

6 changes: 3 additions & 3 deletions doc/scripts/GMT_tut_9.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
gmt begin GMT_tut_9 ps
gmt makecpt -Cred,green,blue -T0,100,300,10000 > quakes.cpt
gmt coast -R130/150/35/50 -JM6i -B5 -Ggray
gmt plot @tut_quakes.ngdc -Wfaint -i4,3,5,6+s0.1 -h3 -Scc -Cquakes.cpt
gmt makecpt -Cred,green,blue -T0,100,300,10000
gmt coast -R130/150/35/50 -JM6i -B5 -Ggray
gmt plot @tut_quakes.ngdc -Wfaint -i4,3,5,6+s0.1 -h3 -Scc -C -Vl
gmt end
2 changes: 1 addition & 1 deletion src/gmt_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ bool gmt_consider_current_cpt (struct GMTAPI_CTRL *API, bool *active, char **arg
gmt_M_str_free (*arg);
*arg = strdup (string); /* Pass back the name of the current CPT with modifers */
}
else if ((*arg)[0] == '\0') { /* Noting given */
else if (*arg == NULL) { /* Noting given */
if ((cpt = gmt_get_current_cpt (API->GMT)) == NULL) return false; /* No current CPT */
*arg = strdup (cpt); /* Pass back the name of the current CPT */
}
Expand Down
Loading