Python Forum
remove weekends from matplot
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
remove weekends from matplot
#1
I am plotting some charts and I noticed that I have gaps in the weekend days.
I want to remove the weekend days from the chart.


from matplotlib.dates import (DateFormatter, MonthLocator,date2num)

months = MonthLocator()
daysFmt = DateFormatter("%d %b %y")
The picture looks like :

   

Gaps are highlighted in red circles.

any support ?
Reply
#2
I don't think it is possible to use discontinuous axis with matplotlib. However,
you can try to plot your data versus some index, e.g. [1, ..., N] (no dates),
and assign custom formatted labels to that index (and, finally, rotate them on 45 deg).
Reply
#3
you can try to plot your data versus some index, e.g. [1, ..., N] (no dates),
I understand this sentence and I already did it.

and assign custom formatted labels to that index (and, finally, rotate them on 45 deg).
what do u mean by this ?
Reply
#4
Here is an example how to rotate the Labels on the X-Axis.
mr_byte31 likes this post
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Matplot / numpy noisy data problem the57chambers 1 664 Feb-09-2023, 03:27 AM
Last Post: deanhystad
  Error when running a matplot lib example aurelius_nero 3 6,688 Apr-24-2022, 01:24 PM
Last Post: Axel_Erfurt
  How to save Matplot chart to temp file? Morkus 2 4,435 Jun-12-2021, 10:52 AM
Last Post: Morkus
  Generate matplot animation on a link ambush 0 2,131 Apr-01-2019, 10:23 AM
Last Post: ambush
  Cannot close matplot figure landlord1984 5 8,954 May-11-2018, 04:42 PM
Last Post: Aung_Myo_Htut

Forum Jump:

User Panel Messages

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