我正在尝试创建一个等高线图,其中 x 坐标标记为 EF,y 标记为 EB,z 为标记为 a 的函数。它返回下面发布的长错误。任何帮助,将不胜感激。错误是
File "contour.py", line 19, in <module>
c = plt.contour(EF,EB,a)
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 2016, in contour
ret = ax.contour(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 7326, in contour
return mcontour.QuadContourSet(self, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1088, in __init__
ContourSet.__init__(self, ax, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 686, in __init__
self._process_args(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1101, in _process_args
x, y, z = self._contour_args(args, kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1148, in _contour_args
x,y,z = self._check_xyz(args[:3], kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/contour.py", line 1180, in _check_xyz
raise TypeError("Input z must be a 2D array.")
TypeError: Input z must be a 2D array.