month locator makes plot dissapear

the code plots a daily average of a parameter through each day of one year. When adding the xaxis ticks to show Months instead of the day number (1...365), the plot of the parameter disappear.
Leaving xticks for each day displays plot just fine.
Thank you for any advice on how to solve my mistery.

Matplotlib version 1.1.0 (EPD 7.3.2)
OS:Linux RedHat 5

Code Snippet:

        N = len(avgtol)
        X = np.arange(1,N+1)
        fig = plt.figure(figsize=figsize_inches)
        ax = fig.add_subplot(111)

       ax.plot(X, Davgtol, label='Mean ' + paramlabel, color='green', linestyle='-')

       ax.set_title('%s ' %(paramtitle))

        # X axis
        #months = dates.MonthLocator(bymonthday=15) # try center label on day 15 of each month
        months = dates.MonthLocator() # every month
        monthsFmt = dates.DateFormatter('%b')
        days = dates.DayLocator()
        for tick in ax.xaxis.get_major_ticks():
        datemin =, 1, 1)
        datemax =, 1, 1)
        ax.set_xlim(datemin, datemax)