# Preventing ticks from appearing outside of a plot

**URL:** <https://discourse.julialang.org/t/preventing-ticks-from-appearing-outside-of-a-plot/88907>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [October 18, 2022, 11:35am UTC](https://discourse.julialang.org/t/preventing-ticks-from-appearing-outside-of-a-plot/88907 "2022-10-18T11:35:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spynel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/spynel/32/43651_2.png) [@Spynel](https://discourse.julialang.org/u/Spynel)\
**Post date:** [October 18, 2022, 11:35am UTC](https://discourse.julialang.org/t/preventing-ticks-from-appearing-outside-of-a-plot/88907/1 "2022-10-18T11:35:04Z")

</div>

Hello !  
I am working on a code that’s supposed to display a plot with dates on the X axis. That part works, but when moving the plot left and right, the ticks on the x axis stay displayed even when they’re outside of the plot. Is there a way to prevent that ?

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [October 18, 2022, 11:59am UTC](https://discourse.julialang.org/t/preventing-ticks-from-appearing-outside-of-a-plot/88907/2 "2022-10-18T11:59:35Z")

</div>

That shouldn’t happen, do you have a minimal example that shows this bug? You can open an issue on Github with that 🙂

---

<div class="post-metadata">

**Author:** ![Spynel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/spynel/32/43651_2.png) [@Spynel](https://discourse.julialang.org/u/Spynel)\
**Post date:** [October 18, 2022, 12:42pm UTC](https://discourse.julialang.org/t/preventing-ticks-from-appearing-outside-of-a-plot/88907/3 "2022-10-18T12:42:01Z")

</div>

Here’s a pretty simple example that shows the same behaviour !

```julia
using GLMakie
using DataFrames
using Dates

data = DataFrame(dates=today() : Day(1) : today()+Day(10), values=1:1:11);

# Creating the Figure
fig = Figure(resolution = (1300, 600))
# Creating the Axis
ax1 = Axis(fig[1,1],
    aspect=1,
    xticklabelsize=10,
    xticklabelrotation=35*pi/180,
    )

# Drawing the curve
plt = lines!(ax1, datetime2rata.(data.dates), data.values)
# Formatting the x ticks
ax1.xticks[] = (datetime2rata.(data.dates) , Dates.format.(data.dates, "dd/mm"));

display(fig)

```
