Bug #1201

The line is drawn inside the arrow of the vector

Added by Michael 27 days ago. Updated 14 days ago.

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


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


If the arrow of the vector is longer than the vector, an ugly line is drawn inside the arrow.

echo "0.3 0.5 0 2
0.5 0.5 0 1
0.7 0.5 0 0.5"|\
gmt psxy -JX10c -R0/1/0/1 -SV1c+e+h0 -W0.5p,black -Gblack@80 -Xa1c -Ya1c -P >test.eps

I found the appropriate place in the source code, the required changes are fairly simple. Patch attached. It works with +b and +b+e too.

Maybe this is done intentionally, then I would like to have an option that disables this behavior.


test.pdf (2.84 KB) Michael, 2018-02-20 18:41

fixarrow.patch Magnifier (808 Bytes) Michael, 2018-02-20 18:44

arrowline.pdf (4 KB) Paul, 2018-02-22 11:28

Associated revisions

Revision 19810
Added by Paul 25 days ago

Address issue #1201


#1 Updated by Paul 25 days ago

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

Thanks for pointing this out. However, it turns out this has to do with some confusion in GMT about inches vs cm. When I run it with --PROJ_LENGTH_UNIT=inch it works fine (input lengths from stdin are considered to be in inches and no lines cut inside the head. With --PROJ_LENGTH_UNIT=cm I can recreate your case. Will come up with a fix.

#2 Updated by Paul 25 days ago

Correction. Affects regardless. Will examine some more and likely apply your patch with a twist. See attached figure.

#3 Updated by Paul 25 days ago

  • Status changed from In Progress to Resolved
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

Fixed in r19810. I used your suggested patch. I also added a warning from psxy when this situation occurs that suggests using the +n<norm> modifier. Added test script that now passes.

#4 Updated by Michael 25 days ago

Thank you! I noticed this problem for a long time, but mistook for rendering errors and just used the filling of the vector arrow with an opaque color. Now I can draw beautiful translucent arrows.

For short arrows, the +n is not always applicable, the arrows can be so small that they become invisible. The absence of a +n allows at least to show information about the direction of the vector.

#5 Updated by Paul 14 days ago

  • Status changed from Resolved to Closed

Closed as fixed.

Also available in: Atom PDF