本教程操作环境:windows7系统、Python3版、Dell G3电脑。
python画圆代码
from matplotlib.patches import Ellipse, Circle import matplotlib.pyplot as plt def plot_cicle(): fig = plt.figure() ax = fig.add_subplot(111) cir1 = Circle(xy = (0.0, 0.0), radius=2, alpha=0.5) ax.add_patch(cir1) x, y = 0, 0 ax.plot(x, y, 'ro') plt.axis('scaled') plt.axis('equal') #changes limits of x or y axis so that equal increments of x and y have the same length plt.show() plot_cicle()
登录后复制
以上就是python画圆运用了什么函数的详细内容,更多请关注Work网其它相关文章!