My guess is that the error happens when the matplotlib tries to format
the date ticklabels when the xlim is not correctly set, i.e., [0, 1]
in the example. But, I'm not sure what is the best approach here.

Werner, if there is nothing to draw (i,e, xlim is [0,1]), change the
xlim to some arbitrary range that is greater than 1 (e.g, [1,2]). For
example, in your code, you may do something like following after
calling the autoscale_view().


        self.axes.autoscale_view()
        if self.axes.get_xlim()[0] < 1:
            self.axes.set_xlim(dates[0], dates[-1])

Regards,

-JJ


On Fri, Sep 18, 2009 at 11:41 AM, Werner F. Bruhin
<werner.bru...@free.fr> wrote:
> John Hunter wrote:
>> On Fri, Sep 18, 2009 at 8:15 AM, Werner F. Bruhin <werner.bru...@free.fr> 
>> wrote:
>>
>>> John Hunter wrote:
>>>
>>>> We want a complete, free standing example that exposes the bug, with any
>>>> additional info like mpl backend and version number.
>>>>
>>
>> Thanks -- when posting a bug, please consider taking the time to make
>> a *minimal* example.
> Sorry about that - was a bit in a hurry, but that is no excuse!
>
> Will do better next time.
>
> Thanks for anyhow having taken the time to look at it and to distill it
> down.
>
> Werner
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to