I managed to get this figure.
In the legend, I plot circles but I would like to plot line. Is it possible to select it color from the cpt? I try this but it didn’t work S 0.1i - 0.15i - 4p,z=1930 0.3i 1930.
@maxrjones is that what you meant when you said I would have to do the legend manually?
Full script
gmt begin GMT_cycle_2 png
gmt set GMT_THEME cookbook
gmt makecpt -Ccategorical -T1930/1940/1 -F+c1930 -H > a.cpt
gmt plot @mississippi.txt -R0/1/0/50 -JX15c/7c -W1.5p,auto -Bxaf -Byaf+l"10@+3@+ m@+3@+/s" -BWSrt+t"Mississippi river annual discharge" -i0,1+s1e-3 -wy -g0z0.05+n --COLOR_SET=a.cpt
cat > neis.legend << END
H 16 1 Year
A a.cpt
D 0.1 1p
N 6
V 0 1p
S 0.1i c 0.15i z=1930 0.25p 0.3i 1930
S 0.1i c 0.15i z=1931 0.25p 0.3i 1931
S 0.1i c 0.15i z=1932 0.25p 0.3i 1932
S 0.1i c 0.15i z=1933 0.25p 0.3i 1933
S 0.1i c 0.15i z=1934 0.25p 0.3i 1934
S 0.1i c 0.15i z=1935 0.25p 0.3i 1935
S 0.1i c 0.15i z=1936 0.25p 0.3i 1936
S 0.1i c 0.15i z=1937 0.25p 0.3i 1937
S 0.1i c 0.15i z=1938 0.25p 0.3i 1938
S 0.1i c 0.15i z=1939 0.25p 0.3i 1939
S 0.1i c 0.15i z=1940 0.25p 0.3i 1940
END
gmt legend -DJBC+o0/0.4i+w15c -F+p+i+glightyellow+s neis.legend
gmt end
