Bug #1066

pslegend gets confused by -B in specfile for color bar and -B in command

Added by Andreas 6 days ago. Updated 6 days ago.

Status:ResolvedStart date:2017-03-18
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.3-svn Platform:


When giving a -B for the color bar in the optional arguments part of B cptname offset height [ optional arguments ] in the specfile fed into pslegend, GMT will complain if a -B (map boundary frame and axes attributes) also is given in the executed pslegend command (exception: does not complain if -B0). Then, the -B given in the executed pslegend command overrides the one specified in the specfile and applied to both color bar and map boundary frame.

Lower: -B given in specfile for color bar (-Ba1000f100g500) is ignored, and GMT uses the -B supplied in pslegend command (-Ba10f5g2) for both color bar and map boundary. GMT complains psscale: Warning: Axis sub-item <a,f,g> set more than once (typo?)
Middle: Same as above, but -B0 (just plot frame) given is pslegend command - color bar looks good. GMT does not complain.
Upper: pslegend command has no -B. Color bar is plotted as expected. GMT does not complain.

So sorry for the awkward plot.

Tested with GMT 5.3.2

legend.pdf (41.5 KB) Andreas, 2017-03-18 11:00

legend.bat (619 Bytes) Andreas, 2017-03-18 11:00

Associated revisions

Revision 17718
Added by Paul 6 days ago

Addressing issue #1066


#1 Updated by Paul 6 days ago

  • Status changed from New to In Progress
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release

Thanks, I have added a new pslegend test script based on yours that currently fails so we will be reminded. The workaround is to plot the map frame with psbasemap and save the -B for the CPT in pslegend.

#2 Updated by Paul 6 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Should be fixed in r17719. I now let pslegend do its -B thing and then if -B is passed for the CPT plotting then we reset the -B machinery before psscale is called. Test now passes.

Also available in: Atom PDF