# Vege-Lite encode :point shape and angle

**URL:** <https://discourse.julialang.org/t/vege-lite-encode-point-shape-and-angle/33327>\
**Category:** Visualization\
**Created:** [January 14, 2020, 3:30am UTC](https://discourse.julialang.org/t/vege-lite-encode-point-shape-and-angle/33327 "2020-01-14T03:30:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![babaq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/babaq/32/891_2.png) [@babaq](https://discourse.julialang.org/u/babaq)\
**Post date:** [January 14, 2020, 3:30am UTC](https://discourse.julialang.org/t/vege-lite-encode-point-shape-and-angle/33327/1 "2020-01-14T03:30:15Z")

</div>

I want to draw a scatter plot but use different point shape and angles to show different orientations and directions.

the `stroke` shape and `arrow` shape seems what I want, but I am have trouble to make it work

```nohighlight
function foo(pos;ori=0,dir=90)
    data1 = DataFrame(x=pos[:,1],y=pos[:,2],shape=1,angle=ori)
    data2 = DataFrame(x=pos[:,1],y=pos[:,2],shape=2,angle=dir)
    data = [data1;data2]
    data |> @vlplot(
    mark={:point,filled=true,strokeWidth=4},
    encoding={
    x=:x,y=:y,shape={"shape:n",scale={domain=[1,2],range=[:stroke,:arrow]}},size={"shape:n",scale={domain=[1,2],range=[200,400]}},
    angle="angle:q"
    },
    width=400,height=400 )
end

up = [1:10 3:12]

p=foo(up)

```

the Vega-Lite says angle is not a valid encoding channel but I saw [this](https://vega.github.io/vega/examples/wind-vectors/).

any suggestions would be appreciated.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [January 14, 2020, 3:42am UTC](https://discourse.julialang.org/t/vege-lite-encode-point-shape-and-angle/33327/2 "2020-01-14T03:42:24Z")

</div>

This is the same question as [here](https://github.com/queryverse/VegaLite.jl/issues/256), right? No need to post twice 🙂

EDIT: Sorry I originally used the wrong link here. I think this was the same question that was already asked on github?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 14, 2020, 10:30am UTC](https://discourse.julialang.org/t/vege-lite-encode-point-shape-and-angle/33327/3 "2020-01-14T10:30:55Z")

</div>

Strange, your link to the “other” post points exactly to this post here, and I can’t find the duplicate one.  
I hesitate to answer the OP because it may be already answered in the “other” duplicate.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 14, 2020, 10:34am UTC](https://discourse.julialang.org/t/vege-lite-encode-point-shape-and-angle/33327/4 "2020-01-14T10:34:58Z")

</div>

“angle” is not supported by VegaLite, see here:  
[https://github.com/vega/vega-lite/issues/4270](https://github.com/vega/vega-lite/issues/4270)

You may try to use Vega syntax (JSON) as in your linked example. On how to use this in Julia can be read here:  
[https://www.queryverse.org/VegaLite.jl/stable/userguide/vega/](https://www.queryverse.org/VegaLite.jl/stable/userguide/vega/)

You may also consider to use VegaLite#master where Vega support has been slightly improved:  
[https://www.queryverse.org/VegaLite.jl/dev/userguide/vega/](https://www.queryverse.org/VegaLite.jl/dev/userguide/vega/)

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [April 7, 2020, 3:36am UTC](https://discourse.julialang.org/t/vege-lite-encode-point-shape-and-angle/33327/5 "2020-04-07T03:36:04Z")

</div>

[VegaLite.jl](https://github.com/queryverse/VegaLite.jl) now supports the `angle` encoding channel, see [this example](https://www.queryverse.org/VegaLite.jl/v2.1/examples/examples_table_based_plots/#Wind-Vector-Map-1).
