Bottom Page

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 ?
Quote
#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).
Quote
#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 ?
Quote
#4
Here is an example how to rotate the Labels on the X-Axis.
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Generate matplot animation on a link ambush 0 267 Apr-01-2019, 10:23 AM
Last Post: ambush
  Cannot close matplot figure landlord1984 5 4,795 May-11-2018, 04:42 PM
Last Post: Aung_Myo_Htut

Forum Jump:


Users browsing this thread: 1 Guest(s)