您的位置:首页 > 编程语言 > Python开发

Python数据分析与展示 | 【第二周】数据分析之展示 课后作业

2017-05-28 17:40 591 查看
1单选(1分)

下面语句中pyplot是什么含义?

import matplotlib.pyplot as plt

A.matplotlib的类

B.matplotlib的子函数

C.matplotlib的方法

D.matplotlib的子库

正确答案:D

2单选(1分)



上图绘制区域分成两部分,可以采用如下哪个代码实现?

A.plt.subplot(111)

B.plt.subplot(121)

C.plt.subplot(211)

D.plt.subplot(112)

正确答案:C

3单选(1分)

下列语句将绘制什么内容?

import matplotlib.pyplot as plt

x = [4, 9, 2, 1, 8, 5]

plt.plot(x)

plt.show()

A.一条以x对应值为横轴坐标,以0到5为纵坐标的线

B.一条以0到5为横坐标,x对应值为纵坐标的线

C.一条以x对应值为横轴坐标的散点

D.一条以x对应值为纵坐标的散点

正确答案:B

4单选(1分)

使用哪个函数可以给坐标系增加横轴标签?

A.plt.label(y,”标签”)

B.plt.label(x,”标签”)

C.plt.xlabel(“标签”)

D.plt.ylabel(“标签”)

正确答案:C

5单选(1分)

使用哪个函数可以给整个坐标系增加标题?

A.plt.text()

B.plt.label()

C.plt.title()

D.plt.annotate()

正确答案:C

6单选(1分)

plt.text()函数的作用是什么?

A.给坐标轴增加题注

B.给坐标系增加标题

C.给坐标轴增加文本标签

D.在任意位置增加文本

正确答案:D

7单选(1分)

绘制散点图使用如下哪个函数?

A.plt.specgram()

B.plt.polar()

C.plt.plot()

D.plt.bar()

正确答案:C

8单选(1分)

下面哪个对matplotlib库的描述,哪个不正确?

A.matplotlib是Python第三方数据展示库

B.matplotlib库是基于numpy库设计实现的

C.matplotlib.pyplot是绘图的一种“快捷方式”

D.matplotlib库展示的数据图无法输出为文件

正确答案:D

9单选(1分)

如下语句中fontproperties的作用是什么?

plt.xlabel(‘X坐标轴’, fontproperties=’SimHei’, fontsize=20)

A.设置坐标轴标签的大小

B.设置坐标轴标签的颜色

C.设置坐标轴标签的字体,以正确显示中文

D.设置坐标轴标签的风格

正确答案:C

10单选(1分)

下面哪行代码表达下图中的ax3?



import matplotlib.gridspec as gridspec

gs = gridspec.GridSpec(3,3)

A.plt.subplot(gs[1,:-1])

B.plt.subplot(gs[0,:])

C.plt.subplot(gs[1:,-1])

D.plt.subplot(gs[2,0])

正确答案:C

11填空(2分)


4000
下列代码中填写空格,绘制一条绿色、用实心圈标记的虚线。

import matplotlib.pyplot as plt

import numpy as np

a = np.arange(10)

plt.plot(a, a*1.5, __)

plt.show()

正确答案:’go:’ 或 “go:”

12填空(2分)

在下列代码中填写空格,绘制一条蓝色的点划线。

import matplotlib.pyplot as plt

import numpy as np

a = np.arange(10)

plt.plot(a, a*1.5, __)

plt.show()

正确答案:’b-.’ 或 “b-.”

13填空(2分)

绘制饼图使用plt.__()函数。

正确答案:pie

14填空(2分)

绘制直方图使用plt.__()函数

正确答案:hist

15填空(2分)

绘制极坐标图使用plt.___()函数

正确答案:polar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: