Bug #1143

psscale inserts a random color when cropping with -G

Added by Leonardo about 1 year ago. Updated about 1 year ago.

Status:ClosedStart date:2017-08-11
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:


I wanted to use just the green portion of the dem1 CPT for a grdimage plot of topography.

What I did was scale my CPT to include some negative values not present in my dataset:

gmt makecpt -Cdem1 -Ic -T-2500/1250 > topo.cpt

After plotting my data, I insert a colorbar using psscale. However, I want the colorbar to only include the values that are actually present in my data, so I crop it using -G:

gmt psscale -R0/10/0/10 -JX4i/4i -DjCC+h -P -Ctopo.cpt -By+lm -Bxa250 -G0/NaN > figure.ps

For some reason, this inserts a blue color in my colorbar (see attached). This is very strange because there isn't any blue in dem1. It doesn't happen if I remove -G.

I'm using trunk (18674).

psscale-bug-plot.jpg (25.5 KB) Leonardo, 2017-08-11 10:03


#1 Updated by Paul about 1 year ago

  • Status changed from New to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

Fixed in r18687. Failed to recompute RGB difference array for the truncated slice.

#2 Updated by Paul about 1 year ago

  • Status changed from Resolved to Closed

Closed as fixed.

Also available in: Atom PDF