# Color scale

**URL:** <https://forum.generic-mapping-tools.org/t/color-scale/4031>\
**Category:** Q&A\
**Created:** [June 13, 2023, 12:44pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031 "2023-06-13T12:44:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mostafa99](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mostafa99](https://forum.generic-mapping-tools.org/u/mostafa99)\
**Post date:** [June 13, 2023, 12:44pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031/1 "2023-06-13T12:44:59Z")

</div>

I am using GMT6.4.0. I could successfully plot colored points according to rgb color palette.

My result is below.

My problem is when I am trying to insert the color scale. The figure is corrupted.

Could you please help me? My GMT script is below.

rem xyz2grd depths.txt -Gtest.grd -R24/38/21.5/33.5 -I1m -V

surface depths.txt -Gtest.grd -R24/38/21.5/33.5 -I1m -V

grd2cpt test.grd -Crainbow -L0.0/175.2 -S0.01/1.3/0.01 -Qi -D0.0/175.2 \> rgb

rem nearneighbor depths.txt -Gtest.grd -R24/38/21.5/33.5 -I1m -V -S100k

pscoast -Jm0.4i -R24/38/21.5/33.5 -Ba5f0.g0./a5f0.g0.WSen -Lf26.5/22.7/20/200 -Df -A1 -W1p -Ir/1p,turquoise1 -P -V -Swhite -K \>\> testmap.ps

psscale -Dx8c/1c+w12c/0.5c+jTC+h -Jm -R -Q -O -Crgb -Bx5+lDepth -By+lkm \>\> testmap.ps

psxy motion.txt -Jm -R -Sc -Crgb -V -O -K \>\> testmap.ps

psxy station.txt -Jm -R -S -V -Wthin,red -O \>\> testmap.ps

psconvert -Tg -P -A testmap.ps

 ![testmap](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/878575d12c69a3d0809fa319d9c072886c0ac6a1.png)

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [June 13, 2023, 1:35pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031/2 "2023-06-13T13:35:47Z")

</div>

Please format your post by wrapping the code with triple backticks `````

---

<div class="post-metadata">

**Author:** ![jjg](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jjg/32/2822_2.png) [@jjg](https://forum.generic-mapping-tools.org/u/jjg)\
**Post date:** [June 13, 2023, 1:37pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031/3 "2023-06-13T13:37:27Z")

</div>

The problem is that “middle commands writing to the postscript file” need _both_ `-K` and `-O` I think, your `psscale` command uses only the `-O`

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [June 13, 2023, 1:51pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031/4 "2023-06-13T13:51:13Z")

</div>

This is the curse classic mode users of GMT will struggle with - not so in modern mode.

---

<div class="post-metadata">

**Author:** ![mostafa99](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mostafa99](https://forum.generic-mapping-tools.org/u/mostafa99)\
**Post date:** [June 13, 2023, 2:27pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031/5 "2023-06-13T14:27:27Z")

</div>

Thank you so much. It is really a very big help. I am deeply appreciating your time.

---

<div class="post-metadata">

**Author:** ![mostafa99](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mostafa99](https://forum.generic-mapping-tools.org/u/mostafa99)\
**Post date:** [June 13, 2023, 2:30pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031/6 "2023-06-13T14:30:18Z")

</div>

I am so sorry for any disturbance. I am not a professional in GMT. I am really struggling to get my job done.  
the problem is solved finally. Thank you so much.

 ![testmap](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/8f2b8db751f7f417d3a57839a8a504592323c5ab.png)

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [June 13, 2023, 2:41pm UTC](https://forum.generic-mapping-tools.org/t/color-scale/4031/7 "2023-06-13T14:41:29Z")

</div>

No worries. Just giving hints that modern mode would be much simpler for you, with less traps like the one you fell in.
