- 积分
- 12226
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-12-1
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
import math
import matplotlib.pyplot as plt
import numpy as np
t=np.arange(0,2.5,0.1)
y1=map(math.sin,math.pi*t)
y2=map(math.sin,math.pi*t+math.pi/4)
y3=map(math.sin,math.pi*t-math.pi/4)
plt.plot(t,y1,'b*',t,y2,'g^',t,y3,'ys')
Traceback (most recent call last):
File "<ipython-input-17-fee227002740>", line 9, in <module>
plt.plot(t,y1,'b*',t,y2,'g^',t,y3,'ys')
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 2813, in plot
is not None else {}), **kwargs)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\__init__.py", line 1810, in inner
return func(ax, *args, **kwargs)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\axes\_axes.py", line 1611, in plot
for line in self._get_lines(*args, **kwargs):
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 393, in _grab_next_args
yield from self._plot_args(this, kwargs)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 370, in _plot_args
x, y = self._xy_from_xy(x, y)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 205, in _xy_from_xy
by = self.axes.yaxis.update_units(y)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1467, in update_units
converter = munits.registry.get_converter(data)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\units.py", line 181, in get_converter
converter = self.get_converter(next_item)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\units.py", line 187, in get_converter
thisx = safe_first_element(x)
File "D:\Users\yushui\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 1635, in safe_first_element
raise RuntimeError("matplotlib does not support generators "
RuntimeError: matplotlib does not support generators as input
|
|