# Double legend with twinx()

**URL:** https://discourse.julialang.org/t/double-legend-with-twinx/19524
**Category:** New to Julia
**Tags:** plotting
**Created:** [January 11, 2019, 4:17pm UTC](https://discourse.julialang.org/t/double-legend-with-twinx/19524 "2019-01-11T16:17:22Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [March 7, 2019, 9:13am UTC](https://discourse.julialang.org/t/double-legend-with-twinx/19524/2 "2019-03-07T09:13:15Z")

</div>

A hack:

```julia
plot(1:10, 1:10, seriestype = :bar, label = "1", alpha = 0.4)
plot!(1:10, NaN.*(1:10), label = "2", linecolor=:green, grid=false, legend=:left) 
plot!(twinx(), 1:10, 501:510, legend=false, linecolor=:green)

```

PS: please quote your code [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

_[View the full topic](https://discourse.julialang.org/t/double-legend-with-twinx/19524)._
