'Displaying xaxis value every certain intervals on Matplotlib

I would like to display the value of xaxis on the subplot in every certain interval. For instance, in the following plot, I have the value of col6 xaxis displayed on the plot for every 30 mins. How can I achieve this using matplotlib?
As a side note, I tried using ax.text or ax.annotate, but I couldn't build the logic to tie it up with my yaxis time data to show it every hour or 30 mins. I appreciate any help on this.

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source