# Multiple axis in Plots Recipes

**URL:** <https://discourse.julialang.org/t/multiple-axis-in-plots-recipes/22491>\
**Category:** General Usage\
**Tags:** plots, recipe\
**Created:** [March 29, 2019, 4:30am UTC](https://discourse.julialang.org/t/multiple-axis-in-plots-recipes/22491 "2019-03-29T04:30:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santiago\_Cuervo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/santiago_cuervo/32/7403_2.png) [@Santiago\_Cuervo](https://discourse.julialang.org/u/Santiago_Cuervo)\
**Post date:** [March 29, 2019, 4:30am UTC](https://discourse.julialang.org/t/multiple-axis-in-plots-recipes/22491/1 "2019-03-29T04:30:15Z")

</div>

```julia
@userplot pho
@recipe function f(h::pho)
              legend --> false
             yflip := true
            xmirror := true
              x, y, a, b =h.args
        
    @series begin
        seriestype := :scatter
        seriescolor --> :red
        x , y
    end
  
        @series begin
        seriestype := :path
        seriescolor --> :blue
        subplot := 1
        a , b
    end
    

       end

pho(1:5, 5:9,10:15, 50:55, legend=true, color= :blue)

```

![Captura](https://global.discourse-cdn.com/julialang/original/3X/9/1/91cac1df15269df059de0ad86496113457046810.jpeg)

How to set multiple x and y axis in recipes plot? Is the keyword twinx / twiny useful here?.

How to set only one series attributes like series color in the input arguments? when put color := :blue both series are set to blue

thanks

---

<div class="post-metadata">

**Author:** ![MA\_Laforge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ma_laforge/32/385_2.png) [@MA\_Laforge](https://discourse.julialang.org/u/MA_Laforge)\
**Post date:** [March 29, 2019, 12:55pm UTC](https://discourse.julialang.org/t/multiple-axis-in-plots-recipes/22491/2 "2019-03-29T12:55:07Z")

</div>

> How to set multiple x and y axis in recipes plot?

You must create subplots. Here is a link to a tutorial in the documentation:  
[http://docs.juliaplots.org/latest/tutorial/#combining-multiple-plots-as-subplots](http://docs.juliaplots.org/latest/tutorial/#combining-multiple-plots-as-subplots)

> Is the keyword twinx / twiny useful here?.

No. `twinx / twiny` are there to tie axes from two different subplots together (make them the same).

In the case above, it appears you want different subplots because your datasets are in different portions of the x-y space… and you wish to “zoom in” on each independently (for BOTH x AND y coordinates).

This is the **complete** opposite case of when to use `twinx/twiny`: You want to use `twinx/twiny` when you want to maintain **either** the same x or y values for both subplots.

> How to set only one series attributes like series color in the input arguments? when put color := :blue both series are set to blue

I am not an expert with plot recipes. However, I have never seen the `-->` operator in Julia. Everything seems fine to me if I replace `seriescolor -->` with `seriescolor :=` in the code above.
