__TOC__
== Background ==
When you create a range in relax, it is created as an xrange object.<br>
This is due to memory issues, which you can read about [http://thread.gmane.org/gmane.science.nmr.relax.devel/4862/focus=4865 here.]
You cannot by default slice through xrange objects.
The '''dateutil.rrule''' package (version 1.5) used in matplotlib/pylab creates some list, which it expects it can slice through.<br>'''dateutil.rrule''' package (version 2.2) does not have this problem.
But relax will create these as '''xrange''' which is not-sliceable.
</source>
== Change bug in dateutil.rrule ==The recommended way is to update your version of the '''python-dateutil''' package. <source lang="bash">sudo pip install python-dateutil --upgrade</source> If you by some means need to stay with the current versions, you can try.
<source lang="bash">
bash
MFILE=`python -c "import dateutil.rrule; print(dateutil.rrule.__file__)"`
echo $MFILE
sudo sed -i -e 's/range(1,30), range(1,31), range(1,32)/list(range(1,30)), list(range(1,31)), list(range(1,32))/g' $MFILEsudo sed -i -e 's/range(-29,0), range(-30,0), range(-31,0)/list(range(-29,0)), list(range(-30,0)), list(range(-31,0))/g' $MFILE
</source>
Test if it worked
<source lang="bash">
$ relaxrelax> from pylab import *Traceback (most recent call last): File "cat <console>", line 1, in <moduleEOF > File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/pylabrelax_test.py", line 1, in <module> from matplotlib.pylab import * File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/pylab.py", line 221, in <module> from matplotlib import mpl # pulls in most modules File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/mplt = arange(0.py", line 30, in <module> from matplotlib import axes File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/axes2.py", line 190, in <module> import matplotlib0.dates as mdates01) File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/dates.py", line 119, in <module>s = sin(2*pi*t) from dateutil.rrule import rruleplot(t, MO, TU, WE, TH, FR, SA, SU, YEARLY, \s) File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/dateutil/rrule.py", line 26, in <module> MDAY366MASK = tuplexlabel('time (M31+M29+M31+M30+M31+M30+M31+M31+M30+M31+M30+M31+M31[:7]s)')TypeError: unsupported operand typeylabel('voltage (smV) for +: 'xrange)title(' and 'xrangeAbout as simple as it gets, folks')grid(True)show()EOF relax relax_test.py
</source>
== See also ==
[[Category:matplotlib]]