Python Forum

Full Version: remove weekends from matplot
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 :

[attachment=693]

Gaps are highlighted in red circles.

any support ?
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).
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 ?
Here is an example how to rotate the Labels on the X-Axis.