以下选项的代码运行后,哪个绘制的折线图中有多个线条?()6分
选项:
A:import matplotlib.pyplot as pltimport numpy as npx = np.arange(1, 6)y_one = np.array(30, 30, 33, 33, 35])plt.plot(x, y_one)plt.show()
B:import matplotlib.pyplot as pltimport numpy as npx = np.arange(1, 6)y_one = np.array(30, 30, 33, 33, 35])y_two = np.array(26, 26, 28, 30, 30])plt.plot(x, y_one)plt.plot(x, y_two)plt.show()
C:import matplotlib.pyplot as pltimport numpy as nparr = np.array(1, 2, 3], 4, 5, 6], 7, 8, 9], 10, 11, 12]])plt.plot(arr0], arr1:])plt.show()
D:import matplotlib.pyplot as pltimport numpy as npx1, x2 = np.array(1, 2, 3]), np.array(1, 2, 3])y1, y2 = np.array(7, 8, 9]), np.array(10, 11, 12])plt.plot(x1, y1, x2, y2)plt.show()
发布时间:2024-04-08 19:00:23