scikits.timesereies plotting broken with latest matplotlib

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

scikits.timesereies plotting broken with latest matplotlib

dhirschfeld
With matplotlib v1.1.0 the timeseries plotting code no longer works. I had a
look and it seems that the matplotlib API has changed but not being familiar
with the internals of matplotlib I couldn't find a workaround.

Since the timeseries code is important to a lot of my work and visualising the
data is an large part of that I'll have to revert to 1.0.1 in the interim.

The specific error I get when running the "Adaptation of date_demo2.py" example
is shown below:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
C:\dev\code\<ipython-input-3-bb11947a5550> in <module>()
     28 series = ts.fill_missing_dates(raw_series)
     29 fig = tpl.tsfigure()
---> 30 fsp = fig.add_tsplot(111)
     31 fsp.tsplot(series, '-')
     32

C:\dev\bin\Python27\lib\site-packages\scikits\timeseries\lib\plotlib.pyc in
add_tsplot(self, *args, **kwargs)
   1282         if self._series is not None:
   1283             kwargs.update(series=self._series)
-> 1284         return add_generic_subplot(self, *args, **kwargs)
   1285
   1286     add_subplot = add_tsplot

C:\dev\bin\Python27\lib\site-packages\scikits\timeseries\lib\plotlib.pyc in
add_generic_subplot(figure_instance, *args, **kwargs)
    175         key = str(key)
    176
--> 177     if key in figure_instance._seen:
    178         ax = figure_instance._seen[key]
    179         figure_instance.sca(ax)

AttributeError: 'TimeSeriesFigure' object has no attribute '_seen'


Chees,
Dave

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scikits.timesereies plotting broken with latest matplotlib

Ralf Gommers-2


On Tue, Oct 25, 2011 at 1:53 PM, Dave Hirschfeld <[hidden email]> wrote:
With matplotlib v1.1.0 the timeseries plotting code no longer works. I had a
look and it seems that the matplotlib API has changed but not being familiar
with the internals of matplotlib I couldn't find a workaround.

Matplotlib has its own mailing list, please ask there.

Ralf


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scikits.timesereies plotting broken with latest matplotlib

dhirschfeld
In reply to this post by dhirschfeld
Ralf Gommers <ralf.gommers <at> googlemail.com> writes:

>
>
> On Tue, Oct 25, 2011 at 1:53 PM, Dave Hirschfeld <dave.hirschfeld <at>
gmail.com> wrote:
> With matplotlib v1.1.0 the timeseries plotting code no longer works. I had a
> look and it seems that the matplotlib API has changed but not being familiar
> with the internals of matplotlib I couldn't find a workaround.
>
>
> Matplotlib has its own mailing list, please ask there.Ralf
>

Just to clarify, the problem lies with the scikits.timeseries package which
depends (in part) upon matplotlib but which hasn't kept up with recent
developments.

AFAIK scikits.timeseries doesn't have it's own list and the authors recommend
this list as the best place to solicit help.

-Dave



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scikits.timesereies plotting broken with latest matplotlib

jseabold
On Tue, Oct 25, 2011 at 1:13 PM, Dave Hirschfeld <[hidden email]> wrote:
> Ralf Gommers <ralf.gommers <at> googlemail.com> writes:
>
>>
>>
>> On Tue, Oct 25, 2011 at 1:53 PM, Dave Hirschfeld <dave.hirschfeld <at>
> gmail.com> wrote:
>> With matplotlib v1.1.0 the timeseries plotting code no longer works. I had a
>> look and it seems that the matplotlib API has changed but not being familiar
>> with the internals of matplotlib I couldn't find a workaround.
>>
>>
>> Matplotlib has its own mailing list, please ask there.Ralf
>>
>
> Just to clarify, the problem lies with the scikits.timeseries package which
> depends (in part) upon matplotlib but which hasn't kept up with recent
> developments.
>
> AFAIK scikits.timeseries doesn't have it's own list and the authors recommend
> this list as the best place to solicit help.
>

FWIW, I've had these lines in scikits.timeseries commented out for a while with no (known) adverse effects until a proper fix. YMMV

|4 $ svn diff plotlib.py
Index: plotlib.py
===================================================================
--- plotlib.py  (revision 2267)
+++ plotlib.py  (working copy)
@@ -174,10 +174,16 @@
     except TypeError:
         key = str(key)
 
+    """
     if key in figure_instance._seen:
         ax = figure_instance._seen[key]
         figure_instance.sca(ax)
         return ax
+    """
+    ax = figure_instance._axstack.get(key)
+    if ax is not None:
+        figure_instance.sca(ax)
+        return ax
 
     SubplotClass = kwargs.pop("SubplotClass", Subplot)
     SubplotClass = kwargs.pop("subclass", SubplotClass)
@@ -187,10 +193,12 @@                                                                  
     else:                                                                             
         a = SubplotClass(figure_instance, *args, **kwargs)                            
                                                                                       
+                                                                                      
     figure_instance.axes.append(a)                                                    
-    figure_instance._axstack.push(a)
+    #figure_instance._axstack.push(a)
+    figure_instance._axstack.add(key,a)
     figure_instance.sca(a)
-    figure_instance._seen[key] = a
+    #figure_instance._seen[key] = a
     return a
 
 ##### -------------------------------------------------------------------------



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scikits.timesereies plotting broken with latest matplotlib

dhirschfeld
Skipper Seabold <jsseabold <at> gmail.com> writes:

> FWIW, I've had these lines in scikits.timeseries commented out for a while
with no (known) adverse effects until a proper fix. YMMV|4 $ svn diff plotlib.py
>
<--snip-->

Brilliant, thanks Skipper - works great for me!

Cheers,
Dave

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user