# Arrow lines between points, scatter plot using graph\_objects

**URL:** <https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [November 17, 2022, 3:47pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004 "2022-11-17T15:47:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![plotmaster422](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/plotmaster422/32/22680_2.png) [@plotmaster422](https://community.plotly.com/u/plotmaster422)\
**Post date:** [November 17, 2022, 3:47pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004/1 "2022-11-17T15:47:39Z")

</div>

I am trying to build a scatterplot with arrow lines inbetween the two points, denoting the movement from 2019-2021. Looking at the documentation here ([Styling markers in Python](https://plotly.com/python/marker-style/)), the following code should work for graph\_objects.

```
        mode="lines+markers",
        marker=dict(
            symbol="arrow",
            size=15,
            angleref="previous",
        ),

```

However, when using that code I get the following error.

> ValueError:  
> Invalid value of type ‘builtins.str’ received for the ‘symbol’ property of scatter.marker  
> Received value: ‘arrow’

Has there been an update since the documentation was published?

---

<div class="post-metadata">

**Author:** ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)\
**Post date:** [November 17, 2022, 8:39pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004/2 "2022-11-17T20:39:58Z")

</div>

@plotmaster422 This is the list of available arrow symbols:

```auto
arrow_style= ['arrow-up', 
            'arrow-up-open', 'arrow-down',
            'arrow-down-open', 'arrow-left', 
            'arrow-left-open', 'arrow-right', 
            'arrow-right-open', 'arrow-bar-up', 
            'arrow-bar-up-open', 'arrow-bar-down', 
             'arrow-bar-down-open', 'arrow-bar-left',
             'arrow-bar-left-open', 
            'arrow-bar-right', 'arrow-bar-right-open', 'arrow', 'arrow-open',
            'arrow-wide', 'arrow-wide-open']

```

---

<div class="post-metadata">

**Author:** ![plotmaster422](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/plotmaster422/32/22680_2.png) [@plotmaster422](https://community.plotly.com/u/plotmaster422)\
**Post date:** [November 18, 2022, 7:25pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004/3 "2022-11-18T19:25:30Z")

</div>

got it, will try all of those options and see if any work.

---

<div class="post-metadata">

**Author:** ![plotmaster422](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/plotmaster422/32/22680_2.png) [@plotmaster422](https://community.plotly.com/u/plotmaster422)\
**Post date:** [November 27, 2022, 6:34pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004/4 "2022-11-27T18:34:35Z")

</div>

@empet is there any way to have the arrow point in the direction of the line? Looks like “angleref” was discontinued.

---

<div class="post-metadata">

**Author:** ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)\
**Post date:** [November 27, 2022, 7:34pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004/5 "2022-11-27T19:34:46Z")

</div>

`help(go.scatter.Marker.angleref)` displays the following information:

```auto
  Sets the reference for marker angle. With "previous", angle 0
    points along the line from the previous point to this one. With
    "up", angle 0 points toward the top of the screen.
    
    The 'angleref' property is an enumeration that may be specified as:
      - One of the following enumeration values:
            ['previous', 'up']

```

Example (Plotly 5.11.0):

```auto
fig = go.Figure(go.Scatter(x=[1,3], y=[4,2],
            marker= dict(size=10,symbol= "arrow-bar-up", angleref="previous")))
fig.update_layout(width=500, height=300)
fig.show()

```

![arrow](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/4/8/4872dfb3d964e53bc931aff11de41ebaf6096748.png)

---

<div class="post-metadata">

**Author:** ![plotmaster422](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/plotmaster422/32/22680_2.png) [@plotmaster422](https://community.plotly.com/u/plotmaster422)\
**Post date:** [November 27, 2022, 11:14pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004/6 "2022-11-27T23:14:44Z")

</div>

Thanks for you responsiveness! When I run this I get the following error:

> ValueError: Invalid property specified for object of type plotly.graph\_objs.scatter.Marker: ‘angleref’
> 
> Did you mean “sizeref”?

Updating this post to say that it looks like “angelref” was added in a recent release.

> **[Releases · plotly/plotly.py](https://github.com/plotly/plotly.py/releases)**
>
> The interactive graphing library for Python :sparkles: This project now includes Plotly Express! - plotly/plotly.py

Updating my Google Colab environment to mirror the latest release. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![fingerpartyy](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@fingerpartyy](https://community.plotly.com/u/fingerpartyy)\
**Post date:** [January 9, 2023, 6:24pm UTC](https://community.plotly.com/t/arrow-lines-between-points-scatter-plot-using-graph-objects/70004/7 "2023-01-09T18:24:50Z")

</div>

same here, just restart the kernel and it should be ok 🙂
