Skip to content

Rotating the symbols of a decorated line does not work ("+aangle")  #7591

Closed

Description

@yvonnefroehlich

Description of the problem

Based on the documentation at https://docs.generic-mapping-tools.org/dev/plot.html#s it should be possible to rotate the symbols of a decorated line by appending +aangle:

+aangle
Force symbols at a fixed angle, +an for line-normal, or +ap for line-parallel [Default].

However, so far this does not work for me. For quoted lines, it works to rotate the label by appending +aangle.
Related PyGMT comment GenericMappingTools/pygmt#2564 (comment).

Full script that generated the error

Input data: test_data_deco_line.txt

gmt plot test_data_deco_line.txt -R0/10/-1/1 -JX10c/3c -B -S~d2c:+ss1c+a20 -W1p,black -png deco_lines_rot_gmt

Full error message

No error message occurs.

Actual outcome

deco_lines_rot_gmt

Expected outcome

The squares along the line should be rotated by 20 degrees (counter-clockwise from the horizontal); similar to quoted lines:

gmt plot  test_data_deco_line.txt  -R0/10/-1/1 -JX10c/3c -B -Sqd1c:+ltext+a20 -W1p,black -png quot_lines_rot_gmt

quot_lines_rot_gmt

System information

  • Operating system: Windows-10-10.0.19045-SP0
  • GMT version (gmt --version): 6.4.0 as well as 6.5.0_95c3431_2023.06.26

Activity

  1. added
    bug
    on Jul 2, 2023
  2. PaulWessel commented on Nov 25, 2023

    @PaulWessel
    Contributor

    Mystery so far. At the end of gmtsupport_add_decoration we have

    	/* Build record with Cartesian (hence col = GMT_Z) "x y angle symbol" since we are using -Jx1i */
    	S->data[GMT_X][S->n_rows] = L->x;
    	S->data[GMT_Y][S->n_rows] = L->y;
    	S->data[GMT_Z][S->n_rows] = gmt_M_to_inch (GMT, G->size);
    	S->data[3][S->n_rows] = L->line_angle;	/* Change this in inches internally instead of string */
    	S->text[S->n_rows++] = strdup (G->symbol_code);
    

    G->line_angle is 20 as given, but S->data[3][S->n_rows] which is S->data[3][0] for the first point remains 0 after the assignment. How is that possible? When the temp file is built and passed to plot again it has x, y ,size, angle, but angle is zero for all record. Hence the result above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions