# Plotting layout problem with xaxis

**URL:** <https://discourse.julialang.org/t/plotting-layout-problem-with-xaxis/85712>\
**Category:** New to Julia\
**Tags:** plots, plotlyjs, layout-plots\
**Created:** [August 13, 2022, 5:36pm UTC](https://discourse.julialang.org/t/plotting-layout-problem-with-xaxis/85712 "2022-08-13T17:36:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rev0c\_Devs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rev0c_devs/32/38763_2.png) [@Rev0c\_Devs](https://discourse.julialang.org/u/Rev0c_Devs)\
**Post date:** [August 13, 2022, 5:36pm UTC](https://discourse.julialang.org/t/plotting-layout-problem-with-xaxis/85712/1 "2022-08-13T17:36:47Z")

</div>

Hi,

I am trying to plot two figures in a layout.

layout is set to layout = (2,1), and I got a problem with xaxis.

the top of xaxis appears in the bottom figure. Is there any way to fix this?

Thank you.

 ![abc](https://global.discourse-cdn.com/julialang/original/3X/5/2/52b37496574adb749d005cd0102fb6abe976ff57.png)

---

<div class="post-metadata">

**Author:** ![AndiMD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andimd/32/6531_2.png) [@AndiMD](https://discourse.julialang.org/u/AndiMD)\
**Post date:** [August 13, 2022, 6:16pm UTC](https://discourse.julialang.org/t/plotting-layout-problem-with-xaxis/85712/2 "2022-08-13T18:16:37Z")

</div>

Hi,  
are you using Plots.jl with the gr backend?  
You could try to increase the bottom margin:  
`plot(p1,p2,layout=(2,1),bottom_margin=20Plots.mm)`

---

<div class="post-metadata">

**Author:** ![Rev0c\_Devs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rev0c_devs/32/38763_2.png) [@Rev0c\_Devs](https://discourse.julialang.org/u/Rev0c_Devs)\
**Post date:** [August 14, 2022, 2:51am UTC](https://discourse.julialang.org/t/plotting-layout-problem-with-xaxis/85712/3 "2022-08-14T02:51:26Z")

</div>

I am currently using plotlyjs.

It seems to be solved with the gr backend without any modification.

Is there any solution for the plotlyjs?

Thank you for your reply.

---

<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:** [August 14, 2022, 5:46pm UTC](https://discourse.julialang.org/t/plotting-layout-problem-with-xaxis/85712/4 "2022-08-14T17:46:35Z")

</div>

There seems to be [an open issue on this](https://github.com/JuliaPlots/Plots.jl/issues/1847).  
The workaround being to plot in a browser window via the `plotly()` backend instead of an electron window with `plotlyjs()`
