# Align X axis of heatmap and line plot

**URL:** <https://discourse.julialang.org/t/align-x-axis-of-heatmap-and-line-plot/17421>\
**Category:** Visualization\
**Created:** [November 12, 2018, 6:34am UTC](https://discourse.julialang.org/t/align-x-axis-of-heatmap-and-line-plot/17421 "2018-11-12T06:34:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donut\_Meepo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/donut_meepo/32/9085_2.png) [@Donut\_Meepo](https://discourse.julialang.org/u/Donut_Meepo)\
**Post date:** [November 12, 2018, 6:34am UTC](https://discourse.julialang.org/t/align-x-axis-of-heatmap-and-line-plot/17421/1 "2018-11-12T06:34:19Z")

</div>

Hi,

I am trying to make subplots of heatmap and line plot. I want to get a square and larger heatmap on top of the thin line plot that are aligned with x axis. The image I attached is what I can get so far. I was trying to adjust the widths and heights but I couldn’t get it right.

```julia
gr()
#heatmap
x=rand(150, 150)
p1=heatmap(x,aspect_ratio=1)
#line plot
y=rand(150)
p2=plot(y, legend=false)

plot(p1, p2, layout = grid(2, 1, widths = [0.9,0.9], heights=[0.9,0.1]))

```

Thank you for helping!

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/8/780a3e25cd930af80901ada91c275734e3292724.png)

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [November 12, 2018, 6:58am UTC](https://discourse.julialang.org/t/align-x-axis-of-heatmap-and-line-plot/17421/2 "2018-11-12T06:58:36Z")

</div>

Bug ☹
