# Julia PyPlot: how to draw thicks on both sizes of axis?

**URL:** <https://discourse.julialang.org/t/julia-pyplot-how-to-draw-thicks-on-both-sizes-of-axis/85527>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [August 9, 2022, 12:05pm UTC](https://discourse.julialang.org/t/julia-pyplot-how-to-draw-thicks-on-both-sizes-of-axis/85527 "2022-08-09T12:05:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luigi\_Marongiu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luigi_marongiu/32/7909_2.png) [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Post date:** [August 9, 2022, 12:05pm UTC](https://discourse.julialang.org/t/julia-pyplot-how-to-draw-thicks-on-both-sizes-of-axis/85527/1 "2022-08-09T12:05:49Z")

</div>

Hello,  
what is the syntax for drawing the axis on both sizes of the axis? That is, I would like the thicks not only on the bottom of the plot (x axis) but also on the upper size. Similarly, I would like the thicks on both left and right sizes:

 ![PLOT](https://global.discourse-cdn.com/julialang/original/3X/e/9/e94bf0ba3c7bb9c9e3bff55b6f37437d4a9d827a.png)

```julia
using PyPlot
    clf()
    x = 1:10
    y = broadcast(^, 2, x)
    p = plot(x, y,
    linestyle = "-", color = "red", linewidth=2)

```

Thank you

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [August 9, 2022, 12:23pm UTC](https://discourse.julialang.org/t/julia-pyplot-how-to-draw-thicks-on-both-sizes-of-axis/85527/2 "2022-08-09T12:23:34Z")

</div>

The axis on the right can be drawn by adding

```julia
    ax = gca()
    ax.yaxis.set_ticks_position("both")

```

---

<div class="post-metadata">

**Author:** ![Luigi\_Marongiu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luigi_marongiu/32/7909_2.png) [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Post date:** [August 9, 2022, 12:32pm UTC](https://discourse.julialang.org/t/julia-pyplot-how-to-draw-thicks-on-both-sizes-of-axis/85527/3 "2022-08-09T12:32:15Z")

</div>

> [@SteffenPL](#):
>
> `ax.yaxis.set_ticks_position("both")`

Thank you!

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [August 9, 2022, 12:33pm UTC](https://discourse.julialang.org/t/julia-pyplot-how-to-draw-thicks-on-both-sizes-of-axis/85527/4 "2022-08-09T12:33:33Z")

</div>

To add also the labels on the right, one can use

```julia
ax = gca()
ax.yaxis.set_ticks_position("both")
ax.tick_params(axis="y", left="on",labelleft="on", right="on", labelright="on")

```
