Skip to content

Bug with default pen with modifiiers (e.g. plot -W+s) #8714

@Esteban82

Description

@Esteban82

Intro

If a run this, it works. I plot a line with a modifier

gmt plot @tut_data.txt -png tut -B -Wthin+s

Then, I try to plot the line without specifig the pen and with the modifier for Bezier spline (+s). But if I use the following command then I got an error:

gmt plot @tut_data.txt -png tut -B -W+s
plot [ERROR]: Your -W syntax is obsolete; see program usage.

Fix

I think that the problem is in line 1074 of psxy.c (

gmt/src/psxy.c

Lines 1074 to 1078 in 4f787d6

if (opt->arg[0] == '-' || (opt->arg[0] == '+' && opt->arg[1] != 'c')) { /* Definitively old-style args */
if (gmt_M_compat_check (API->GMT, 5)) { /* Sorry */
GMT_Report (API, GMT_MSG_ERROR, "Your -W syntax is obsolete; see program usage.\n");
n_errors++;
}
)

I fix it by using this command instead.

if (opt->arg[0] == '-' || (opt->arg[0] == '+' && opt->arg[1] != 'c' && opt->arg[1] != 's')) { /* Definitively old-style args */

I can make PR with this modification. My doubts are:

  1. Is this ok?
  2. Also, how should I include the other modifiers (like +o, +v, +z)? In the same way? Or should I do it in other way?

Let me know so I make a PR.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions