绘制函数y=sin(x)的散点图,请从以下选项中选出你认为正确的答案:( )
公共代码如下:
import numpy as np
import matplotlib. pyplot as plt
x = np.linspace(0.1, 2*np. pi, 50)
y = np.sin(x)
选项:
A:fig = plt.figure( )
plt.plot(x,y)
plt.show( )
B:fig = plt.figure( )
plt.barh(x,y)
plt.show( )
C:fig = plt.figure ( )
plt.bar(x,y)
plt.show( )
D:fig = plt.figure ( )
plt.scatter(x,y)
plt.show( )
发布时间:2024-04-19 21:32:10