8000 eventplot throws exception when using color different than one of {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'} · Issue #8193 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
eventplot throws exception when using color different than one of {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'} #8193
Closed
@aweinstein

Description

@aweinstein

Bug report

The user guide (http://matplotlib.org/users/colors.html) specifies different ways to specify the color parameter. However, eventplot throws an exception when using a color different than the one in {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}, such as color='C0' or color='0.5'.

Code for reproduction

plt.eventplot([1,2], color='C0')

Actual outcome

Traceback (most recent call last):
  File "<ipython-input-15-6ce26cd5e5a1>", line 1, in <module>
    plt.eventplot([1,2], color='C0')
  File "/home/ajw/.local/anaconda/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2956, in eventplot
    linestyles=linestyles, data=data, **kwargs)
  File "/home/ajw/.local/anaconda/lib/python3.6/site-packages/matplotlib/__init__.py", line 1892, in inner
    return func(ax, *args, **kwargs)
  File "/home/ajw/.local/anaconda/lib/python3.6/site-packages/matplotlib/axes/_axes.py", line 1219, in eventplot
    raise ValueError('colors and positions are unequal sized '
ValueError: colors and positions are unequal sized sequences

Matplotlib version

  • Matplotlib version 2.2.0, Python version 3.6, running on Linux
  • Anaconda 4.3.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0