# Arrows not working on log-log plot (GR)

**URL:** <https://discourse.julialang.org/t/arrows-not-working-on-log-log-plot-gr/61454>\
**Category:** Visualization\
**Tags:** bug, gr\
**Created:** [May 19, 2021, 3:27pm UTC](https://discourse.julialang.org/t/arrows-not-working-on-log-log-plot-gr/61454 "2021-05-19T15:27:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 20, 2021, 10:59pm UTC](https://discourse.julialang.org/t/arrows-not-working-on-log-log-plot-gr/61454/2 "2021-05-20T22:59:22Z")

</div>

It looks like an ugly bug.

Herein a workaround for loglog plots with aspect ratio = 1.

_ **NB:** edited code as there seems to be another bug, with aspect\_ratio not being respected in loglog plots if range of xlims != ylims_

```julia
using Plots; gr(legend=false)

# Define some input data:
x, y = 0.1, 0.1 # vector origin
u, v = 9.9, 99.9 # vector
xl, yl = (0.01, 100), (0.01, 200) # loglog plot limits (have to be modified to max range)

# plot arrowheads as rotated unicode characters (OK for ratio=1):
lminmax = (minimum([xl[1];yl[1]]), maximum([xl[2];yl[2]]))
r = atan(log10.(1+v/y), log10.(1+u/x)) * 180/pi # rotation angle
p = plot([x,x+u], [y,y+v], lc=:blue, xlabel="X",ylabel="Y")
plot!(ratio=1, scale=:log10, xlims=lminmax, ylims=lminmax)
annotate!(x+u,y+v, text('\u27A4', 9, :blue, rotation=r))
annotate!(x,y, text('\u27A4', 9, :blue, rotation=r+180))

```

![Plots_arrowheads_in_loglog_scale](https://global.discourse-cdn.com/julialang/original/3X/a/3/a3a1b5296a9a2d347b30517e4e3e0ff949805b70.png)

_ **NB:** it should be possible to correct the rotation angles for the general case where ratio != 1_

---

_[View the full topic](https://discourse.julialang.org/t/arrows-not-working-on-log-log-plot-gr/61454)._
