Skip to content
Advertisement

How to change the frequency of x ticks for time data?

How can I change the frequency of my x ticks to every hour using matplotlib.pyplot? I looked at similar posts, but could not figure out how to apply their solutions to my data since I only have times, not full dates. Here’s an example of my data:

JavaScript

Advertisement

Answer

See: https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement