Bug #1205

psscale -DjBC+m and -DjMR+m doesn't move text to the opposite side

Added by Dongdong 6 months ago. Updated 5 months ago.

Status:ClosedStart date:2018-02-28
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next minor release
Affected version:all Platform:

Description

Code below shows color bars plotted for 9 possible justification codes with and without +m modifier.

ps=test.ps

gmt psbasemap -R0/10/0/10 -JX8c -B0 -K -X4c -Yc > $ps

# plot color bar without +m option
gmt psscale -J -R -Cseis -DjTL+w2c/0.5c -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjML+w2c/0.5c -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjBL+w2c/0.5c -Ba -K -O >> $ps

gmt psscale -J -R -Cseis -DjTC+w2c/0.5c -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjMC+w2c/0.5c -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjBC+w2c/0.5c -Ba -K -O >> $ps

gmt psscale -J -R -Cseis -DjTR+w2c/0.5c -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjMR+w2c/0.5c -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjBR+w2c/0.5c -Ba -K -O >> $ps

gmt psbasemap -R -J -B0 -X12c -K -O >> $ps

# plot color bar with +m option
gmt psscale -J -R -Cseis -DjTL+w2c/0.5c+m -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjML+w2c/0.5c+m -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjBL+w2c/0.5c+m -Ba -K -O >> $ps

gmt psscale -J -R -Cseis -DjTC+w2c/0.5c+m -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjMC+w2c/0.5c+m -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjBC+w2c/0.5c+m -Ba -K -O >> $ps

gmt psscale -J -R -Cseis -DjTR+w2c/0.5c+m -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjMR+w2c/0.5c+m -Ba -K -O >> $ps
gmt psscale -J -R -Cseis -DjBR+w2c/0.5c+m -Ba -K -O >> $ps

gmt psxy -J -R -T -O >> $ps

The figure below is the output:

It seems that +m option cannot move texts to opposite side for BC and MR, which make it difficult to plot a colorbar at the middle right of the frame (jMR) with annotations at the right side of the color bar.

The code is tested for GMT 5.4.3, GMT5-dev and GMT6-dev.

test.png (68.8 KB) Dongdong, 2018-02-28 16:19

Associated revisions

Revision 19880
Added by Paul 6 months ago

Address issue #1205

History

#1 Updated by Paul 6 months ago

  • Status changed from New to In Progress
  • Assignee set to Paul

Thanks, I have added a test script based on your example (failing) and we will have a look soon.

#2 Updated by Paul 6 months ago

Furthermore, in addition to the +m effects the M row and C col items along the frame are clearly not positioned correctly as well.

#3 Updated by Paul 6 months ago

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

Sorry, the auto-adjustment only applies to the center of the sides (BC, TC, LM, RM) so my comments about alignment above are wrong. So it is just, as you pointed out, the wrong effect of +m for BC and MR. The reason for this was that BC and RM get an automatic +m assigned, so when you add +m manually we ideally want that to mean the opposite of the default (automatic) setting. I now consider the sense of the automatic setting before applying the manual +m. In r19880.

#4 Updated by Paul 5 months ago

  • Status changed from Resolved to Closed

Closing this as no further comments.

Also available in: Atom PDF