Re: [Matplotlib-users] MonthLocator doesn't honour rrule bymonthday -1 value for last day of month

2013-04-13 Thread Mark Lawrence
I've found the solution. MonthLocator doesn't support the bysetpos argument that rrule can use. Thankfully from my POV the following two lines give me exactly what I want. rule = rrulewrapper(MONTHLY, bymonthday=(firstDate.day, -1), bysetpos=1) majorLocator = RRuleLocator(rule) Just wish I'd

Re: [Matplotlib-users] MonthLocator doesn't honour rrule bymonthday -1 value for last day of month

2013-04-04 Thread Mark Lawrence
Sadly no :( I want the day of the month that I'm processing *OR* the last day. The worst case for this is obviously the 31st of each month. The rrule code I've given provides exactly that. When transferred to mpl that doesn't work. On 04/04/2013 17:31, Phil Elson wrote: > Hi Mark, > > Than

Re: [Matplotlib-users] MonthLocator doesn't honour rrule bymonthday -1 value for last day of month

2013-04-04 Thread Phil Elson
Hi Mark, Thanks for persevering :-) What is it you want to achieve? Is it that you just want the last day of each month as the located value? Changing your locator to: ax.xaxis.set_major_locator(MonthLocator(bymonthday = -1)) Seems to do the trick for me (I've never looked at the mpl date magi

Re: [Matplotlib-users] MonthLocator doesn't honour rrule bymonthday -1 value for last day of month

2013-04-04 Thread Mark Lawrence
On 01/04/2013 14:48, Mark Lawrence wrote: > On 29/03/2013 15:49, Mark Lawrence wrote: >> Hi all, >> >>From http://labix.org/python-dateutil >> >> "To generate a rrule for the use case of "a date on the specified day of >> the month, unless it is beyond the end of month, in which case it will >>

Re: [Matplotlib-users] MonthLocator doesn't honour rrule bymonthday -1 value for last day of month

2013-04-01 Thread Mark Lawrence
On 29/03/2013 15:49, Mark Lawrence wrote: > Hi all, > > From http://labix.org/python-dateutil > > "To generate a rrule for the use case of "a date on the specified day of > the month, unless it is beyond the end of month, in which case it will > be the last day of the month" use the following: >

[Matplotlib-users] MonthLocator doesn't honour rrule bymonthday -1 value for last day of month

2013-03-29 Thread Mark Lawrence
Hi all, From http://labix.org/python-dateutil "To generate a rrule for the use case of "a date on the specified day of the month, unless it is beyond the end of month, in which case it will be the last day of the month" use the following: rrule(MONTHLY, bymonthday=(some_day, -1), bysetpos=1)