Adding a function to select x ticks