# Draw vectors on scatter plot with flipped axis

**URL:** <https://discourse.julialang.org/t/draw-vectors-on-scatter-plot-with-flipped-axis/38416>\
**Category:** General Usage\
**Created:** [April 29, 2020, 11:48am UTC](https://discourse.julialang.org/t/draw-vectors-on-scatter-plot-with-flipped-axis/38416 "2020-04-29T11:48:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [April 29, 2020, 11:48am UTC](https://discourse.julialang.org/t/draw-vectors-on-scatter-plot-with-flipped-axis/38416/1 "2020-04-29T11:48:39Z")

</div>

Hi all-

Is there a way to draw a vector with flipped axes? In the example, the vectors are drawn in two places (and without an error in the correct place).

```julia
using Plots

m1 = (x=350,y=250)

m2 = (x=375,y=26)

vm = (x=m1.x-m2.x, y=m1.y-m2.y)
vt = (x=0,y=1)

scatter([m1.x], [m1.y], ylims=(0,500), xlims=(0,700),
    leg=false, color=:black, markersize=8, yaxis=:flip)

scatter!([m2.x], [m2.y], markersize=8, color=:darkred)

quiver!([m2.x], [m2.y], quiver=([100],[0]))

```

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [April 29, 2020, 11:56am UTC](https://discourse.julialang.org/t/draw-vectors-on-scatter-plot-with-flipped-axis/38416/2 "2020-04-29T11:56:21Z")

</div>

It appears that the solution is to use `pyplot()` instead of the default `gr()`

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [April 29, 2020, 11:59am UTC](https://discourse.julialang.org/t/draw-vectors-on-scatter-plot-with-flipped-axis/38416/3 "2020-04-29T11:59:04Z")

</div>

For reference: [GR: arrow is at wrong location with flipped axis · Issue #2245 · JuliaPlots/Plots.jl · GitHub](https://github.com/JuliaPlots/Plots.jl/issues/2245)
