python實(shí)現(xiàn)畫圓功能
更新時(shí)間:2018年01月25日 13:57:46 作者:小墨青
這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)畫圓功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
本文實(shí)例為大家分享了python實(shí)現(xiàn)畫圓功能的具體代碼,供大家參考,具體內(nèi)容如下
# -*- coding: utf-8 -*- """ __author__= 'Du' __creation_time__= '2018/1/4 17:30' """ import numpy as np import matplotlib.pyplot as plt # 該行用于設(shè)置chart 的樣式,可以注掉 # plt.style.use("mystyle") fig = plt.figure(figsize=(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([]) # 實(shí)現(xiàn)功能 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()
效果圖:
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Python實(shí)現(xiàn)定時(shí)發(fā)送監(jiān)控郵件
這篇文章主要為大家講解如何用python連接郵箱,實(shí)現(xiàn)自動發(fā)送監(jiān)控郵件,文中的示例講解詳細(xì),對我們了解Python有一定的幫助,需要的可以參考一下2022-01-01Python實(shí)現(xiàn)識別圖片為文字的示例代碼
這篇文章主要為大家詳細(xì)介紹了Python如何不調(diào)用三方收費(fèi)接口,照樣實(shí)現(xiàn)識別圖片為文字的功能。文中的示例代碼講解詳細(xì),感興趣的可以了解一下2022-08-08