# Keep subplot height at a constant height

**URL:** https://community.plotly.com/t/keep-subplot-height-at-a-constant-height/32830
**Category:** plotly.js
**Created:** [December 20, 2019, 10:22am UTC](https://community.plotly.com/t/keep-subplot-height-at-a-constant-height/32830 "2019-12-20T10:22:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Zolotoy](https://avatars.discourse-cdn.com/v4/letter/z/6bbea6/32.png) [@Zolotoy](https://community.plotly.com/u/Zolotoy)
#### Post date: [December 20, 2019, 10:22am UTC](https://community.plotly.com/t/keep-subplot-height-at-a-constant-height/32830/1 "2019-12-20T10:22:58Z")

</div>

I have a chart with a small subplot on the top of the chart. I am adding more subplots to the bottom of the chart and I increase the total height of the chart. When I do that the top subplot gets taller too. How can I keep it at the same height?

Thanks

---

<div class="post-metadata">

### Author: ![archmoj](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/archmoj/32/8388_2.png) [@archmoj](https://community.plotly.com/u/archmoj)
#### Post date: [December 24, 2019, 3:24pm UTC](https://community.plotly.com/t/keep-subplot-height-at-a-constant-height/32830/2 "2019-12-24T15:24:48Z")

</div>

You could compute y domain.  
Here is [demo](https://codepen.io/MojtabaSamimi/pen/MWYoKgK?editors=0010).

---

<div class="post-metadata">

### Author: ![Zolotoy](https://avatars.discourse-cdn.com/v4/letter/z/6bbea6/32.png) [@Zolotoy](https://community.plotly.com/u/Zolotoy)
#### Post date: [December 24, 2019, 4:13pm UTC](https://community.plotly.com/t/keep-subplot-height-at-a-constant-height/32830/3 "2019-12-24T16:13:36Z")

</div>

Dont see a subplot in your example.

---

<div class="post-metadata">

### Author: ![archmoj](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/archmoj/32/8388_2.png) [@archmoj](https://community.plotly.com/u/archmoj)
#### Post date: [December 24, 2019, 4:47pm UTC](https://community.plotly.com/t/keep-subplot-height-at-a-constant-height/32830/4 "2019-12-24T16:47:31Z")

</div>

The demo is on a subplot with Cartesian `xaxis` and `yaxis` axes.  
Noting that some traces such as `pie` have different domain setup,  
could you please share a codepen of the graph you are trying to draw?

---

<div class="post-metadata">

### Author: ![Zolotoy](https://avatars.discourse-cdn.com/v4/letter/z/6bbea6/32.png) [@Zolotoy](https://community.plotly.com/u/Zolotoy)
#### Post date: [December 24, 2019, 8:25pm UTC](https://community.plotly.com/t/keep-subplot-height-at-a-constant-height/32830/5 "2019-12-24T20:25:24Z")

</div>

Yes, probably, it is possible to have an algorithm that would calculate all possible combinations of plots/subplots but I thought there is something like ‘paper’ for shapes to keep constant height.
