# Graph with zoomed in on page load in 2d graph

**URL:** https://community.plotly.com/t/graph-with-zoomed-in-on-page-load-in-2d-graph/82148
**Category:** plotly.js
**Created:** [February 6, 2024, 2:47pm UTC](https://community.plotly.com/t/graph-with-zoomed-in-on-page-load-in-2d-graph/82148 "2024-02-06T14:47:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kjun0306](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@kjun0306](https://community.plotly.com/u/kjun0306)
#### Post date: [February 6, 2024, 2:47pm UTC](https://community.plotly.com/t/graph-with-zoomed-in-on-page-load-in-2d-graph/82148/1 "2024-02-06T14:47:41Z")

</div>

Hi,

How can I load a graph with initial zoom in 2d graph?

Thanks.

---

<div class="post-metadata">

### Author: ![farispriadi](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/farispriadi/32/26759_2.png) [@farispriadi](https://community.plotly.com/u/farispriadi)
#### Post date: [February 7, 2024, 1:32am UTC](https://community.plotly.com/t/graph-with-zoomed-in-on-page-load-in-2d-graph/82148/2 "2024-02-07T01:32:11Z")

</div>

Hi @kjun0306 ,

Welcome to the community!

You can set `xaxis range` and `yaxis range` manually to set initial zoomed graph.

Here is an example from official docs :

[Setting The Range of Axes Manually](https://plotly.com/javascript/axes/#setting-the-range-of-axes-manually)

> **[Axes](https://plotly.com/javascript/axes/#setting-the-range-of-axes-manually)**
>
> Over 48 examples of Axes including changing color, size, log axes, and more in JavaScript.

Hope this help.

---

<div class="post-metadata">

### Author: ![kjun0306](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@kjun0306](https://community.plotly.com/u/kjun0306)
#### Post date: [February 7, 2024, 2:23pm UTC](https://community.plotly.com/t/graph-with-zoomed-in-on-page-load-in-2d-graph/82148/3 "2024-02-07T14:23:22Z")

</div>

Thank you, @farispriadi. I was able to load the page with zoomed in but double clicking to zoom out doesn’t work. Any idea?

---

<div class="post-metadata">

### Author: ![farispriadi](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/farispriadi/32/26759_2.png) [@farispriadi](https://community.plotly.com/u/farispriadi)
#### Post date: [February 7, 2024, 2:36pm UTC](https://community.plotly.com/t/graph-with-zoomed-in-on-page-load-in-2d-graph/82148/4 "2024-02-07T14:36:56Z")

</div>

Hi @kjun0306 ,

I face same problem actually, So I tried several double click but with faster interval, the zoom out magically works in my system. 😁
