Files
2026-10-09 14:11:54 +08:00

22 lines
552 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#**********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")