# Second yaxis in Plots using backend plotlyjs()

**URL:** <https://discourse.julialang.org/t/second-yaxis-in-plots-using-backend-plotlyjs/446>\
**Category:** Visualization\
**Created:** [November 20, 2016, 9:20am UTC](https://discourse.julialang.org/t/second-yaxis-in-plots-using-backend-plotlyjs/446 "2016-11-20T09:20:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArchieCall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/archiecall/32/206_2.png) [@ArchieCall](https://discourse.julialang.org/u/ArchieCall)\
**Post date:** [November 20, 2016, 9:20am UTC](https://discourse.julialang.org/t/second-yaxis-in-plots-using-backend-plotlyjs/446/1 "2016-11-20T09:20:55Z")

</div>

I am trying to create a plot in Plots for the backend plotlyjs() as follows:

Base plot is a function Func1 with a normal x and y axis.

The overlay plot created with plot! for a second function Func2 has the same x axis as in Func1, however it has a y axis which is to appear on the right hand side of the plot. The units for this second y axis are unrelated to the y axis in the base plot.

Is this possible in Plots?

---

<div class="post-metadata">

**Author:** ![tbreloff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbreloff/32/68_2.png) [@tbreloff](https://discourse.julialang.org/u/tbreloff)\
**Post date:** [November 20, 2016, 12:07pm UTC](https://discourse.julialang.org/t/second-yaxis-in-plots-using-backend-plotlyjs/446/2 "2016-11-20T12:07:07Z")

</div>

> <https://github.com/JuliaPlots/Plots.jl/issues/378#issuecomment-241028070>
>
> I'm trying to remember how to use multiple axes. I found this example in the doc…:
> 
> \`plot(Vector\[randn(100),randn(100) \* 100\],axis=\[:l :r\],ylabel="LEFT",yrightlabel="RIGHT")\`
> 
> but that results in 
> 
> \`\`\`
> LoadError: Unknown key: axis
> while loading In\[54\], in expression starting on line 1
> 
> in default at C:\\Users\\cbinz\\.julia\\v0.4\\Plots\\src\\args.jl:468
> in warnOnUnsupported\_args at C:\\Users\\cbinz\\.julia\\v0.4\\Plots\\src\\args.jl:760
> in \_apply\_series\_recipe at C:\\Users\\cbinz\\.julia\\v0.4\\Plots\\src\\plot.jl:218
> in \_plot! at C:\\Users\\cbinz\\.julia\\v0.4\\Plots\\src\\plot.jl:538
> \`\`\`
> 
> It does in fact work with the \`UnicodePlots\` backend, but not with \`PyPlot\` or \`GR\`. I have not tried others.

---

<div class="post-metadata">

**Author:** ![ArchieCall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/archiecall/32/206_2.png) [@ArchieCall](https://discourse.julialang.org/u/ArchieCall)\
**Post date:** [November 20, 2016, 2:30pm UTC](https://discourse.julialang.org/t/second-yaxis-in-plots-using-backend-plotlyjs/446/3 "2016-11-20T14:30:08Z")

</div>

This variation using the gr() backend should allow something close for a second y axis.

I’ll play with it…Archie
