In the process of finding a way to create the log-scale colorbar I needed, I ran into a few unexpected issues. I don’t know if these are user errors or bugs. The script to create the sample figure is listed below the figure, and the CPT and annotation files are linked at the bottom.
- Custom axes (
-Bpxc
) - lines separating colors aren’t plotted for custom annotations withafg
, subplot a- I couldn’t find the
-Bpxc
option documented anywhere except Custom Axes, linked from a paragraph deep in the full-B
docs.
- I couldn’t find the
- With a log-scale,
-Q
, the calculated dimensions of the colorbar seem to be off (based on the colorbar box), see subplots b and c. - On a log-scale
-Q
colorbar, adding a unit label with-S+y
doesn’t work, subplotc
. The unit label is plotted with-By+l
, but this strips off the annotations as in subplotd
.
gmt begin sample_colorbar_issues png
gmt subplot begin 4x1 -Fs5i/0.25i -A+JLM -R0/1/0/1
gmt subplot set # a
gmt colorbar -Cseis_pgv.cpt.txt -DjCM+h -F -Q -Bpxc"annots.txt" -By+l"cm/s"
gmt subplot set # b
gmt colorbar -Cseis_pgv.cpt.txt -DjCM+h -F -Q
gmt subplot set # c
gmt colorbar -Cseis_pgv.cpt.txt -DjCM+h -F -Q -S+y"cm/s"
gmt subplot set # d
gmt colorbar -Cseis_pgv.cpt.txt -DjCM+h -F -Q -By+l"cm/s"
gmt subplot end
gmt end show
- seis_pgv.cpt.txt (462 Bytes) - created by hand with color picker to replicate a colleagues color scale
- annots.txt (117 Bytes) - created by hand, could be derived from CPT, e.g.
awk '{print $1, "afg"} END{print $3, "afg"}' seis_pgv.cpt.txt > annots.txt
$ tail -n 5 annots.txt
70 f
80 afg
90 f
100 afg
200 afg
Thanks,
Jason