# Putting xaxis ticks and labels on top (not bottom)

**URL:** <https://discourse.julialang.org/t/putting-xaxis-ticks-and-labels-on-top-not-bottom/47854>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [October 6, 2020, 1:30pm UTC](https://discourse.julialang.org/t/putting-xaxis-ticks-and-labels-on-top-not-bottom/47854 "2020-10-06T13:30:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mit.edelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mit.edelman/32/18467_2.png) [@mit.edelman](https://discourse.julialang.org/u/mit.edelman)\
**Post date:** [October 6, 2020, 1:30pm UTC](https://discourse.julialang.org/t/putting-xaxis-ticks-and-labels-on-top-not-bottom/47854/1 "2020-10-06T13:30:53Z")

</div>

In a plot, the xticks and the xlabel go at the bottom. Can I directly put it on top rather than the bottom by somehow using `guide_position` somehow? or what does `guide_position` do?

---

<div class="post-metadata">

**Author:** ![daschw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daschw/32/2926_2.png) [@daschw](https://discourse.julialang.org/u/daschw)\
**Post date:** [October 6, 2020, 2:03pm UTC](https://discourse.julialang.org/t/putting-xaxis-ticks-and-labels-on-top-not-bottom/47854/2 "2020-10-06T14:03:15Z")

</div>

You can move the guide and the axis to the opposite position with the `mirror` attribute.

```julia
using Plots
plot(rand(10), xguide = "x", yguide = "y", xmirror = true)

```

![mirror](https://global.discourse-cdn.com/julialang/original/3X/7/0/709bfc2af8ffd84567c5237bd0d28c2c1c0d0bb9.png)

`guide_position` can be used to only move the guide, however this does not seem to work perfectly - it cuts the label in GR:

```julia
plot(rand(10), guide_position = :top, xguide = "x")

```

![guide](https://global.discourse-cdn.com/julialang/original/3X/7/d/7d7471d45d46af862cbdaee3b42d630a4533526c.png)

Both images above are with `gr()`. This does not work with `plotly()`. I am not sure about the other backends.

---

<div class="post-metadata">

**Author:** ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)\
**Post date:** [October 6, 2020, 3:01pm UTC](https://discourse.julialang.org/t/putting-xaxis-ticks-and-labels-on-top-not-bottom/47854/4 "2020-10-06T15:01:49Z")

</div>

```julia
using Gaston
plot(rand(10), Axes(xtics=:off, x2tics = :on, x2label = :x, ylabel = :y))

```

![image](https://global.discourse-cdn.com/julialang/original/3X/5/1/5150cf8a2df0fcbb8cd2b21a13f5726a219b2e56.png)
