Psscale is plotting a discrete cpt as continuous

I’ve made a discrete no_green cpt that appears correctly on my map but incorrectly in the associated scale bar where it is continuous and I cannot figure out how to fix this? Here is some code:

gmt makecpt -Cno_green -T-7000/-1000/500 -V > ${tempfiles}color.cpt

gmt psscale $area $proj -C${tempfiles}color.cpt -DjMR+w2i/0.1i+o-1.5/0i -By+lkm -Ba1f1 -W0.001 -O -K -V >>$out

Small snapshot of my map:

A couple strange things I’ve also noticed, first is that I cannot get the tick marks to work, it annotates fine, but does not show the ticks. Second is that when I forced the cpt to be continuous with the -Z option, the scale was still continuous except for the boundary between the warm and cold colors (like is shown in the examples of this color scale). I also tried the -W option but that did not work.

Any ideas?

If this is a screenshot of a PS or PDF in Preview on a mac then it is just Apple deciding to smooth coarse images. Convert to PNG with psconvert and it should be discrete there.

No kidding! Indeed that worked, using psconvert to PDF also worked fine, thanks Paul.

Okay I spoke too soon, now that I’ve tried to bring the PDF into the vector graphics program I use to edit my figures called Graphic (it’s a mac program), the problem is back. The color scale appears correctly in the PDF but when I open it in Graphic is goes back to the continuous version. I can’t seem to try other vector versions using psconvert, when I tried to make an .svg version it said my Ghostscript version (9.54.0) no longer supports svgs.

Try -Np in colorbar/pascals.

Psscale damned autocorrect

Yes okay that worked for sure this time! Thanks

Dear all,
below one is my gmt script it is running fine, how can i add the scale to my plot.

gmt makecpt -Cusgs.cpt -T-50/2000/50 -Z > c.cpt

gmt grdimage dem.grd -R75/79/11/15 -Cc.cpt -B1/1 -JM10 -P -Y15 -K -V >

gmt pscoast -R -J -W0.001p -Dh -A -W0.5,black -O >>

We have no control on what usgs.cpt contains. However, my first guess is taht you might be on a mac and viewing the PS using Preview. If that is true then this is a known Preview case. If that is not the case then you need to post the usgs.cpt file since we would need to recreate it. Also, see earlier posts on this topic.

1 Like

How can i adjust the scale and black color patches in figure?

If your area includes a shoreline (ocean) why is the elevation different from zero at the shoreline?

It seems that you are asking us what David ask you.

1 Like

Your question has no relationship with the title. You should consider making a separate question.

Ok. Thank you.