[Matplotlib-users] matplotlibrc prop_cycle error

Emlyn Price emlyn.je.price at gmail.com
Wed Sep 13 18:17:01 EDT 2017


Hi,

I have been trying to set up a custom color cycle in matplotlib using the
matplotlibrc file. I have encountered a problem with the default
matplotlibrc file provided with the installation from Arch llinux's package
manager and the example provided in the online documentation at:
https://matplotlib.org/users/customizing.html

When the lines controlling the axes.prop_cycle are uncommented:

axes.prop_cycle    : cycler('color',
                            ['1f77b4', 'ff7f0e', '2ca02c', 'd62728',
                              '9467bd', '8c564b', 'e377c2', '7f7f7f',
                              'bcbd22', '17becf'])


the following message is generated when I import matplotlib:

/usr/lib/python3.6/site-packages/matplotlib/__init__.py:1078: UserWarning:
Illegal line #338
    "                            ['1f77b4', 'ff7f0e', '2ca02c', 'd62728',
"
    in file "/home/ejp/mpl_test/matplotlibrc"
  warnings.warn('Illegal %s' % error_details)
/usr/lib/python3.6/site-packages/matplotlib/__init__.py:1078: UserWarning:
Illegal line #339
    "                              '9467bd', '8c564b', 'e377c2', '7f7f7f',
"
    in file "/home/ejp/mpl_test/matplotlibrc"
  warnings.warn('Illegal %s' % error_details)
/usr/lib/python3.6/site-packages/matplotlib/__init__.py:1078: UserWarning:
Illegal line #340
    "                              'bcbd22', '17becf'])
"
    in file "/home/ejp/mpl_test/matplotlibrc"
  warnings.warn('Illegal %s' % error_details)
/usr/lib/python3.6/site-packages/matplotlib/__init__.py:1120: UserWarning:
Bad val "cycler('color'," on line #337
    "axes.prop_cycle    : cycler('color',
"
    in file "/home/ejp/mpl_test/matplotlibrc"
    Key axes.prop_cycle: 'cycler('color',' is not a valid cycler
construction: unexpected EOF while parsing (<string>, line 1)
  (val, error_details, msg))

The same error is generated if I import cycler using

import cycler

or

from cycler import cycler

I am using matplotlib 2.0.2 in python version 3.6.2 installed from the Arch
Linux repositories.
The ouput of uname -a is :Linux tinker 4.12.12-1-ARCH #1 SMP PREEMPT Sun
Sep 10 09:41:14 CEST 2017 x86_64 GNU/Linux

To reproduce:

Copy the default matplotlibrc
Uncomment the lines containing
axes.prop_cycle    : cycler('color',
                            ['1f77b4', 'ff7f0e', '2ca02c', 'd62728',
                              '9467bd', '8c564b', 'e377c2', '7f7f7f',
                              'bcbd22', '17becf'])
Run python in the directory containing the matplotlibrc file
Import matplotlib

Am I missing something obvious?
Thanks,
Emlyn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170913/0867a811/attachment.html>


More information about the Matplotlib-users mailing list