GenericMappingTools / GenericMappingTools/gmt

grdvector vector issues.

Open
#7,045 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

I've been working in giving guessing powers (**scale**wise) to ``grdvector.jl``

First example
```
grdvector(U, V, vector=(len=0.25, stop=1), G=:black, lc=:red, J="X10", Vd=1, show=1)
grdvector -JX10 -Baf -BWSen -Ve -Ix1/1 -S1.785 -Gblack -W,red -Q0.25+e -P -K > C:\TEMP\GMTjl_tmp.ps
```
![GMTjl_tmp1](https://user-images.githubusercontent.com/537321/193105032-c7f816c0-96ef-4e69-bb8e-36493200ff6d.png)

cool, but some arrows are not plotted (I know, **+n** but more on it latter down) so let's add a beginning marker
```
grdvector(U, V, vector=(len=0.25, start=:circle, stop=1), G=:black, lc=:red, J="X10", Vd=1, show=1)
grdvector -JX10 -Baf -BWSen -Ve -Ix1/1 -S1.785 -Gblack -W,red -Q0.25+bc+e -P -K > C:\TEMP\GMTjl_tmp.ps
```

![GMTjl_tmp2](https://user-images.githubusercontent.com/537321/193105072-323dc79a-ea39-4fbe-a526-bbac5a96f78d.png)

Hmm, so we asked to plot more but actually got less (less filled arrows). I understand the why, length between head and tails shrunk and in consequence nor header nor tail is plotted. But it would be better that at least the number of decorated sticks did not diminished. The other thing is that there is no control on the circles size (same size as the header length) and they are too big. At least at this scale they would look nicer if the size is divided by two.

So let's try playing with the **n** (norm) option, and we get surprises again (in fact this looks like a bug and that's why I opened this issue as a bug). If the *norm* is given as less **half** the scale, which in this case is ``1.785/2 = 0.8925`` but we use ``norm=0.8924`` below, then no norm scaling takes place (we get same fig as above)

```
grdvector(U, V, vector=(len=0.25, start=:circ, stop=1, norm=0.8924), G=:black, lc=:red, J="X10", Vd=1, show=1)
grdvector -JX10 -Baf -BWSen -Ve -Ix1/1 -S1.785 -Gblack -W,red -Q0.25+bc+e+n0.8924 -P -K > C:\TEMP\GMTjl_tmp.ps
```

![GMTjl_tmp4](https://user-images.githubusercontent.com/537321/193105412-6776b7ca-c826-481a-83b9-4abc9ce7bed1.png)

Making it ``norm = scale / 2`` gets us the desired effect (less the, too big circles)

![GMTjl_tmp3](https://user-images.githubusercontent.com/537321/193104997-77e28d9e-5c16-43e3-8909-bc55472f3721.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.