0

I'm relatively new to Seaborn and I'm trying to plot the distribution of WhatsApp messages by time but I don't quite get it yet.

I've got the WhatsApp chat in a df sorted by date, time, sender and message. If I plot displot(df["Times"], bins=24), I get a histogram that makes sense. Now, obviously, the histogram goes from 00:00 to 23:59.

How can I "shift" the histogram, so it goes from like 04:00 to 03:59 which would make more sense here?

Also, how can I change the values on the x-Axis? Due to the Datetime format the values all have today's date in front of them which looks stupid in the histogram. I want it to say 2 pm instead of 10-18-2020 14:00:00.

Thanks!

Christian Baumann
  • 3,188
  • 3
  • 20
  • 37
1tr3mm3l7
  • 71
  • 1
  • 5
  • 1
    Does this answer your question? [How to change the X axis range in seaborn in python?](https://stackoverflow.com/questions/54822884/how-to-change-the-x-axis-range-in-seaborn-in-python) – kiran_raj_r Oct 18 '20 at 12:08
  • This approach shows how to create a histogram per hour and set custom ticklabels: [Histogram per hour - matplotlib](https://stackoverflow.com/questions/53244590/histogram-per-hour-matplotlib) – JohanC Oct 18 '20 at 12:37

0 Answers0