# X-axis at center of plot

**URL:** <https://discourse.julialang.org/t/x-axis-at-center-of-plot/24015>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [May 9, 2019, 4:47am UTC](https://discourse.julialang.org/t/x-axis-at-center-of-plot/24015 "2019-05-09T04:47:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshvar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rakeshvar/32/3613_2.png) [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Post date:** [May 9, 2019, 4:47am UTC](https://discourse.julialang.org/t/x-axis-at-center-of-plot/24015/1 "2019-05-09T04:47:57Z")

</div>

I want the x-axis to be at the center (y=0) but it is coming out at the bottom.

```julia
using Plots
plotly()
plot([-1, 0, 1], line=(:stem, 2), m=(:red, 3), xticks=1:3, xmirror=true, yaxis=false)

```

![newplot](https://global.discourse-cdn.com/julialang/original/3X/9/d/9d5902505d53e52576b80f4fb818a665bb3245cc.png)

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [May 9, 2019, 5:06am UTC](https://discourse.julialang.org/t/x-axis-at-center-of-plot/24015/2 "2019-05-09T05:06:43Z")

</div>

Use the `framestyle = :origin` argument. Check [Overview · Plots](https://docs.juliaplots.org/latest/attributes/)

---

<div class="post-metadata">

**Author:** ![rakeshvar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rakeshvar/32/3613_2.png) [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Post date:** [May 9, 2019, 5:21am UTC](https://discourse.julialang.org/t/x-axis-at-center-of-plot/24015/3 "2019-05-09T05:21:25Z")

</div>

Thank you for the prompt reply. Did not know that keyword.  
How do you move say only the x-axis to a specific location of y?  
For example using `:origin` also moves the y-axis to zero too, which in this case does not make much sense.

---

<div class="post-metadata">

**Author:** ![gszep](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gszep/32/14836_2.png) [@gszep](https://discourse.julialang.org/u/gszep)\
**Post date:** [May 17, 2021, 10:03am UTC](https://discourse.julialang.org/t/x-axis-at-center-of-plot/24015/4 "2021-05-17T10:03:35Z")

</div>

I also think that framestyle should have two options: `framestyle = :xorigin` and `framestyle = :yorigin`

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 17, 2021, 12:12pm UTC](https://discourse.julialang.org/t/x-axis-at-center-of-plot/24015/5 "2021-05-17T12:12:33Z")

</div>

> [@rakeshvar](#):
>
> How do you move say only the x-axis to a specific location of y?

See workaround posted [here](https://discourse.julialang.org/t/can-i-change-axis-position-in-plots/38966/9).
