# Zero line location

**URL:** <https://community.plotly.com/t/zero-line-location/72676>\
**Category:** 📊 Plotly Python\
**Created:** [February 14, 2023, 11:45am UTC](https://community.plotly.com/t/zero-line-location/72676 "2023-02-14T11:45:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bijan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/bijan/32/22061_2.png) [@Bijan](https://community.plotly.com/u/Bijan)\
**Post date:** [February 14, 2023, 11:45am UTC](https://community.plotly.com/t/zero-line-location/72676/1 "2023-02-14T11:45:53Z")

</div>

Hi there,

I need to change the location of yaxis. Normally it starts at x=0 but for some reasons I need it starts at x=2. Guide me what should I do? (I hope there be an option instead of draw line using shapes)

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [February 14, 2023, 12:24pm UTC](https://community.plotly.com/t/zero-line-location/72676/2 "2023-02-14T12:24:08Z")

</div>

Hi @Bijan,

what exactly are you referring to? Maybe taking this as reference:

```python
import plotly.express as px 
fig = px.scatter(y=[1, 2, 3, -3])
fig.update_yaxes(showline=True, linewidth=2, linecolor='black')

```

creates:  
 ![newplot (1)](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/8/8/88ebc915e1cb748e6af247a9337009547298f6e7.png)

---

<div class="post-metadata">

**Author:** ![Bijan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/bijan/32/22061_2.png) [@Bijan](https://community.plotly.com/u/Bijan)\
**Post date:** [February 14, 2023, 1:48pm UTC](https://community.plotly.com/t/zero-line-location/72676/3 "2023-02-14T13:48:59Z")

</div>

Hi dear @AIMPED

This is exactly what I needed. But I got a little bit confused. I will ask my doubts and misunderstanding in next comment.

Fast help and fast understanding the issue and fast solve. Really thanks 👍 💪 🦾

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [February 14, 2023, 2:20pm UTC](https://community.plotly.com/t/zero-line-location/72676/4 "2023-02-14T14:20:01Z")

</div>

Glad I could be of help!

I must confess that I’m surprised to have answered your question just by creating an example as base for further discussions 🤣🤗

---

<div class="post-metadata">

**Author:** ![Bijan](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/bijan/32/22061_2.png) [@Bijan](https://community.plotly.com/u/Bijan)\
**Post date:** [February 14, 2023, 10:00pm UTC](https://community.plotly.com/t/zero-line-location/72676/5 "2023-02-14T22:00:10Z")

</div>

Yeah 😄 😄 😄 🙈

The reason of my doubt and misunderstanding was it. By your example that solved 😄. I all posts I saw that everyone suggested to draw a line if you want to show axis in another point except zero. I think they said it for case that user wants to draw the axis line in the middle of the plot not in the side. Anyway that was helpful for me and will be complete if there be a way to put an arrow along the axis at its end!

Again thanks dear @AIMPED

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [February 15, 2023, 1:28pm UTC](https://community.plotly.com/t/zero-line-location/72676/6 "2023-02-15T13:28:39Z")

</div>

Hi @Bijan, I think there is no built in way to put an arrow of the end of the axes.
