Skip to content

plot/plot3d: Simplify the documentation for the -A option #8645

@seisman

Description

@seisman

https://docs.generic-mapping-tools.org/latest/plot.html#a

The -A option has the following syntax:

-A[m|p|x|y|r|t]

in which m|p works for geographic map, x|y works for Cartensian plot, and r|t works for polar projections.

But in the source code, m/y/r works the same way, and p/x/t works the same way.

gmt/src/psxy.c

Lines 838 to 848 in b34b125

case 'A': /* Turn off draw_arc mode */
n_errors += gmt_M_repeated_module_option (API, Ctrl->A.active);
switch (opt->arg[0]) {
case 'm': case 'y': case 'r': Ctrl->A.mode = GMT_STAIRS_Y; break;
case 'p': case 'x': case 't': Ctrl->A.mode = GMT_STAIRS_X; break;
#ifdef DEBUG
default: Ctrl->A.step = atof (opt->arg); break; /* Undocumented test feature */
#endif
}
break;

So, instead of showing the -A[m|p|x|y|r|t], we can simplify it to:

-A[x|y]

then the documentation can be something like:

x: Draw the line along x first then along y.
y: Draw the line along y first then along x.

Here, x and y have different meanings in different coordinate systems.

  • For Cartesian data, x and y means X- and Y-axis, respectively
  • For polar projection, x means theta and y means r
  • For geographic projections, x means parallel and y means meridian

I'd like to work on it if approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions