# PlotlyJS: how to make a responsive chart?

**URL:** <https://discourse.julialang.org/t/plotlyjs-how-to-make-a-responsive-chart/66942>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [August 24, 2021, 8:05pm UTC](https://discourse.julialang.org/t/plotlyjs-how-to-make-a-responsive-chart/66942 "2021-08-24T20:05:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 24, 2021, 8:27pm UTC](https://discourse.julialang.org/t/plotlyjs-how-to-make-a-responsive-chart/66942/2 "2021-08-24T20:27:32Z")

</div>

> [@PlotlyJS vs Plots+plotlyjs()](https://discourse.julialang.org/t/plotlyjs-vs-plots-plotlyjs/46179/7):
>
> The correct solution is not to set the height and width, but to set autosize: layout = Layout(;autosize = true, xaxis = attr(title="x", range=[0.0, L]), yaxis = attr(title = "F", range=[-1.0, 1.0])) Then the figure is responsive during the simulation as well as after. [s]

---

_[View the full topic](https://discourse.julialang.org/t/plotlyjs-how-to-make-a-responsive-chart/66942)._
