gmt icon indicating copy to clipboard operation
gmt copied to clipboard

Custom annotations don't work for vertical colorbars

Open seisman opened this issue 3 years ago • 1 comments

Description of the problem

Custom annotations work for horizontal colorbars

gmt begin colorbar png
cat > Time_scale.txt << EOF
2021-01-01T00:00:00 a Jan 01
2021-03-01T00:00:00 a Mar 01
2021-05-01T00:00:00 a May 01
2021-07-01T00:00:00 a Jul 01
2021-09-01T00:00:00 a Sept 01
2021-10-05T00:00:00 a Oct 05
EOF
    gmt makecpt -Cseis -T2021-01-01T00:00:00/2021-10-05T00:00:00 -Ic
    gmt colorbar -C -D+w12c/0.3c+h+ma -Bpxc"Time_scale.txt"+l'Original Time' -F+gwhite+p0.5p,black
gmt end show

colorbar

But it doesn't work for vertical colorbars:

gmt begin colorbar png
cat > Time_scale.txt << EOF
2021-01-01T00:00:00 a Jan 01
2021-03-01T00:00:00 a Mar 01
2021-05-01T00:00:00 a May 01
2021-07-01T00:00:00 a Jul 01
2021-09-01T00:00:00 a Sept 01
2021-10-05T00:00:00 a Oct 05
EOF
    gmt makecpt -Cseis -T2021-01-01T00:00:00/2021-10-05T00:00:00 -Ic
    gmt colorbar -C -D+w12c/0.3c+v+ma -Bpxc"Time_scale.txt"+l'Original Time' -F+gwhite+p0.5p,black
gmt end show

colorbar

System information

  • GMT version (gmt --version): 6.5.0_48e03e9_2022.07.02

seisman avatar Jul 03 '22 12:07 seisman

I just tried to change -Bpxc to -Bpyc. It still doesn't work as I expect:

gmt begin colorbar png
cat > Time_scale.txt << EOF
2021-01-01T00:00:00 a Jan 01
2021-03-01T00:00:00 a Mar 01
2021-05-01T00:00:00 a May 01
2021-07-01T00:00:00 a Jul 01
2021-09-01T00:00:00 a Sept 01
2021-10-05T00:00:00 a Oct 05
EOF
    gmt makecpt -Cseis -T2021-01-01T00:00:00/2021-10-05T00:00:00 -Ic
    gmt colorbar -C -D+w12c/0.3c+v+ma -Bpyc"Time_scale.txt"+l'Original Time' -F+gwhite+p0.5p,black
gmt end show

colorbar

seisman avatar Jul 03 '22 12:07 seisman