Bug #1196

Problem with custom annotations

Added by Michael 9 months ago. Updated 8 months ago.

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

100%

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

Description

Code:

echo "0 a A
0.5 a B
1 a C" > int

echo "0.5 0.5"| gmt psxy -Sx1c -JX10c -R0/1/0/1 -BswNE -Bxycint -P > out.ps

Two problems:
1) There is now custom annotations, just numbers
2) Incorrect position of the cross

r19697

out.ps (21 KB) Michael, 2018-02-01 19:33

out.pdf (3.67 KB) Paul, 2018-02-04 16:11

out.ps (21 KB) Michael, 2018-02-04 17:35

debug.log (14.7 KB) Michael, 2018-02-04 17:35

Associated revisions

Revision 19705
Added by Paul 9 months ago

Fix resetting of i/o parameters when dealing with custom annotation files, issue #1196

History

#1 Updated by Paul 9 months 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

Conflict with internal parameters for the data i/o vs the label i/o. Fixed in r19705.

#2 Updated by Michael 8 months ago

Fixed only the second item, on the axes still numbers instead of letters.

#3 Updated by Paul 8 months ago

echo "0.5 0.5"| gmt psxy -Sx1c -JX10c -R0/1/0/1 -BswNE -Bxycint -P > out.ps
gmt psconvert out.ps -Tf -P -A

Not what I get. See out.pdf attached.

#4 Updated by Michael 8 months ago

It seems strange. I attach my ps file and debug output from psxy.

r19714

#5 Updated by Joaquim 8 months ago

It works for me too.

#6 Updated by Michael 8 months ago

File gmt_support.c, function gmt_load_custom_annot, line 13158 in r19735.

        nc = sscanf (S->text[row], "%s %[^\0]", type, txt);

I replace \0 on \n and it all worked .

I'm really wondering which implementation of sscanf allows a null byte in the middle of a format string?

#7 Updated by Paul 8 months ago

Perhaps I was confused about how to specify "until end of line" in this case since there are no new-line characters in that string. So I used \0 and that works on at least OS X and Windows. However, happy to hear this works for you, it also works for me and I have made the change in r19736.

#8 Updated by Paul 8 months ago

  • Status changed from Resolved to Closed

Closed as fixed.

Also available in: Atom PDF