# Can't seem to change default Height on Graph

**URL:** <https://community.plotly.com/t/cant-seem-to-change-default-height-on-graph/6742>\
**Category:** Dash Python\
**Created:** [November 10, 2017, 6:19pm UTC](https://community.plotly.com/t/cant-seem-to-change-default-height-on-graph/6742 "2017-11-10T18:19:30Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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, 6:54pm UTC](https://community.plotly.com/t/cant-seem-to-change-default-height-on-graph/6742/7 "2017-12-04T18:54:01Z")

</div>

Summary of sizing graphs with Dash:

In summary:

- Setting the size of the container is done with `dcc.Graph(style={...})`. These are CSS styles, so any units work: `%`, `px`, `vh`, `vw`. The Graph should expand into the container.
- The `figure` of the graph can also have dimensions and these are specified through the `layout`, `figure={'layout': {'width': '100px'}}`. Only `px` are supported here. I don’t think that there are any advantages to setting the dimensions in the figure rather than the container (as in `style=` as above).
- When the window resize, the graph is automatically re-plotted _inside_ the container - expanding to the container’s dimensions. Behind-the-scenes, this is happening with the `Plotly.resize` plotly.js call (here’s the code: [https://github.com/plotly/dash-core-components/blob/c898d75a1a189943bcf92bc73b95bd08432ddd7d/src/components/Graph.react.js#L127-L129](https://github.com/plotly/dash-core-components/blob/c898d75a1a189943bcf92bc73b95bd08432ddd7d/src/components/Graph.react.js#L127-L129))
- Note that if the container itself is resizable, the graph will not be replotted/resized. There isn’t a reliable way to tell if a graph’s container has changed size in JavaScript yet, so we’re just checking if the window is resized.

---

_[View the full topic](https://community.plotly.com/t/cant-seem-to-change-default-height-on-graph/6742)._
