# How to keep height per row facet plot constant?

**URL:** <https://community.plotly.com/t/how-to-keep-height-per-row-facet-plot-constant/55956>\
**Category:** Dash Python\
**Created:** [August 27, 2021, 4:01am UTC](https://community.plotly.com/t/how-to-keep-height-per-row-facet-plot-constant/55956 "2021-08-27T04:01:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mail8](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mail8/32/31560_2.png) [@mail8](https://community.plotly.com/u/mail8)\
**Post date:** [August 27, 2021, 4:01am UTC](https://community.plotly.com/t/how-to-keep-height-per-row-facet-plot-constant/55956/1 "2021-08-27T04:01:30Z")

</div>

Hi,

I am trying to keep the facets in a plot at constant height, however, when I add more rows, the facets shrink until I get an error about `facet_row_spacing`.

```auto

        height = 200 * n_rows

        facet_row_spacing = None

        if n_rows != 1: facet_row_spacing = min(0.04, (1 / (n_rows - 1)) )

        fig = px.bar(data_frame=df, x='RawFile', y=plot_column, facet_col='Majority protein IDs', facet_col_wrap=1, color=color, color_discrete_sequence=px.colors.qualitative.Dark24,
                    color_continuous_scale=px.colors.sequential.Rainbow,
                    facet_row_spacing=facet_row_spacing, height=height)

        fig.update_layout(
                margin=dict( l=50, r=10, b=40, t=40, pad=0 ),
                hovermode='closest',
                )

```

Increasing the plot height linear with the number of rows leads to smaller and smaller facets the more rows are added. Is there a good way to keep the height per row constant?

---

<div class="post-metadata">

**Author:** ![mail8](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mail8/32/31560_2.png) [@mail8](https://community.plotly.com/u/mail8)\
**Post date:** [August 27, 2021, 4:02am UTC](https://community.plotly.com/t/how-to-keep-height-per-row-facet-plot-constant/55956/2 "2021-08-27T04:02:06Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/2/7/27c39b11bd1a508cd9b05e2dcf3c23114c1babd5.png)

---

<div class="post-metadata">

**Author:** ![mail8](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mail8/32/31560_2.png) [@mail8](https://community.plotly.com/u/mail8)\
**Post date:** [August 27, 2021, 4:02am UTC](https://community.plotly.com/t/how-to-keep-height-per-row-facet-plot-constant/55956/3 "2021-08-27T04:02:59Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/f/9/f91a2d6ed1d50b1eb8bc324297405f444985e4a0.png)
