# Adjusting the size of graphs

**URL:** <https://community.plotly.com/t/adjusting-the-size-of-graphs/7128>\
**Category:** Dash Python\
**Created:** [December 4, 2017, 12:52am UTC](https://community.plotly.com/t/adjusting-the-size-of-graphs/7128 "2017-12-04T00:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynamite](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dynamite](https://community.plotly.com/u/dynamite)\
**Post date:** [December 4, 2017, 12:52am UTC](https://community.plotly.com/t/adjusting-the-size-of-graphs/7128/1 "2017-12-04T00:52:35Z")

</div>

Hi,

I want to adjust the size of the graphs to fit a window so I tried the following:

> ```
> html.Div([
> dcc.Graph(id='example-graph1')
> ], style={"height" : "25%", "width" : "100%"}),
> 
> ```

I also tried this:  
` dcc.Graph(id='example-graph2', className='hm'),`

with css here

[https://codepen.io/dynamitedu/pen/zPeVzE.css](https://codepen.io/dynamitedu/pen/zPeVzE.css)

Neither seems to work. Any ideas?

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [December 4, 2017, 5:04pm UTC](https://community.plotly.com/t/adjusting-the-size-of-graphs/7128/2 "2017-12-04T17:04:57Z")

</div>

See [Can't seem to change default Height on Graph](https://community.plotly.com/t/cant-seem-to-change-default-height-on-graph/6742/2?u=chriddyp)

If you want it to fit the window, you might try `'height': '80vh'`instead of `%`. Note that `%` is always in reference to the parent container, which may or may not have a height defined for it.

I’d also recommend adjusting this / playing around with this with your browser’s Development Tools.
