Python Forum
Only show every nth tick in chart
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Only show every nth tick in chart
Hi guys,

I've plotted a chart using the following basic setup:

However, I only want to have a difference of 300 ticks between the entries on the x-axis, ie.

The problem is that I don't know how to set the tick interval automatically (I have to enter it manually to receive the desired result).

I'd be happy if someone could please help me.

Many thanks in advance!


Hello, Programmer named Tim!

I do not use Pandas, but as xticks is a series of numbers, could you try Python's range()?
df.plot(xticks=range(0, 1200, 300))
tgottsc1 likes this post

Possibly Related Threads…
Thread Author Replies Views Last Post
  Complex X Tick Interval JoeDainton123 0 754 Oct-05-2020, 07:27 PM
Last Post: JoeDainton123
  Setting Tick Intervals In Sub Plots JoeDainton123 1 818 Oct-03-2020, 11:52 PM
Last Post: scidam
  matplotlib barh y tick alignment iFunKtion 2 5,471 Oct-06-2016, 11:46 AM
Last Post: iFunKtion

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020