You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data keyword argument when calling pcolor cannot be used to pass the xy-coordinates and bin values. From the online documentation, the data keyword should be able to replace "any positional or keyword argument" in pcolor. This issue is demonstrated in the following script.
#!/usr/bin/env python3importmatplotlib.pyplotaspltimportnumpyasnpX=np.array([1,2,3,4,5,6])
Y=np.array([1,2,3,4,5,6])
C=np.array([[1,2,3,4,5],
[2,3,4,5,6],
[3,4,5,6,7],
[4,5,6,7,8],
[5,6,7,8,9]])
plt.pcolor(X, Y, C)
plt.show()
plt.pcolor(data= {'X':X, 'Y':Y, 'C':C})
plt.show()
Expected behavior: The same plot is displayed twice.
Actual behavior: The first call to pcolor produces the expected plot, but the second call to pcolor gives a TypeError with the following traceback.
Traceback (most recent call last):
File "./example.py", line 17, in <module>
plt.pcolor(data = {'X':X, 'Y':Y, 'C':C})
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 3018, in pcolor
ret = ax.pcolor(*args, **kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 4890, in pcolor
X, Y, C = self._pcolorargs('pcolor', *args, allmatch=False)
File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 4696, in _pcolorargs
'Illegal arguments to %s; see help(%s)' % (funcname, funcname))
TypeError: Illegal arguments to pcolor; see help(pcolor)
This was tested using Matplotlib v1.4.2 running on Debian 8 (Jessie). Identical results were obtained on both python 2.7.9 and python 3.4.2. Python and matplotlib were installed from apt-get, using the "python", "python-matplotlib", "python3" and "python3-matplotlib" packages.
The text was updated successfully, but these errors were encountered:
Support for data was added in the 1.5 series; that's the version documented by the web link you gave. You can uninstall the Debian matplotlib packages and then use "pip install matplotlib" to get a v1.5.x version.
The
data
keyword argument when callingpcolor
cannot be used to pass the xy-coordinates and bin values. From the online documentation, the data keyword should be able to replace "any positional or keyword argument" inpcolor
. This issue is demonstrated in the following script.Expected behavior: The same plot is displayed twice.
Actual behavior: The first call to pcolor produces the expected plot, but the second call to
pcolor
gives aTypeError
with the following traceback.This was tested using Matplotlib v1.4.2 running on Debian 8 (Jessie). Identical results were obtained on both python 2.7.9 and python 3.4.2. Python and matplotlib were installed from apt-get, using the "python", "python-matplotlib", "python3" and "python3-matplotlib" packages.
The text was updated successfully, but these errors were encountered: