Plot colormap and colorbar indicating scale

I have a. txt format file which have 3 coloumn long, lat, z value. I want to make an colormap and colorbar indicating the scale.I am using gmt 6.

I’m afraid that the answer to your question is that you need to learn about creating grids (or using them) and making images. Please read this tutorial https://docs.generic-mapping-tools.org/dev/tutorial/session-3.html#gridding-of-arbitrarily-spaced-data