Closed
Description
Bug report
matplotlib/lines.py in set_markeredgecolor(self, ec) raises an exception if mec is specified by a numpy array.
In [9]: plt.plot(x, x, mec=np.array([0.1, 0.1, 0.1]))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-9-d091fe25a343> in <module>()
----> 1 plt.plot(x, x, mec=np.array([0.1, 0.1, 0.1]))
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs)
3315 mplDeprecation)
3316 try:
-> 3317 ret = ax.plot(*args, **kwargs)
3318 finally:
3319 ax._hold = washold
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py in inner(ax, *args, **kwargs)
1896 warnings.warn(msg % (label_namer, func.__name__),
1897 RuntimeWarning, stacklevel=2)
-> 1898 return func(ax, *args, **kwargs)
1899 pre_doc = inner.__doc__
1900 if pre_doc is None:
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py in plot(self, *args, **kwargs)
1404 kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
1405
-> 1406 for line in self._get_lines(*args, **kwargs):
1407 self.add_line(line)
1408 lines.append(line)
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _grab_next_args(self, *args, **kwargs)
405 return
406 if len(remaining) <= 3:
--> 407 for seg in self._plot_args(remaining, kwargs):
408 yield seg
409 return
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _plot_args(self, tup, kwargs)
393 ncx, ncy = x.shape[1], y.shape[1]
394 for j in xrange(max(ncx, ncy)):
--> 395 seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
396 ret.append(seg)
397 return ret
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _makeline(self, x, y, kw, kwargs)
300 default_dict = self._getdefaults(None, kw)
301 self._setdefaults(default_dict, kw)
--> 302 seg = mlines.Line2D(x, y, **kw)
303 return seg
304
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/lines.py in __init__(self, xdata, ydata, linewidth, linestyle, color, marker, markersize, markeredgewidth, markeredgecolor, markerfacecolor, markerfacecoloralt, fillstyle, antialiased, dash_capstyle, solid_capstyle, dash_joinstyle, solid_joinstyle, pickradius, drawstyle, markevery, **kwargs)
420 self.set_markerfacecolor(markerfacecolor)
421 self.set_markerfacecoloralt(markerfacecoloralt)
--> 422 self.set_markeredgecolor(markeredgecolor)
423 self.set_markeredgewidth(markeredgewidth)
424
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/lines.py in set_markeredgecolor(self, ec)
1180 if ec is None:
1181 ec = 'auto'
-> 1182 if self._markeredgecolor != ec:
1183 self.stale = True
1184 self._markeredgecolor = ec
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
In [10]: plt.plot(x, x, mec=[0.1, 0.1, 0.1])
Out[10]: [<matplotlib.lines.Line2D at 0x7f17949e84a8>]
In [11]: plt.plot(x, x, mec=np.array([0.1, 0.1, 0.1]))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-11-d091fe25a343> in <module>()
----> 1 plt.plot(x, x, mec=np.array([0.1, 0.1, 0.1]))
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs)
3315 mplDeprecation)
3316 try:
-> 3317 ret = ax.plot(*args, **kwargs)
3318 finally:
3319 ax._hold = washold
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py in inner(ax, *args, **kwargs)
1896 warnings.warn(msg % (label_namer, func.__name__),
1897 RuntimeWarning, stacklevel=2)
-> 1898 return func(ax, *args, **kwargs)
1899 pre_doc = inner.__doc__
1900 if pre_doc is None:
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py in plot(self, *args, **kwargs)
1404 kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
1405
-> 1406 for line in self._get_lines(*args, **kwargs):
1407 self.add_line(line)
1408 lines.append(line)
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _grab_next_args(self, *args, **kwargs)
405 return
406 if len(remaining) <= 3:
--> 407 for seg in self._plot_args(remaining, kwargs):
408 yield seg
409 return
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _plot_args(self, tup, kwargs)
393 ncx, ncy = x.shape[1], y.shape[1]
394 for j in xrange(max(ncx, ncy)):
--> 395 seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
396 ret.append(seg)
397 return ret
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _makeline(self, x, y, kw, kwargs)
300 default_dict = self._getdefaults(None, kw)
301 self._setdefaults(default_dict, kw)
--> 302 seg = mlines.Line2D(x, y, **kw)
303 return seg
304
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/lines.py in __init__(self, xdata, ydata, linewidth, linestyle, color, marker, markersize, markeredgewidth, markeredgecolor, markerfacecolor, markerfacecoloralt, fillstyle, antialiased, dash_capstyle, solid_capstyle, dash_joinstyle, solid_joinstyle, pickradius, drawstyle, markevery, **kwargs)
420 self.set_markerfacecolor(markerfacecolor)
421 self.set_markerfacecoloralt(markerfacecoloralt)
--> 422 self.set_markeredgecolor(markeredgecolor)
423 self.set_markeredgewidth(markeredgewidth)
424
~/applications/anaconda3/lib/python3.5/site-packages/matplotlib/lines.py in set_markeredgecolor(self, ec)
1180 if ec is None:
1181 ec = 'auto'
-> 1182 if self._markeredgecolor != ec:
1183 self.stale = True
1184 self._markeredgecolor = ec
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
In [12]: mpl.__version__
Out[12]: '2.0.2'
- Operating System: Linux
- Matplotlib Version: 2.0.2
- Python Version: 3.5
conda installation.
Metadata
Metadata
Assignees
Labels
No labels