# GMT with custom curved arrows

**URL:** <https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872>\
**Category:** Showcase\
**Created:** [April 21, 2023, 12:43pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872 "2023-04-21T12:43:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjg](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jjg/32/2822_2.png) [@jjg](https://forum.generic-mapping-tools.org/u/jjg)\
**Post date:** [April 21, 2023, 12:43pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/1 "2023-04-21T12:43:01Z")

</div>

I’ve been working on a program, vfplot, which creates EPS files of curved arrows (representing a 2-d vector field). The program plots only the arrows, GMT can do the rest of the work needed to make an attractive plot.

 ![vfplot-rotcyl](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/d/d9eb53761ee9c31f89bf33fa9605435a55fe3ca7.png)

Created with

```auto
 #!/bin/sh

set -e

EXT='0.03125'
RNG="-R-$EXT/$EXT/-$EXT/$EXT"
DIM='4i/4i'
PRJ="-JX$DIM"

EPS='compose.eps'

# background scaler

GRD='/tmp/scalar-fine.grd'
grdsample grd/scalar.grd -G$GRD $RNG -I1024+n
grdimage $GRD $PRJ $RNG -Cscalar.cpt -K > $EPS
rm -f $GRD

# central cylinder

psxy $PRJ $RNG -Sc1.27i -G255 -W1p -K -O >> $EPS <<EOF
0 0
EOF

# vfplot output

psimage vfplot.eps -W$DIM -Dx0/0 -O >> $EPS

# results

psconvert -A -Tf $EPS
psconvert -A -E150 -Tg $EPS

# cleanup

rm -r $EPS

```

Other examples [here](http://soliton.vm.bytemark.co.uk/pub/jjg/en/code/vfplot/examples/rotcyl.html), follow the GitLab links to inspect the GMT scripts `compose.sh`

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [April 21, 2023, 1:31pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/2 "2023-04-21T13:31:36Z")

</div>

Very cool.

- ~~Can you make a minimal working example to dodge `grdsample [ERROR]: Cannot find file grd/scalar.grd`?~~
- You may want to prefix the gmt commands with `gmt`(?).

---

<div class="post-metadata">

**Author:** ![jjg](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jjg/32/2822_2.png) [@jjg](https://forum.generic-mapping-tools.org/u/jjg)\
**Post date:** [April 21, 2023, 1:37pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/3 "2023-04-21T13:37:30Z")

</div>

Those files can be found [on GitLab](https://gitlab.com/jjg/vfplot-examples/-/tree/master/rotcyl)

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [April 21, 2023, 1:40pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/4 "2023-04-21T13:40:06Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [April 21, 2023, 1:49pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/5 "2023-04-21T13:49:23Z")

</div>

GMT can also plot curved arrows via -Sm if you compute the radius required. I had plans to do that to draw flow lines.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 21, 2023, 2:14pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/6 "2023-04-21T14:14:53Z")

</div>

These are curved arrow heads, which we do not do. Unf GPL’ed.

---

<div class="post-metadata">

**Author:** ![jjg](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jjg/32/2822_2.png) [@jjg](https://forum.generic-mapping-tools.org/u/jjg)\
**Post date:** [April 21, 2023, 2:39pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/7 "2023-04-21T14:39:06Z")

</div>

If GMT were to want some components from vfplot, I’m open to relicensing those LGPL, just ask 🙂

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 21, 2023, 3:21pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/8 "2023-04-21T15:21:44Z")

</div>

Thanks, we may go there (they look nice), but not for now.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [April 21, 2023, 4:41pm UTC](https://forum.generic-mapping-tools.org/t/gmt-with-custom-curved-arrows/3872/9 "2023-04-21T16:41:33Z")

</div>

We do curved vector heads -Sm
