22 lines
552 B
Python
22 lines
552 B
Python
#**********begin**********#
|
||
#绘制直角坐标系
|
||
#(1)导入matplotlib.pyplot库,重命名为plt
|
||
import matplotlib.pyplot as plt
|
||
|
||
def level1():
|
||
#(2)创建10*10的绘图区域
|
||
plt.figure(figsize=(10, 10))
|
||
|
||
#(3)设置坐标系x,y轴的取值范围为0-100
|
||
plt.xlim(0, 100)
|
||
plt.ylim(0, 100)
|
||
|
||
#(4)开启坐标网格
|
||
plt.grid(True)
|
||
|
||
#(5)显示创建的绘图对象
|
||
plt.show()
|
||
|
||
#**********end**********#
|
||
#将绘制的图形保存为指定路径下的图片
|
||
plt.savefig("task1/image1/t1.png") |