My attempt to fix an issue with separate scales for left and right axis in scikits.timeseries - correct?

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

My attempt to fix an issue with separate scales for left and right axis in scikits.timeseries - correct?

Paweł Rumian
Hello,

I've tried to solve an issue with scikits.timeseries doesn't allowing
to use separate scales for left and right axis with recent versions of
matplotlib, like in this example:
http://pytseries.sourceforge.net/lib.plotting.examples.html#separate-scales-for-left-and-right-axis

The issue was raised twice:
http://mail.scipy.org/pipermail/scipy-user/2011-April/029046.html
http://permalink.gmane.org/gmane.comp.python.scientific.devel/14645

The example (and my code) works after changing single line 1196:
-    fsp_alt_args = (fsp._rows, fsp._cols, fsp._num + 1)
+    fsp_alt_args = fsp.get_geometry()

I've done this after examining the file
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes.py
(method get_geometry in line 8369).

Can anyone take a look at the code and say if it makes sense? I'm
certainly not an expert in Python and I'm not sure if this can be so
simple and yet correct.

Side note:
I know scikits.timeseries may be abandoned for a while now (I've
traced the recent discussion of its status), but I use it heavily in
climate analysis and need to keep my code alive for some time.

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

Re: My attempt to fix an issue with separate scales for left and right axis in scikits.timeseries - correct?

dhirschfeld
Paweł <gorkypl <at> gmail.com> writes:

>
> The example (and my code) works after changing single line 1196:
> -    fsp_alt_args = (fsp._rows, fsp._cols, fsp._num + 1)
> +    fsp_alt_args = fsp.get_geometry()
>
>
> Can anyone take a look at the code and say if it makes sense? I'm
> certainly not an expert in Python and I'm not sure if this can be so
> simple and yet correct.
>
> greetings,
> Paweł Rumian

FWIW I can confirm that the fix works for me - thanks!

Unfortuantely I'm not an expert in the internals of either matplotlib or
scikits.timeseries so I don't feel qualified to say whether it's the right fix :/

I'm running 32bit Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500
32 bit (Intel)] on a Win7 x64 box.

-Dave




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

Re: My attempt to fix an issue with separate scales for left and right axis in scikits.timeseries - correct?

Paweł Rumian
2011/8/19 Dave Hirschfeld <[hidden email]>:
> Paweł <gorkypl <at> gmail.com> writes:
>>
>> The example (and my code) works after changing single line 1196:
>> -    fsp_alt_args = (fsp._rows, fsp._cols, fsp._num + 1)
>> +    fsp_alt_args = fsp.get_geometry()
>
> FWIW I can confirm that the fix works for me - thanks!

Thanks for confirming :)

I've just noticed I havent stated it clearly - the change has to be
done in scikits/timeseries/lib/plotlib.py of course.

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