本文的实例为大家分享了实现python画圆功能的具体代码,以供参考,具体内容如下
#-* -编码: utf-8-* -
“”'
__author__='Du '
_ _ creation _ time _=' 2018/1/417336030 '
“”'
导入编号为NP
import matplotlib.pyplot as plt
#此行用于设置chart的样式,可以进行注释
#PLT.style.use(mystyle ) )。
fig=PLT.figure (fig size=(8,8 ) )
ax=fig.add_subplot(111 ) )
ax.spines [ ' left ' ].set _ color (' none ' )
ax.spines [ ' bottom ' ].set _ color (' none ' )
ax.spines [ ' right ' ].set _ color (' none ' )
ax.spines [ ' top ' ].set _ color (' none ' )
ax.set_xticks([] )。
ax.set_yticks([] )。
#实现功能
theta=NP.arange (0,2 * NP.pi 0.1,2 * NP.pi/1000 ) ) ) ) ) ) ) ) ) ) ) ) )。)
x=NP.cos(Theta ) ) ) ) ) ) )。
y=NP.sin(Theta ) )。
v=NP.linspace (0,10,100 ) )。
v.shape=(100,1 )
x=v * x
y=v * y
PLT.plot(x,y,color='pink ' ) )。
#PLT.savefig('ball1.jpg ) )。
plt.show () )
效果图:
以上就是本文的全部内容。 希望对大家的学习有帮助。 另外,希望你能支持很多编程的诀窍。
总结
以上是编程器为你收集整理的python实现画圈功能的全部内容,希望文章能解决python实现画圈功能所面临的程序开发问题。
如果你觉得编程主页的内容不错,欢迎向程序员朋友推荐程序员网站。
此文字内容由网友互联网收集整理提供,仅供学习参考,版权归原作者所有。