Thanks to visit codestin.com
Credit goes to github.com

Skip to content

linestyle parameter does not support default cycler through None, crashes instead. #6173

Closed
@madphysicist

Description

@madphysicist

Setup

matplotlib.__version__ = 1.5.1
matplotlib.__version__numpy__ = 1.6
Python 3.5.1, IPython 4.1.2 running under anaconda
OS: Red Hat 6.5

Matplotlib installed with conda install matplotlib.

Issue

Supplying None (the object, not the string) linestyle parameter to plot (and possible others) raises an error instead of going through the default cycler for that property. I would expect the following to work, but it does not:

>>> import matplotlib.pyplot as plt
>>> plt.plot(range(5), range(5), linestyle=None)
...
TypeError: object of type 'NoneType' has no len()

The expected behavior would be that all lines are drawn 'solid'.

If this is something that is worth fixing, I can take a look in a couple of days and maybe add code similar to what is done for the color argument. The docs would need to be updated too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions